Skip to content

Adding initial prototype for a MPPI trajectory validator#5319

Merged
SteveMacenski merged 7 commits intomainfrom
mppi_traj_validator
Jul 10, 2025
Merged

Adding initial prototype for a MPPI trajectory validator#5319
SteveMacenski merged 7 commits intomainfrom
mppi_traj_validator

Conversation

@SteveMacenski
Copy link
Member

@SteveMacenski SteveMacenski commented Jul 1, 2025

This creates a new plugin interface to MPPI which takes in the control request, optimal trajectory, and outputs if this is valid.

This is performed after the optimization process is completed to receive a final trajectory for smoothing - so we should already be applying kinematic and dynamic constraints to the output to make sure its valid in that regard. It should also be known collision free since that would trigger a soft and then hard reset if no trajectories are valid.

This can be used to validate the trajectory based on application specific constraints, constraints on control due to standards or multi-robot coordination, via point achievement, and so forth.

TODO

  • Add docs for this new plugin + migration guide
  • Provide a non-trivial implementation for users

On implementation, we could add in:

  • Parameter for max deviation from a path
  • Additional non-collision margin from obstacles
  • That this trajectory makes some non-trivial progress and doesn't sit idle due to a local minimum

Signed-off-by: SteveMacenski <stevenmacenski@gmail.com>
@SteveMacenski
Copy link
Member Author

@leander-dsouza we have more mypy errors :(

@SteveMacenski
Copy link
Member Author

@MarcoMatteoBassa @nourazzii take a look

@leander-dsouza leander-dsouza mentioned this pull request Jul 2, 2025
8 tasks
@leander-dsouza
Copy link
Contributor

@leander-dsouza we have more mypy errors :(

I have resolved them in #5322 :)

Copy link

@nourazzii nourazzii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few comments but overall looks good to me.

Signed-off-by: SteveMacenski <stevenmacenski@gmail.com>
@SteveMacenski SteveMacenski marked this pull request as ready for review July 7, 2025 21:02
Signed-off-by: SteveMacenski <stevenmacenski@gmail.com>
@codecov
Copy link

codecov bot commented Jul 10, 2025

Codecov Report

Attention: Patch coverage is 79.62963% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...2_mppi_controller/optimal_trajectory_validator.hpp 75.86% 7 Missing ⚠️
nav2_mppi_controller/src/optimizer.cpp 80.95% 4 Missing ⚠️
Files with missing lines Coverage Δ
...troller/include/nav2_mppi_controller/optimizer.hpp 100.00% <ø> (ø)
nav2_mppi_controller/src/controller.cpp 93.87% <100.00%> (+3.31%) ⬆️
...2_mppi_controller/src/critics/obstacles_critic.cpp 81.81% <100.00%> (ø)
...ectory_validators/optimal_trajectory_validator.cpp 100.00% <100.00%> (ø)
nav2_mppi_controller/src/optimizer.cpp 96.91% <80.95%> (-1.26%) ⬇️
...2_mppi_controller/optimal_trajectory_validator.hpp 75.86% <75.86%> (ø)

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: SteveMacenski <stevenmacenski@gmail.com>
@SteveMacenski
Copy link
Member Author

@nourazzii I added in some implementation so this does something out of the box by default. We now can check if the optimal trajectory is in collision (which it technically could be after I thought about it for some time, since the optimal trajectory is a combination of the best scored trajectories. If you're really close to an obstacle, the averaging out of the best few could make you out of dynamic feasibility. Once that is quashed down to the valid range, that could deform the trajectory by just that slight amount that makes it invalid -- so we can check for that immediately within the local time horizon).

Signed-off-by: SteveMacenski <stevenmacenski@gmail.com>
Signed-off-by: Steve Macenski <stevenmacenski@gmail.com>
@SteveMacenski SteveMacenski merged commit 7b594b0 into main Jul 10, 2025
14 of 15 checks passed
@SteveMacenski SteveMacenski deleted the mppi_traj_validator branch July 10, 2025 20:11
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.

3 participants