-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[Graceful Controller] Add deceleration limit #5511
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
Open
SakshayMahna
wants to merge
10
commits into
ros-navigation:main
Choose a base branch
from
SakshayMahna:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9c29521
Update smooth control law
SakshayMahna fce731d
Update Graceful controller
SakshayMahna a243818
Fix build issues
SakshayMahna c9396b4
Merge pull request #4 from ros-navigation/main
SakshayMahna aac6f73
Update deceleration_max for docking
SakshayMahna c74360a
Fix control_law function calls in dock controller
SakshayMahna 0f734f1
Isolate changes from nav2_docking
SakshayMahna cef28ac
Fix linting issues
SakshayMahna 563b7a4
Merge pull request #7 from ros-navigation/main
SakshayMahna 0b7e591
Use single constructor for Smooth Control Law
SakshayMahna File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,6 +32,24 @@ namespace nav2_graceful_controller | |
| class SmoothControlLaw | ||
| { | ||
| public: | ||
| /** | ||
| * @brief Constructor for nav2_graceful_controller::SmoothControlLaw | ||
| * | ||
| * @param k_phi Ratio of the rate of change in phi to the rate of change in r. | ||
| * @param k_delta Constant factor applied to the heading error feedback. | ||
| * @param beta Constant factor applied to the path curvature: dropping velocity. | ||
| * @param lambda Constant factor applied to the path curvature for sharpness. | ||
| * @param slowdown_radius Radial threshold applied to the slowdown rule. | ||
| * @param deceleration_max Maximum deceleration. | ||
| * @param v_linear_min Minimum linear velocity. | ||
| * @param v_linear_max Maximum linear velocity. | ||
| * @param v_angular_max Maximum angular velocity. | ||
| */ | ||
| SmoothControlLaw( | ||
| double k_phi, double k_delta, double beta, double lambda, | ||
| double slowdown_radius, double deceleration_max, | ||
| double v_linear_min, double v_linear_max, double v_angular_max); | ||
|
|
||
| /** | ||
| * @brief Constructor for nav2_graceful_controller::SmoothControlLaw | ||
| * | ||
|
|
@@ -71,6 +89,13 @@ class SmoothControlLaw | |
| */ | ||
| void setSlowdownRadius(const double slowdown_radius); | ||
|
|
||
| /** | ||
| * @brief Set the max deceleration | ||
| * | ||
| * @param deceleration_max Maximum deceleration possible. | ||
| */ | ||
| void setMaxDeceleration(const double deceleration_max); | ||
|
|
||
| /** | ||
| * @brief Update the velocity limits. | ||
| * | ||
|
|
@@ -86,6 +111,22 @@ class SmoothControlLaw | |
| * | ||
| * @param target Pose of the target in the robot frame. | ||
| * @param current Current pose of the robot in the robot frame. | ||
| * @param target_distance Path distance from current to target frame. | ||
| * @param backward If true, the robot is moving backwards. Defaults to false. | ||
| * @return Velocity command. | ||
| */ | ||
| geometry_msgs::msg::Twist calculateRegularVelocity( | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the duplication for the calc velocity / next pose methods? I Think this falls into the same camp to remove the duplication of methods. Can we simply call a single implementation and in the docking have the field for that be some arbitrarily high value like INF / MAX? |
||
| const geometry_msgs::msg::Pose & target, | ||
| const geometry_msgs::msg::Pose & current, | ||
| const double & target_distance, | ||
| const bool & backward = false); | ||
|
|
||
| /** | ||
| * @brief Compute linear and angular velocities command using the curvature. | ||
| * | ||
| * @param target Pose of the target in the robot frame. | ||
| * @param current Current pose of the robot in the robot frame. | ||
| * @param target_distance Path distance from current to target frame. | ||
| * @param backward If true, the robot is moving backwards. Defaults to false. | ||
| * @return Velocity command. | ||
| */ | ||
|
|
@@ -111,6 +152,25 @@ class SmoothControlLaw | |
| * @param dt Time step. | ||
| * @param target Pose of the target in the robot frame. | ||
| * @param current Current pose of the robot in the robot frame. | ||
| * @param target_distance Path distance from current to target frame. | ||
| * @param backward If true, the robot is moving backwards. Defaults to false. | ||
| * @return geometry_msgs::msg::Pose | ||
| */ | ||
| geometry_msgs::msg::Pose calculateNextPose( | ||
| const double dt, | ||
| const geometry_msgs::msg::Pose & target, | ||
| const geometry_msgs::msg::Pose & current, | ||
| const double & target_distance, | ||
| const bool & backward = false); | ||
|
|
||
| /** | ||
| * @brief Calculate the next pose of the robot by generating a velocity command using the | ||
| * curvature and the current pose. | ||
| * | ||
| * @param dt Time step. | ||
| * @param target Pose of the target in the robot frame. | ||
| * @param current Current pose of the robot in the robot frame. | ||
| * @param target_distance Path distance from current to target frame. | ||
| * @param backward If true, the robot is moving backwards. Defaults to false. | ||
| * @return geometry_msgs::msg::Pose | ||
| */ | ||
|
|
@@ -170,6 +230,11 @@ class SmoothControlLaw | |
| */ | ||
| double slowdown_radius_; | ||
|
|
||
| /** | ||
| * @brief Maximum deceleration. | ||
| */ | ||
| double deceleration_max_; | ||
|
|
||
| /** | ||
| * @brief Minimum linear velocity. | ||
| */ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.