Skip to content

Commit a3ada46

Browse files
authored
Merge pull request #890 from botsandus/mppi-visualization-docs
Mppi visualization docs
2 parents da1e5cd + 9c0bb4f commit a3ada46

2 files changed

Lines changed: 21 additions & 12 deletions

File tree

configuration/packages/configuring-mppic.rst

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,18 @@ MPPI Parameters
259259
============== ===========================
260260

261261
Description
262-
Whether to publish debugging trajectories for visualization. This can slow down the controller substantially (e.g. 1000 batches of 56 size every 30hz is a lot of data).
262+
Whether to publish debugging trajectories for visualization and critic statistics. When enabled, candidate trajectories are colored by cost (green to red gradient, magenta for collisions) and a ``nav2_msgs::msg::CriticsStats`` message is published on the ``~/critics_stats`` topic. This can slow down the controller substantially (e.g. 1000 batches of 56 size every 30hz is a lot of data).
263+
264+
:critic_index_to_visualize:
265+
266+
============== ===========================
267+
Type Default
268+
-------------- ---------------------------
269+
int 0
270+
============== ===========================
271+
272+
Description
273+
Selects which critic to visualize the color-scheme of when ``visualize`` is true publishing Marker messages for visualization in rviz. ``0`` shows the total cost across all critics, ``1..N`` selects an individual critic by index (in the order listed in the ``critics`` parameter).
263274

264275
:publish_optimal_trajectory:
265276

@@ -305,17 +316,6 @@ MPPI Parameters
305316
Description
306317
Whether to regenerate noises each iteration or use single noise distribution computed on initialization and reset. Practically, this is found to work fine since the trajectories are being sampled stochastically from a normal distribution and reduces compute jittering at run-time due to thread wake-ups to resample normal distribution.
307318

308-
:publish_critics_stats:
309-
310-
============== ===========================
311-
Type Default
312-
-------------- ---------------------------
313-
bool false
314-
============== ===========================
315-
316-
Description
317-
Whether to publish statistics about each critic's performance. When enabled, publishes a ``nav2_msgs::msg::CriticsStats`` message containing critic names, whether they changed costs, and the sum of costs added by each critic for all trajectory samples. Useful for debugging and tuning critic behavior but should not be enabled for generic runtime use.
318-
319319
:open_loop:
320320

321321
============== ===========================
@@ -1087,6 +1087,7 @@ Example
10871087
gamma: 0.015
10881088
motion_model: "DiffDrive"
10891089
visualize: false
1090+
critic_index_to_visualize: 0
10901091
reset_period: 1.0 # (only in Humble)
10911092
regenerate_noises: false
10921093
TrajectoryVisualizer:

migration/Kilted.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,3 +860,11 @@ See:
860860

861861
- :ref:`configuring_collision_monitor_node`
862862
- :ref:`configuring_collision_detector_node`
863+
864+
MPPI per-critic trajectory cost visualization
865+
---------------------------------------------
866+
867+
`PR #6036 <https://github.com/ros-navigation/navigation2/pull/6036>`_ enhances MPPI trajectory visualization with per-critic cost coloring.
868+
When ``visualize`` is enabled, candidate trajectories are now rendered as cost-colored lines using a green-to-yellow-to-red gradient, with collision trajectories shown in magenta.
869+
A new ``critic_index_to_visualize`` parameter (default ``0``) selects which critic's costs to display: ``0`` shows the total cost across all critics, while ``1..N`` selects an individual critic by index.
870+
The ``publish_critics_stats`` parameter has been removed; critic statistics (``~/critics_stats`` topic) are now published automatically when ``visualize`` is enabled.

0 commit comments

Comments
 (0)