-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[mppi] Don't reset zone-based speed limits #5768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mppi] Don't reset zone-based speed limits #5768
Conversation
f38e6c0 to
dc5fa33
Compare
SteveMacenski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other 2 lines I agree with
| // Don't reset zone-based speed limits after params changes | ||
| parameters_handler_->addPostCallback([this]() {reset(false);}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the parameters were updated, that can mean that there are new maximum/minimum limits that need to be respected. If for instance the speed limits are set as 50% of 1m/s but the new max controller speed is now 0.3m/s, that would be invalid. That seems like a potential problem on this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point.
I can see different approaches, each could make sense:
- Run the speed limit conversion again (so in your example, new max speed will be 50% * 0.3 = 0.15m/s)
- Take the lowest between the old speed with speed limit and the new value from reconfigure without speed limit
- Ignore the speed limit and only use the new value from reconfigure
I think (1) is the most strict and consistent, but maybe a bit less intuitive (user sets a new speed, but it's then modified).
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you having a situation where you're messing with the parameters in the middle of a mission via dynamic parameters? That feels like it might not be a wise choice if also using speed limit callbacks.
I also just looked at setSpeedLimit and I guess nothing about this technically prevents the ratio or set velocity from being larger than the limits in the controller (i.e. 110% or 100m/s). So... I suppose you're right that we could keep it as false to not mess with the current limits. I don't think I see an issue with keeping that at the end of a control sequence, even if the new limits are not reset here. that's not intuitive to me because then the new limits really wouldn't be looked at until a no speed limit set enum comes into the setSpeedLimit, but I suppose (?) that's the workflow as intended.
Messing around with both velocities in dynamic parameters and speed limits is super duper inadvisable which is what makes this subtle. Maybe the better action is to set boundaries that you can only set one or the other - so that this workflow is simpler to think about and programming logic? If a dynamic parameter comes in but s.constraints != s.base_constraints, reject the update. Then the rest of what you have now would be fine and we wouldn't have to be concerned about this in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, not really. The issue I really needed to fix is the other change for the fallback.
I can also restore it to true for the parameter change so the speed limit is reset if someone change the param. Maybe this is the best, at least for manual param changes? (and not some automatic reconfigure).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the best answer is this one:
Maybe the better action is to set boundaries that you can only set one or the other - so that this workflow is simpler to think about and programming logic? If a dynamic parameter comes in but s.constraints != s.base_constraints, reject the update. Then the rest of what you have now would be fine and we wouldn't have to be concerned about this in the future.
Alternatively:
I can also restore it to true for the parameter change so the speed limit is reset if someone change the param. Maybe this is the best, at least for manual param changes? (and not some automatic reconfigure).
I'd accept this for now and kick the can down the road. I'd just want a ticket filed on this topic. It would actually be a good first issue item for a student or junior engineer to work on. If its not something you need, maybe just file this ticket to give another developer the opportunity (and not use your limited cycles on something you don't need)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ticket: #5768
and I reverted the change for the dynamic params
|
how can I see the CI tests errors? I can't find any error logs. |
@adivardi Can you try pulling in / rebase main? I think this is fixed in main already |
Signed-off-by: Adi Vardi <adi.vardi@enway.ai>
Signed-off-by: Adi Vardi <adi.vardi@enway.ai>
Signed-off-by: Adi Vardi <adi.vardi@enway.ai>
Signed-off-by: Adi Vardi <adi.vardi@enway.ai>
34e09e1 to
63fdd88
Compare
Done, hope it works |
|
Now the build has timeout out after 45 minutes :( |
|
:( I don't have permission to retrigger this, let's wait for Steve |
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 19 files with indirect coverage changes 🚀 New features to boost your workflow:
|
* [mppi] Don't reset zone-based speed limits Signed-off-by: Adi Vardi <adi.vardi@enway.ai> * [mppi] update motion model params from speed_limit Signed-off-by: Adi Vardi <adi.vardi@enway.ai> * fix linting issue Signed-off-by: Adi Vardi <adi.vardi@enway.ai> * Revert: reset speed limits after param change Signed-off-by: Adi Vardi <adi.vardi@enway.ai> --------- Signed-off-by: Adi Vardi <adi.vardi@enway.ai> Signed-off-by: Christopher Thompson <cthompson@metalsharkboats.com>
* [mppi] Don't reset zone-based speed limits Signed-off-by: Adi Vardi <adi.vardi@enway.ai> * [mppi] update motion model params from speed_limit Signed-off-by: Adi Vardi <adi.vardi@enway.ai> * fix linting issue Signed-off-by: Adi Vardi <adi.vardi@enway.ai> * Revert: reset speed limits after param change Signed-off-by: Adi Vardi <adi.vardi@enway.ai> --------- Signed-off-by: Adi Vardi <adi.vardi@enway.ai>
* [mppi] Don't reset zone-based speed limits Signed-off-by: Adi Vardi <adi.vardi@enway.ai> * [mppi] update motion model params from speed_limit Signed-off-by: Adi Vardi <adi.vardi@enway.ai> * fix linting issue Signed-off-by: Adi Vardi <adi.vardi@enway.ai> * Revert: reset speed limits after param change Signed-off-by: Adi Vardi <adi.vardi@enway.ai> --------- Signed-off-by: Adi Vardi <adi.vardi@enway.ai>
* No need to spam the logs (#5674) Signed-off-by: Tim Clephas <tim.clephas@nobleo.nl> * Conditionally call onLoop based on node status (#5700) Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * Allow for no progress checkers to be configured (#5701) Signed-off-by: SteveMacenski <stevenmacenski@gmail.com> * Fix: wait for drive_on_heading_client instead of backup_client (#5724) The basic navigator was waiting for the backup_client in the driveOnHeading function. Signed-off-by: agennart <antoine.gennart@quimesis.be> Co-authored-by: agennart <antoine.gennart@quimesis.be> * Fix: reset controller_server loop_rate when missed desired rate #5712 (#5723) When a single iteration takes longer than the expected period, this impacts the next iterations behavior since they will have less time to perform the control logic, thus increasing the actual controller_frequency. By resetting the loop_rate on sleep() failure, this ensures that each iteration will have a full period to exectue its logic. Signed-off-by: agennart <antoine.gennart@quimesis.be> Co-authored-by: agennart <antoine.gennart@quimesis.be> * temporary fix bug null pointer (#5749) * temporary fix bug null pointer Signed-off-by: suifengersan123 <yangabc810@gmail.com> * add return Signed-off-by: suifengersan123 <yangabc810@gmail.com> * remove return Signed-off-by: suifengersan123 <yangabc810@gmail.com> --------- Signed-off-by: suifengersan123 <yangabc810@gmail.com> * fix: change warning to exception when goal poses cannot be transformed (#5759) - Replace RCLCPP_WARN with std::runtime_error exception in onPreempt method - Remove bt_action_server_->terminatePendingGoal() call after accepting goal - Add required stdexcept include for exception handling Fixes issue where navigators accept pending goal but are not properly terminated if rejected during goal pose transformation. Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> * Update obstacle layer usage of max ranges (#5697) * Use cell distance for obstacle marking max range Signed-off-by: Simon Dathan <simon.dathan@kudan.eu> * Don't raytrace clear the cell containing the current observation Signed-off-by: Simon Dathan <simon.dathan@kudan.eu> * Add tests for max marking and clearing ranges Signed-off-by: Simon Dathan <simon.dathan@kudan.eu> * Fix cpplint failures Signed-off-by: Simon Dathan <simon.dathan@kudan.eu> * Fix distance calculation Signed-off-by: Simon Dathan <simon.dathan@kudan.eu> * fix casting, formatting Signed-off-by: Simon Dathan <simon.dathan@kudan.eu> * check origin is in map, update CMakeLists Signed-off-by: Simon Dathan <simon.dathan@kudan.eu> * use hypot instead of squared dist Signed-off-by: Simon Dathan <simon.dathan@kudan.eu> * Move origin calc out of loop Signed-off-by: Simon Dathan <simon.dathan@kudan.eu> * Revert don't raytrace observation cell Signed-off-by: Simon Dathan <simon.dathan@kudan.eu> * Revert don't raytrace origin if it is observation cell Signed-off-by: Simon Dathan <simon.dathan@kudan.eu> * Remove new line Signed-off-by: Simon Dathan <simon.dathan@kudan.eu> --------- Signed-off-by: Simon Dathan <simon.dathan@kudan.eu> * [mppi] Don't reset zone-based speed limits (#5768) * [mppi] Don't reset zone-based speed limits Signed-off-by: Adi Vardi <adi.vardi@enway.ai> * [mppi] update motion model params from speed_limit Signed-off-by: Adi Vardi <adi.vardi@enway.ai> * fix linting issue Signed-off-by: Adi Vardi <adi.vardi@enway.ai> * Revert: reset speed limits after param change Signed-off-by: Adi Vardi <adi.vardi@enway.ai> --------- Signed-off-by: Adi Vardi <adi.vardi@enway.ai> * Bugfix inactive publishers (#5748) * Do not publish costmap unless active Signed-off-by: Christopher Thompson <cthompson@metalsharkboats.com> * Fix style Signed-off-by: Christopher Thompson <cthompson@metalsharkboats.com> * Fix typo Signed-off-by: Christopher Thompson <cthompson@metalsharkboats.com> * Use layers isEnabled() to prevent publishing Signed-off-by: Christopher Thompson <cthompson@metalsharkboats.com> * Fix style Signed-off-by: Christopher Thompson <cthompson@metalsharkboats.com> * Add missing include for CostmapLayer type Signed-off-by: Christopher Thompson <cthompson@metalsharkboats.com> * Remove extra scoping Signed-off-by: Christopher Thompson <cthompson@metalsharkboats.com> --------- Signed-off-by: Christopher Thompson <cthompson@metalsharkboats.com> Co-authored-by: Christopher Thompson <cthompson@metalsharkboats.com> * Fix MAX_NON_OBSTACLE_COST in theta star planner (#5865) Signed-off-by: mini-1235 <mauricepurnawan@gmail.com> * Bump jazzy to 1.3.11 for release Signed-off-by: SteveMacenski <stevenmacenski@gmail.com> --------- Signed-off-by: Tim Clephas <tim.clephas@nobleo.nl> Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> Signed-off-by: SteveMacenski <stevenmacenski@gmail.com> Signed-off-by: agennart <antoine.gennart@quimesis.be> Signed-off-by: suifengersan123 <yangabc810@gmail.com> Signed-off-by: Simon Dathan <simon.dathan@kudan.eu> Signed-off-by: Adi Vardi <adi.vardi@enway.ai> Signed-off-by: Christopher Thompson <cthompson@metalsharkboats.com> Signed-off-by: mini-1235 <mauricepurnawan@gmail.com> Co-authored-by: Tim Clephas <tim.clephas@nobleo.nl> Co-authored-by: Saitama <gennartan@users.noreply.github.com> Co-authored-by: agennart <antoine.gennart@quimesis.be> Co-authored-by: suifengersan123 <136066397+suifengersan123@users.noreply.github.com> Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Simon Dathan <simon.dathan@kudan.eu> Co-authored-by: Adi Vardi <57910756+adivardi@users.noreply.github.com> Co-authored-by: Christopher Thompson <pele1410@gmail.com> Co-authored-by: Christopher Thompson <cthompson@metalsharkboats.com> Co-authored-by: Maurice Alexander Purnawan <mauricepurnawan@gmail.com>
Basic Info
Description of contribution in a few bullet points
Fix 2 bugs:
reset()flag correctly to avoid resetting speed limits when other parameters are changed and after a fallback.setSpeedLimit()so that the new speed limit is updated in the motion model settings. This way thepredict()function is also aware of the new speed limit.Description of documentation updates required from your changes
None
Description of how this change was tested
Tested in simulation:
Bug 1:
Bug 2:
Print the value of one of the constraints params inside
predict(). Without this PR, it is never updated. With it, is it updated when entering/leaving a speed limit zone.Future work that may be required in bullet points
None
For Maintainers:
backport-*.