-
Notifications
You must be signed in to change notification settings - Fork 571
Added Minimum Translational Velocity Limit #329
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
base: melodic-devel
Are you sure you want to change the base?
Changes from all commits
845b65e
dcce602
f5e9580
4a852b0
4c280f7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -92,6 +92,10 @@ grp_robot.add("max_vel_x", double_t, 0, | |||||
"Maximum translational velocity of the robot", | ||||||
0.4, 0.01, 100) | ||||||
|
||||||
grp_robot.add("min_vel_x", double_t, 0, | ||||||
"Minimum translational velocity of the robot", | ||||||
0.00, 0.00, 100) | ||||||
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.
Suggested change
|
||||||
|
||||||
grp_robot.add("max_vel_x_backwards", double_t, 0, | ||||||
"Maximum translational velocity of the robot for driving backwards", | ||||||
0.2, 0.01, 100) | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -421,7 +421,7 @@ uint32_t TebLocalPlannerROS::computeVelocityCommands(const geometry_msgs::PoseSt | |||||
|
||||||
// Saturate velocity, if the optimization results violates the constraints (could be possible due to soft constraints). | ||||||
saturateVelocity(cmd_vel.twist.linear.x, cmd_vel.twist.linear.y, cmd_vel.twist.angular.z, | ||||||
cfg_.robot.max_vel_x, cfg_.robot.max_vel_y, cfg_.robot.max_vel_theta, cfg_.robot.max_vel_x_backwards); | ||||||
cfg_.robot.max_vel_x, cfg_.robot.min_vel_x, cfg_.robot.max_vel_y, cfg_.robot.max_vel_theta, cfg_.robot.max_vel_x_backwards); | ||||||
|
||||||
// convert rot-vel to steering angle if desired (carlike robot). | ||||||
// The min_turning_radius is allowed to be slighly smaller since it is a soft-constraint | ||||||
|
@@ -869,12 +869,25 @@ double TebLocalPlannerROS::estimateLocalGoalOrientation(const std::vector<geomet | |||||
} | ||||||
|
||||||
|
||||||
void TebLocalPlannerROS::saturateVelocity(double& vx, double& vy, double& omega, double max_vel_x, double max_vel_y, double max_vel_theta, double max_vel_x_backwards) const | ||||||
void TebLocalPlannerROS::saturateVelocity(double& vx, double& vy, double& omega, double max_vel_x, double max_vel_y, double max_vel_theta, double max_vel_x_backwards, double min_vel_x) const | ||||||
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. same order everywhere
Suggested change
|
||||||
{ | ||||||
double ratio_x = 1, ratio_omega = 1, ratio_y = 1; | ||||||
// Limit translational velocity for forward driving | ||||||
if (vx > max_vel_x) | ||||||
ratio_x = max_vel_x / vx; | ||||||
double ratio_x = 1, ratio_omega = 1, ratio_y = 1, ratio_x_min = 1; | ||||||
|
||||||
// backward driving | ||||||
if (vx < 0) | ||||||
{ | ||||||
if (vx < -max_vel_x_backwards) | ||||||
ratio_x = -max_vel_x_backwards / vx; | ||||||
else if (vx > -min_vel_x) | ||||||
ratio_x = -min_vel_x / vx; | ||||||
} | ||||||
else // forward driving | ||||||
{ | ||||||
if (vx > max_vel_x) | ||||||
ratio_x = max_vel_x / vx; | ||||||
else if (vx < min_vel_x) | ||||||
ratio_x = min_vel_x / vx; | ||||||
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. I'm not sure about this; ratio_x will get a value > 1, but that will be discarded here if using proportional saturation (which is the preferred option, and so we will move below min_vel_x 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. I didn't think proportional saturation side. Therefore i thought that there is no problem but you are right. If proportional saturation contains min velocity feature all twist components must speed up. Increased speed can causes unstability. Maybe this section can hard coded as below otherwise i have no solution for proportional saturation for min speed feature.
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. Yes, for sure; but I wonder if that may trigger other problems... 🤔 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. But this will fail with negative x velocities, right? 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. I think with a min velocity that requires other components to speed up for keeping the curvature is problematic, i.e. proportional scaling. There are in general cases where, for example, vy would violate max_vel_y. In particular on an omni directional drive for which it is perfectly fine to have (0, vy, 0) as a target command. 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. Good point; I also read the old @croesmann's answer to the same issue and he agrees that a minimum velocity doesn't play well with TEB architecture. 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. Firstly i constrained velocity at controller level side but in this case, robot could not able to follow the trajectory because wheel velocities did not match the velocities which generated by planner. Therefore i added to min. vel. constraint to planner side. But i understand possible problems, thanks for reviews. |
||||||
} | ||||||
|
||||||
// limit strafing velocity | ||||||
if (vy > max_vel_y || vy < -max_vel_y) | ||||||
|
Uh oh!
There was an error while loading. Please reload this page.