Skip to content

[mppi] Fix division by zero in Constraint Critic#5855

Merged
SteveMacenski merged 1 commit intoros-navigation:humble_mainfrom
Alessio-Parmeggiani:fix-division-by-zero
Jan 9, 2026
Merged

[mppi] Fix division by zero in Constraint Critic#5855
SteveMacenski merged 1 commit intoros-navigation:humble_mainfrom
Alessio-Parmeggiani:fix-division-by-zero

Conversation

@Alessio-Parmeggiani
Copy link


Basic Info

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

Description of contribution in a few bullet points

This pull request is a backport of #5636 to the humble_main branch.
This issue leads to nan costs when wz is zero with ackermann enabled, and results in the robot moving only in circles.

Description of how this change was tested

I used a test nav2 setup with a dummy local costmap and global costmap with all values equal to 0.
Motion model is set to Ackermann.

Before the fix to any goal the optimal trajectory correspond to high vx and wz and the robot going only in circles, failing after a while. The constraint critic compute NaN costs, verified by adding prints in the code.

After the fix, the previous behaviour does not happen anymore and the optimal trajectory is correct.


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
  • Should this be backported to current distributions? If so, tag with backport-*.

backporting ros-navigation#5636 to humble_main branch.
This leads to nan costs when wz is zero.

Signed-off-by: Alessio Parmeggiani <parmeggiani.alessio1@gmail.com>
@mergify
Copy link
Contributor

mergify bot commented Jan 9, 2026

@Alessio-Parmeggiani, all pull requests must be targeted towards the main development branch.
Once merged into main, it is possible to backport to @humble_main, but it must be in main
to have these changes reflected into new distributions.

@SteveMacenski SteveMacenski merged commit 20f7b9c into ros-navigation:humble_main Jan 9, 2026
2 of 3 checks passed
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