[Main] Optimize MPPI visualization to skip processing when no subscribers#5851
Merged
SteveMacenski merged 2 commits intoros-navigation:mainfrom Jan 7, 2026
Merged
Conversation
- Added subscription count check in TrajectoryVisualizer::add Signed-off-by: SatArw <satwik090202@gmail.com>
Member
|
Ill leave for Maurice to review / approve before I merge |
Remove redundant brackets in if statement Co-authored-by: Steve Macenski <stevenmacenski@gmail.com> Signed-off-by: Satwik Arawalli <96329337+SatArw@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 134 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Member
|
Eh actually I think this is good, no reason to bother Maurice, he's a busy guy |
masf7g
pushed a commit
to quasi-robotics/navigation2
that referenced
this pull request
Jan 8, 2026
…bers (ros-navigation#5851) * Optimize MPPI visualization to skip processing when no subscribers - Added subscription count check in TrajectoryVisualizer::add Signed-off-by: SatArw <satwik090202@gmail.com> * Update nav2_mppi_controller/src/trajectory_visualizer.cpp Remove redundant brackets in if statement Co-authored-by: Steve Macenski <stevenmacenski@gmail.com> Signed-off-by: Satwik Arawalli <96329337+SatArw@users.noreply.github.com> --------- Signed-off-by: SatArw <satwik090202@gmail.com> Signed-off-by: Satwik Arawalli <96329337+SatArw@users.noreply.github.com> Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>
Lotusymt
pushed a commit
to Lotusymt/navigation2
that referenced
this pull request
Jan 16, 2026
…bers (ros-navigation#5851) * Optimize MPPI visualization to skip processing when no subscribers - Added subscription count check in TrajectoryVisualizer::add Signed-off-by: SatArw <satwik090202@gmail.com> * Update nav2_mppi_controller/src/trajectory_visualizer.cpp Remove redundant brackets in if statement Co-authored-by: Steve Macenski <stevenmacenski@gmail.com> Signed-off-by: Satwik Arawalli <96329337+SatArw@users.noreply.github.com> --------- Signed-off-by: SatArw <satwik090202@gmail.com> Signed-off-by: Satwik Arawalli <96329337+SatArw@users.noreply.github.com> Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>
Lotusymt
pushed a commit
to Lotusymt/navigation2
that referenced
this pull request
Jan 16, 2026
…bers (ros-navigation#5851) * Optimize MPPI visualization to skip processing when no subscribers - Added subscription count check in TrajectoryVisualizer::add Signed-off-by: SatArw <satwik090202@gmail.com> * Update nav2_mppi_controller/src/trajectory_visualizer.cpp Remove redundant brackets in if statement Co-authored-by: Steve Macenski <stevenmacenski@gmail.com> Signed-off-by: Satwik Arawalli <96329337+SatArw@users.noreply.github.com> --------- Signed-off-by: SatArw <satwik090202@gmail.com> Signed-off-by: Satwik Arawalli <96329337+SatArw@users.noreply.github.com> Co-authored-by: Steve Macenski <stevenmacenski@gmail.com> Signed-off-by: lotusymt <mengtiy5@uci.edu>
Pana1v
pushed a commit
to Arnav-panjla/navigation2
that referenced
this pull request
Feb 21, 2026
…bers (ros-navigation#5851) * Optimize MPPI visualization to skip processing when no subscribers - Added subscription count check in TrajectoryVisualizer::add Signed-off-by: SatArw <satwik090202@gmail.com> * Update nav2_mppi_controller/src/trajectory_visualizer.cpp Remove redundant brackets in if statement Co-authored-by: Steve Macenski <stevenmacenski@gmail.com> Signed-off-by: Satwik Arawalli <96329337+SatArw@users.noreply.github.com> --------- Signed-off-by: SatArw <satwik090202@gmail.com> Signed-off-by: Satwik Arawalli <96329337+SatArw@users.noreply.github.com> Co-authored-by: Steve Macenski <stevenmacenski@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.
Basic Info
Description of contribution in a few bullet points
This PR is an adaptation of #5807 for the main (rolling) branch.
TrajectoryVisualizer::addto check subscription counts before executing the marker generation loops.get_subscription_count()on the/candidate_trajectories(MarkerArray) and/optimal_path(Path) publishers.visualizeis set totrue:/optimal_pathonly: Generates and publishes the visualization data for only the optimal trajectory./candidate_trajectories: Generates the visualization data for all the trajectories (including the optimal trajectory).controller_serverCPU usage when visualization is enabled but not being actively viewed.Description of documentation updates required from your changes
visualizeparameter.Description of how this change was tested
Unit Testing:
nav2_mppi_controllerGTest suite locally. All tests pass (100%).Performance Testing:
visualize=truebut no subscribers are present.publish_optimal_trajectoryparameter, but this PR's optimization is independent and complementary to that feature.Future work that may be required in bullet points
For Maintainers:
backport-*.