Skip to content

[nav2_mppi_controller] Reset motion model with optimizer (for param change) (backport #5149)#5156

Merged
SteveMacenski merged 1 commit intojazzyfrom
mergify/bp/jazzy/pr-5149
May 13, 2025
Merged

[nav2_mppi_controller] Reset motion model with optimizer (for param change) (backport #5149)#5156
SteveMacenski merged 1 commit intojazzyfrom
mergify/bp/jazzy/pr-5149

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented May 13, 2025


Basic Info

Info Please fill out this column
Ticket(s) this addresses -
Primary OS tested on Ubuntu
Robotic platform tested on Gazebo simulation
Does this PR contain AI generated software? No

Description of contribution in a few bullet points

  • Fix a bug where the motion_model is not reset when the optimizer is reset. This causes parameters changes to not be updated in the motion model, even though they are updated in the optimizer.
  • I noticed the MPPI behavior getting worse when dynamically changing control constraints (in my case az_max)

Description of documentation updates required from your changes

None

Description of how this change was tested

The old fashion way - using prints:
Added this print after the line changed in this PR.

  std::cout << "Optimizer::reset: " << "\n settings_.constraints.az_max: "
            << settings_.constraints.az_max
            << "\n settings_.base_constraints.az_max: " << settings_.base_constraints.az_max
            << "\n motion_model_.az_max " << motion_model_->control_constraints_.az_max << std::endl;

The call ros2 param set /controller_server FollowPath.az_max 1.0
Without the change, the last line value is not updated to the new value requested.
You can also add prints in places such as optimizer and motion_model

I am happy to hear suggestions on how to test this more properly.


Future work that may be required in bullet points

For Maintainers:

  • Check that any new parameters added are updated in docs.nav2.org
  • Check that any significant change is added to the migration guide
  • Check that any new features OR changes to existing behaviors are reflected in the tuning guide
  • Check that any new functions have Doxygen added
  • Check that any new features have test coverage
  • Check that any new plugins is added to the plugins page
  • If BT Node, Additionally: add to BT's XML index of nodes for groot, BT package's readme table, and BT library lists

This is an automatic backport of pull request #5149 done by [Mergify](https://mergify.com).

Signed-off-by: Adi Vardi <adi.vardi@enway.ai>
(cherry picked from commit d362e74)
@mergify
Copy link
Contributor Author

mergify bot commented May 13, 2025

@mergify[bot], all pull requests must be targeted towards the main development branch.
Once merged into main, it is possible to backport to @jazzy, but it must be in main
to have these changes reflected into new distributions.

@SteveMacenski SteveMacenski merged commit 2dde228 into jazzy May 13, 2025
6 of 8 checks passed
@mergify mergify bot deleted the mergify/bp/jazzy/pr-5149 branch May 13, 2025 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants