CudaRobotics Docs

ROS 2 plugin

Nav2 CUDA MPPI Controller

`cuda_mppi_controller::CudaMppiController` is a Nav2 controller plugin that maps each sampled trajectory rollout to one CUDA thread. v0.1.0 includes DiffDrive, Ackermann, and Omni motion-model support.

Build and Smoke Test

cd ros2_ws
colcon build --packages-select cuda_mppi_controller \
  --cmake-args -DCMAKE_BUILD_TYPE=Release
source install/setup.bash

ros2 run cuda_mppi_controller plugin_load_test
ros2 run cuda_mppi_controller parameter_validation_test
ros2 run cuda_mppi_controller mppi_gpu_standalone 2048
CUDA MPPI and Nav2 CPU MPPI rollout comparison
Closed-loop controller benchmark comparing the stock CPU controller and CUDA controller.

Controller Server Config

Point `controller_server` at the plugin and set the MPPI horizon, sample count, model, and limits.

controller_server:
  ros__parameters:
    controller_plugins: ["FollowPath"]
    FollowPath:
      plugin: "cuda_mppi_controller::CudaMppiController"
      batch_size: 8192
      time_steps: 56
      model_dt: 0.05
      motion_model: "DiffDrive"

Full example: cuda_mppi_params.example.yaml.

Validated Parameters

Invalid configuration is rejected during configure and live parameter updates before the optimizer is rebuilt.

Horizon

Batch, steps, dt

`batch_size`, `time_steps`, `iteration_count`, `model_dt`, and `temperature` must be positive.

Limits

Velocity and model limits

Control bounds must be finite and internally consistent for the selected motion model.

Costs

Weights and lookahead

Weights, lookahead distances, transform tolerance, and retreat scale reject invalid values.

Motion Models

Model Controls Notes
DiffDrive `vx`, `wz` Default model for differential-drive bases.
Ackermann `vx`, curvature-limited `wz` Uses `min_turning_r` to limit angular rate by forward speed.
Omni `vx`, `vy`, `wz` Adds lateral velocity sampling and limits.