RoboStack / RoboStack/ros-jazzy
[linux-64] MPPI 1.3.12 predicts motion in the wrong direction due to stale build dependency (xsimd / fast-math)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 44
- Forks
- 55
- Avg merge
- 8h 57m
- Merged PRs (30d)
- 14
Description
Solution to issue cannot be found in the documentation.
- I checked the documentation.
Issue
On Ubuntu 24.04 / ROS 2 Jazzy, the apt-distributed MPPI generates forward commands, while the RoboStack build generates predominantly reverse commands despite the global path being ahead. Both were tested on the same machine with the same Nav2 version, controller configuration, and recorded inputs.
| RoboStack (affected) | apt (comparison) | |
|---|---|---|
| MPPI package | ros2-nav2-mppi-controller |
ros-jazzy-nav2-mppi-controller |
| Nav2 version | 1.3.12 | 1.3.12 |
| Package build / revision | np2py312h2ed9cc7_21 |
1noble.20260615.165555 |
| Build compiler | GCC 14.4.0 | Not verified |
| xsimd | 10.0.0 at build time | 12.1.1 installed system headers |
| xtensor | 0.24.7 at build time | 0.25.0 installed system headers |
| Mean commanded linear.x | −0.01739 m/s | +0.19250 m/s |
| Reverse commands | 95% | 0% |
(The apt binary's exact build dependencies have not been verified. RoboStack build dependencies were read from the affected artifact's info/recipe/rendered_recipe.yaml.)
Investigation
The error appears in MPPI's batch trajectory integration, before critic scoring. The Nav2 1.3.12 integrator uses SIMD sine/cosine to convert sampled velocities into candidate positions. Its CMake configuration enables xsimd and -ffast-math.
A standalone test using the same xsimd 10.0.0 headers as the RoboStack build produces incorrect signs:
| Expression | Expected | With -ffast-math |
|---|---|---|
| cos(0) | +1.000000 | −1.000000 |
| sin(0.5) | +0.479426 | −0.479426 |
| cos(0.5) | +0.877583 | −0.877583 |
| sin(1.5) | +0.997495 | −0.997495 |
The suspected cause is the interaction between fast-math and xsimd's use of positive/negative zero as sign masks. Removing -ffast-math or appending -fsigned-zeros restores the expected numerical results.
The installed MPPI integrator also predicts −0.270 m along X instead of +0.280 m for a straight trajectory at yaw=0, vx=0.1 m/s, and 56 steps of 0.05 s. Incorrect candidate directions can therefore make a reverse command appear to approach the forward path.
Would updating the build-time xsimd dependency and rebuilding MPPI possible? A newer xsimd alone is not yet a confirmed fix; if errors persist, disabling -ffast-math may be necessary.
Installed packages
ros2-nav2-mppi-controller 1.3.12 np2py312h2ed9cc7_21 robostack-jazzy
# Build dependencies from the affected artifact's rendered_recipe.yaml
GCC 14.4.0 / xtensor 0.24.7 / xsimd 10.0.0 / xtl 0.7.7
Environment info
Ubuntu 24.04 / ROS 2 Jazzy / linux-64
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with nav2_mppi_controller/src/optimizer.cpp and nav2_mppi_controller/CMakeLists.txt at Nav2 1.3.12, then inspect the affected artifact's info/recipe/rendered_recipe.yaml for xsimd and xtensor versions. Reproduce the standalone xsimd sine/cosine results and the straight-trajectory integration case. Done means the rebuilt MPPI package produces correct signs and forward commands under the reported Ubuntu 24.04 / ROS 2 Jazzy setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp, linux, ubuntu
- Domain
- build-system, robotics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100