Repository navigation
MPPI for differential and holonomic robots - #158
Merged
Merged
Conversation
motion_model diff/omni, heading_mode path/free/goal/hold/fixed and the NavState heading_reference, lateral limits, exact footprint checks, obstacles all around, and a longer, more robust optimization. Fixes #157 Signed-off-by: Francisco Martín Rico <fmrico@gmail.com>
The differential defaults (path 15, heading 10) let the robot drift off the path in tight turns. Both models now use path 40 and heading 20, and an obstacle on the path scales them by 0.01 (was 0.1) so the robot can still go around it. Signed-off-by: Francisco Martín Rico <fmrico@gmail.com>
fmrico
force-pushed
the
mppi_holonomic
branch
from
October 31, 2026 18:29
5239656 to
0d2514a
Compare
Unoptimized, 500 rollouts of 40 steps do not fit in a control cycle, and the scenario tests time out (the CI builds with no build type). Signed-off-by: Francisco Martín Rico <fmrico@gmail.com>
It only runs in optimized builds, which the CI is now; its runner is about twice slower than a desktop (16-20 ms against 15). Signed-off-by: Francisco Martín Rico <fmrico@gmail.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #157
The MPPI controller rewritten, for differential and holonomic robots, round or not. Needs EasyNavigation/EasyNavigation#153 and EasyNavigation/EasyNavigation#154 (merged).
Motion models (
motion_model):diff(default):linear.xandangular.z, always facing along the path.omni: alsolinear.y. The control sequence is kept in the map frame, so turning does not change the course. Translation is limited by the ellipse ofmax_linear_vel(min_linear_velbackwards) andmax_lateral_vel: diagonals are not faster than the axes. A zero lateral limit makes it a differential robot.Heading of a holonomic robot while moving (
heading_mode):path(default, facing the path ahead),free,goal,hold(the heading when the goal arrived),fixed(heading_yaw). The NavState keyheading_reference(rad, map frame), while present, overrides it. The goal's heading is always reached at the end. A differential robot ignores both, with a warning if configured.Optimizer:
heading_lookaheadahead), goal heading near the goal (omni), obstacle margin (quadratic), collision, backwards (diff), smoothness. With an obstacle on the path within reach, path and heading weights drop to a hundredth.Obstacles and shape:
obstacle_range(fovis deprecated: it warns, no effect).robot_geometry.footprint, the polygon is checked turned with each rollout, exactly in the band where the circles cannot decide. Its own radii are used, not the configured ones (which may be planning margins).Goal: turns in place to the goal's heading, braking in time, once at the position; stops within both tolerances (the strictest of the plugin's and the system's). Reports blocked when every rollout collides.
Limits:
controller_node.robot_limits, lateral ones included.Configuration impact: existing configs keep working as
diff. The playground configs are updated in easynav_playgrounds (following PR).Tests
mppi_optimizer_tests(19): limits, ellipse, zero-lateral axis, warm start, arrival, alignment, blocked, the distance grids.mppi_scenarios_tests: a kinematic simulator with the controller's velocity smoother, in 6 configurations (diff; omni in each heading mode) × 16 paths (straight, L, U, backwards, sideways, diagonal, S, loose goal, turn in place, obstacle, narrow corridor, L corridor, wall, long path, loop), checking arrival, no collision, limits and heading while moving. Plus rectangular robots: narrow corridor, a door that requires turning, turning next to a wall.mppi_controller_modes_tests(8): parameters, unknown modes, commands per model and mode,heading_reference, idle, footprint.mppi_controller_obstacle_points_tests: points all around.Also checked in Gazebo: Kobuki (8 goals), omni playground in
pathandgoalmodes (6 + 6), TIAGo Pro inpathandgoalmodes (5 + 5), all reached without collisions.The scenario matrix takes about 6 minutes.