-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add acceleration limits to DriveOnHeading and BackUp behaviors #4810
base: main
Are you sure you want to change the base?
Add acceleration limits to DriveOnHeading and BackUp behaviors #4810
Conversation
@RBT22, your PR has failed to build. Please check CI outputs and resolve issues. |
1 similar comment
@RBT22, your PR has failed to build. Please check CI outputs and resolve issues. |
a6633a8
to
228de3b
Compare
@RBT22, your PR has failed to build. Please check CI outputs and resolve issues. |
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.
Build is failing - not 100% sure why off hand other than it relates to a method added
nav2_behaviors/include/nav2_behaviors/plugins/drive_on_heading.hpp
Outdated
Show resolved
Hide resolved
nav2_behaviors/include/nav2_behaviors/plugins/drive_on_heading.hpp
Outdated
Show resolved
Hide resolved
nav2_behaviors/include/nav2_behaviors/plugins/drive_on_heading.hpp
Outdated
Show resolved
Hide resolved
nav2_behaviors/include/nav2_behaviors/plugins/drive_on_heading.hpp
Outdated
Show resolved
Hide resolved
@RBT22, your PR has failed to build. Please check CI outputs and resolve issues. |
f8f5bd8
to
36daf76
Compare
@RBT22, your PR has failed to build. Please check CI outputs and resolve issues. |
36daf76
to
83b4ff4
Compare
@RBT22, your PR has failed to build. Please check CI outputs and resolve issues. |
1 similar comment
@RBT22, your PR has failed to build. Please check CI outputs and resolve issues. |
79dbabc
to
836fb46
Compare
@RBT22, your PR has failed to build. Please check CI outputs and resolve issues. |
a56b9c8
to
544887c
Compare
Codecov ReportAttention: Patch coverage is
|
Sorry for the delayed review - see comment above. It also looks like this block doesn't have any test coverage. I think you should make a new backup or drive on heading unit or system test which specifies acceleration limits to exercise. This is not ABI/API breaking, so once approved, you could open a PR to backport to Jazzy/Humble if you wanted either (Jazzy I may be able to do automatically, Humble I definitely can't / wouldn't unless someone else opened it) |
nav2_behaviors/include/nav2_behaviors/plugins/drive_on_heading.hpp
Outdated
Show resolved
Hide resolved
nav2_behaviors/include/nav2_behaviors/plugins/drive_on_heading.hpp
Outdated
Show resolved
Hide resolved
544887c
to
9b9a6ce
Compare
@RBT22, your PR has failed to build. Please check CI outputs and resolve issues. |
nav2_behaviors/include/nav2_behaviors/plugins/drive_on_heading.hpp
Outdated
Show resolved
Hide resolved
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.
Also, configuration guide entries are needed and migration guide to mention the new params
nav2_behaviors/include/nav2_behaviors/plugins/drive_on_heading.hpp
Outdated
Show resolved
Hide resolved
bd6054d
to
112b5fb
Compare
Signed-off-by: RBT22 <[email protected]>
Signed-off-by: RBT22 <[email protected]>
Signed-off-by: RBT22 <[email protected]>
Signed-off-by: RBT22 <[email protected]>
Signed-off-by: RBT22 <[email protected]>
Signed-off-by: RBT22 <[email protected]>
Signed-off-by: RBT22 <[email protected]>
Signed-off-by: RBT22 <[email protected]>
Signed-off-by: RBT22 <[email protected]>
Signed-off-by: RBT22 <[email protected]>
112b5fb
to
84b1fec
Compare
Hi @SteveMacenski, I’ve been looking into the testing setup, and I believe I might have misunderstood it initially. If I’m interpreting this correctly now, the tests for the behaviors themselves are part of the nav2_system_tests package. Is that correct? If so, I’ll need to edit the backup_tester.py and drive_tester.py scripts to incorporate the acceleration checks. Thanks for your guidance! |
@@ -133,7 +134,35 @@ class DriveOnHeading : public TimedBehavior<ActionT> | |||
cmd_vel->header.frame_id = this->robot_base_frame_; | |||
cmd_vel->twist.linear.y = 0.0; | |||
cmd_vel->twist.angular.z = 0.0; | |||
cmd_vel->twist.linear.x = command_speed_; | |||
if (acceleration_limit_ <= 0.0 || deceleration_limit_ >= 0.0) { | |||
cmd_vel->twist.linear.x = command_speed_; |
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.
Add an RCLCPP_INFO_ONCE
that accel/decel limits were not set
rclcpp::ParameterValue(0.10)); | ||
node->get_parameter(this->behavior_name_ + ".acceleration_limit", acceleration_limit_); | ||
node->get_parameter(this->behavior_name_ + ".deceleration_limit", deceleration_limit_); | ||
node->get_parameter(this->behavior_name_ + ".minimum_speed", minimum_speed_); |
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.
Check after this to force the accel/decel to be positive/negative. That will save users some headaches
} else { | ||
double current_speed = last_vel_ == std::numeric_limits<double>::max() ? 0.0 : last_vel_; | ||
|
||
double min_feasible_speed = current_speed + deceleration_limit_ / this->cycle_frequency_; |
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.
What if the current_speed
is negative? If you have asymmetric acceleration and deceleration limits (i.e. -1.0, 2.5
) then the 'accelerating backward' will be deceleration and decelerating backward
will be acceleration
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.
(we have this issue in MPPI too, so its an easy thing to miss #4601)
Yes! .. Actually I don't remember what tests you were modifying now. The force pushes removed the changes from the history so I can't recount. |
Basic Info
Description of contribution in a few bullet points
Added two params:
acceleration_limit
anddeceleration_limit
for DriveOnHeading and BackUp behaviors.Description of documentation updates required from your changes
Added new parameter, so need to add that to default configs and documentation page
Future work that may be required in bullet points
For Maintainers: