-
Notifications
You must be signed in to change notification settings - Fork 1
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 constraints to MPPI controller #18
base: noetic
Are you sure you want to change the base?
Conversation
simplescreenrecorder-2025-02-07_12.22.04.mp4 |
@Nisarg236 you need to increase the buffer, otherwise we cannot see the ramp up of the velocity. |
@renan028 I used the derivative feature of plotjuggler and set the acceleration limit in x between 0.7 and -0.7 this is what I got. When the robot is making a turn it goes out of the limits mostly in negative side. simplescreenrecorder-2025-02-13_18.05.58.mp4 |
float vy_last = state.vy(i, 0); | ||
float wz_last = state.wz(i, 0); | ||
for (unsigned int j = 1; j != state.vx.shape(1); j++) { | ||
double cvx_curr = state.cvx(i, j - 1); |
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.
F: in the original, this is reference, thus it is changing both state.cvx(i, j - 1)
and state.vx(i, j)
state.vx(i, j) = cvx_curr; | ||
vx_last = cvx_curr; | ||
|
||
double cwz_curr = state.cwz(i, j - 1); |
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.
F: also reference here
wz_last = cwz_curr; | ||
|
||
if (is_holo) { | ||
double cvy_curr = state.cvy(i, j - 1); |
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.
F: reference
src/optimizer.cpp
Outdated
break; | ||
default: | ||
ROS_WARN_NAMED("Optimizer", | ||
"Model %d is not valid! Valid options are DiffDrive, Omni, or Ackermann; defaulting to DiffDrive", | ||
model); | ||
motion_model_ = std::make_shared<DiffDriveMotionModel>(); | ||
motion_model_->initialize(settings_.constraints, settings_.model_dt); |
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.
Q/R: can't we do a single call motion_model_->initialize(settings_.constraints, settings_.model_dt);
after the switch case?
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.
Yes I changed it
AB#49690
Don't allow new velocity to be such that the resulting acceleration is more than what the robot could perform
backported from nav2: ros-navigation/navigation2#4352