Repository navigation
[Jazzy] Optimize MPPI visualization to skip processing when no subscribers - #5807
SteveMacenski merged 2 commits into
Conversation
- Added subscription count check in TrajectoryVisualizer::add Signed-off-by: SatArw <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 3 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
Conceptually, I agree with this PR, but I'll leave it to @SteveMacenski in case he has other preferences |
SteveMacenski
left a comment
There was a problem hiding this comment.
Please submit against the main branch so that it is applied in rolling and all other new branches
|
Sure, I will submit these changes as a new PR against the
I'm new to this, so I'd appreciate these clarifications. Thank you. |
Typically we require more comprehensive testing before submitting a PR. However, since you have already tested this on the Jazzy branch and the changes are relatively simple, I think it's fine not to rerun everything.
You can leave this PR open. Once the PR targeting main is merged, we'll merge this one for Jazzy too :) |
|
Ill leave for Maurice to review / approve before I merge |
Remove redundant brackets in the if statement. Co-authored-by: Steve Macenski <[email protected]> Signed-off-by: Satwik Arawalli <[email protected]>
…ibers (ros-navigation#5807) * Optimize MPPI visualization to skip processing when no subscribers - Added subscription count check in TrajectoryVisualizer::add Signed-off-by: SatArw <[email protected]> * Update nav2_mppi_controller/src/trajectory_visualizer.cpp Remove redundant brackets in the if statement. Co-authored-by: Steve Macenski <[email protected]> Signed-off-by: Satwik Arawalli <[email protected]> --------- Signed-off-by: SatArw <[email protected]> Signed-off-by: Satwik Arawalli <[email protected]> Co-authored-by: Steve Macenski <[email protected]>
* Backport RouteTool RViz plugin to Jazzy (ros-navigation#5663) (ros-navigation#5727) * Backport RouteTool RViz plugin to Jazzy (ros-navigation#5663) Adds the RouteTool panel to nav2_rviz_plugins for creating and editing route graphs in RViz2. Changes: - Add route_tool.hpp/cpp with Jazzy-compatible namespaces - Add nav2_route dependency to nav2_rviz_plugins - Fix nav2_route include export paths - Add UI resources and launch files for RouteTool Jazzy compatibility fixes: - Use nav2_util::LifecycleNode instead of nav2::LifecycleNode - Use rclcpp::Subscription instead of nav2::Subscription Tested: Builds successfully, plugin loads in RViz2 Signed-off-by: Prathmesh Atkale <[email protected]> * fix Linting: added newline at end of file Signed-off-by: Prathmesh Atkale <[email protected]> * Fix linting: remove blank line at end of Python file Signed-off-by: Prathmesh Atkale <[email protected]> * Fix uncrustify formatting for route_tool files Signed-off-by: Prathmesh Atkale <[email protected]> * Updated nav2_route/CMakeLists.txt to original Jazzy Signed-off-by: Prathmesh Atkale <[email protected]> * Fix RouteTool backport to jazzy - Changed nav2::LifecycleNode to nav2_util::LifecycleNode (correct namespace for jazzy) - Fixed plugins_description.xml: changed base_class_type from rviz_common::Tool to rviz_common::Panel Tested in RViz - plugin loads correctly and creates route graph nodes/edges. Signed-off-by: Prathmesh Atkale <[email protected]> --------- Signed-off-by: Prathmesh Atkale <[email protected]> * Backport GetCurrentPose, ArePosesNear, and ConcatenatePaths BT nodes for Route Server in Jazzy, and minimal BT for navigation. (ros-navigation#5755) * Backported GetCurrentPose, ConcatenatePaths and ArePosesNear BT nodes to Jazzy Signed-off-by: Pau Reverté <[email protected]> * Created minimum BT for navigation using RouteServer, without replanning Signed-off-by: Pau Reverté <[email protected]> * GetCurrentPose and ArePosesNear use deconflictPortAndParamFile for frames Signed-off-by: Pau Reverté <[email protected]> * Apply cpplint and uncrustify formatting corrections for new BT nodes Signed-off-by: Pau Reverté <[email protected]> * Original copyright Signed-off-by: Pau Reverté <[email protected]> * Added test for GetCurrentPose, ConcatenatePaths and ArePosesNear Signed-off-by: Pau Reverté <[email protected]> * Correct copyright for GetCurrentPose Signed-off-by: Pau Reverté <[email protected]> * GetCurrentPose heritages from BT::ActionNodeBase Signed-off-by: Pau Reverté <[email protected]> * ArePosesNear uses isStatusActive Signed-off-by: Pau Reverté <[email protected]> * Added route_server to server_handler for BT test in building Signed-off-by: Pau Reverté <[email protected]> * GetCurrentPose, ArePosesNear and ConcatenatePaths closer to main branch structure Signed-off-by: Pau Reverté <[email protected]> * Removed new BT with routes and nav2_system_tests additions for testing this tree, back to original Signed-off-by: Pau Reverté <[email protected]> * Removed override of halt function for get_current_pose_action.cpp Signed-off-by: Pau Reverté <[email protected]> * Removed default values for input ports of GetCurrentPose Signed-off-by: Pau Reverté <[email protected]> --------- Signed-off-by: Pau Reverté <[email protected]> * Groot monitoring support back ported to jazzy (ros-navigation#5762) * Groot monitoring support back ported to jazzy Signed-off-by: Mike Slembrouck <[email protected]> * add test_json_utils to CMakeLists.txt Signed-off-by: mikeslembrouckZYGO <[email protected]> Signed-off-by: Mike Slembrouck <[email protected]> * Remove WaypointStatus tests from JsonTest Removed tests related to WaypointStatus from JsonTest class. Signed-off-by: mikeslembrouckZYGO <[email protected]> Signed-off-by: Mike Slembrouck <[email protected]> * Add JSON parsing support for key conversion in bt_utils Signed-off-by: Mike Slembrouck <[email protected]> * Add Groot monitoring support in system tests and parameters Signed-off-by: Mike Slembrouck <[email protected]> * Fix uncrustify and flake8 errors Signed-off-by: Mike Slembrouck <[email protected]> * Fix extra blank line in nav_to_pose_tester_node.py Signed-off-by: Mike Slembrouck <[email protected]> * Remove unused Groot-related code and parameters Signed-off-by: Mike Slembrouck <[email protected]> * Add JSON type registration for ports in behavior tree plugins Signed-off-by: Mike Slembrouck <[email protected]> * Update JSON type registration to use `std::vector<geometry_msgs::msg::PoseStamped>` instead of `nav_msgs::msg::Goals` Signed-off-by: Mike Slembrouck <[email protected]> * Include `json_export` header in behavior tree plugins to enable JSON export functionality Signed-off-by: Mike Slembrouck <[email protected]> * Revert header include order Signed-off-by: Mike Slembrouck <[email protected]> * Remove unnecessary blank line in header file Signed-off-by: mikeslembrouckZYGO <[email protected]> * Remove extra blank lines Signed-off-by: Mike Slembrouck <[email protected]> --------- Signed-off-by: Mike Slembrouck <[email protected]> Signed-off-by: mikeslembrouckZYGO <[email protected]> * Backport jazzy: Update obstacle layer usage of max range (ros-navigation#5775) * Update obstacle layer usage of max ranges (ros-navigation#5697) * Use cell distance for obstacle marking max range Signed-off-by: Simon Dathan <[email protected]> * Don't raytrace clear the cell containing the current observation Signed-off-by: Simon Dathan <[email protected]> * Add tests for max marking and clearing ranges Signed-off-by: Simon Dathan <[email protected]> * Fix cpplint failures Signed-off-by: Simon Dathan <[email protected]> * Fix distance calculation Signed-off-by: Simon Dathan <[email protected]> * fix casting, formatting Signed-off-by: Simon Dathan <[email protected]> * check origin is in map, update CMakeLists Signed-off-by: Simon Dathan <[email protected]> * use hypot instead of squared dist Signed-off-by: Simon Dathan <[email protected]> * Move origin calc out of loop Signed-off-by: Simon Dathan <[email protected]> * Revert don't raytrace observation cell Signed-off-by: Simon Dathan <[email protected]> * Revert don't raytrace origin if it is observation cell Signed-off-by: Simon Dathan <[email protected]> * Remove new line Signed-off-by: Simon Dathan <[email protected]> --------- Signed-off-by: Simon Dathan <[email protected]> * Fix tests for jazzy Signed-off-by: Simon Dathan <[email protected]> --------- Signed-off-by: Simon Dathan <[email protected]> * fix typo in route tool plugin name (ros-navigation#5809) Signed-off-by: EricoMeger <[email protected]> * fix Z base frame transformation (ros-navigation#5794) (ros-navigation#5815) (cherry picked from commit 4534ff1) Signed-off-by: Guillaume Doisy <[email protected]> Co-authored-by: Guillaume Doisy <[email protected]> Co-authored-by: Guillaume Doisy <[email protected]> * Fix initialize in drive on heading action node (ros-navigation#5842) Signed-off-by: Maurice <[email protected]> Co-authored-by: Johannes Plapp <[email protected]> * Add symmetric goal for goal checker and mppi goal angle critic (ros-navigation#5833) (ros-navigation#5848) * Add symmetric goal for goal checker and mppi goal angle critic * Lint * Update nav2_mppi_controller/README.md --------- Signed-off-by: mini-1235 <[email protected]> Signed-off-by: Maurice Alexander Purnawan <[email protected]> Co-authored-by: Sandeep Dutta <[email protected]> Co-authored-by: Steve Macenski <[email protected]> * [Jazzy] Optimize MPPI visualization to skip processing when no subscribers (ros-navigation#5807) * Optimize MPPI visualization to skip processing when no subscribers - Added subscription count check in TrajectoryVisualizer::add Signed-off-by: SatArw <[email protected]> * Update nav2_mppi_controller/src/trajectory_visualizer.cpp Remove redundant brackets in the if statement. Co-authored-by: Steve Macenski <[email protected]> Signed-off-by: Satwik Arawalli <[email protected]> --------- Signed-off-by: SatArw <[email protected]> Signed-off-by: Satwik Arawalli <[email protected]> Co-authored-by: Steve Macenski <[email protected]> * Add new parameter to nav2_velocity_smoother to also smooth the timestamp of TwistStamped messages (ros-navigation#5858) * Add new parameter to nav2_velocity_smoother that updates the timestamp of the smoothed velocity header message Signed-off-by: Andrei Costinescu <[email protected]> * Update parameter description of stamp_smoothed_velocity_with_smoothing_time in nav2_velocity_smoother/README.md Signed-off-by: Andrei Costinescu <[email protected]> * Add new parameter stamp_smoothed_velocity_with_smoothing_time in parameter examples in nav2_bringup Signed-off-by: Andrei Costinescu <[email protected]> * Fix lines too long cpplint issues in velocity_smoother.cpp Signed-off-by: Andrei Costinescu <[email protected]> * Rephrase parameter description for improved clarity Signed-off-by: Andrei Costinescu <[email protected]> * Rename delta time variable for clarity. Signed-off-by: Andrei Costinescu <[email protected]> * Make the time-smoothing computation more concise. Signed-off-by: Andrei Costinescu <[email protected]> * Change code to 1) not write the timestamp in the cmd_vel->header twice and 2) make the difference explicit between using and not using the new parameter Signed-off-by: Andrei Costinescu <[email protected]> --------- Signed-off-by: Andrei Costinescu <[email protected]> * Fix MAX_NON_OBSTACLE_COST in theta star planner (ros-navigation#5865) (ros-navigation#5868) (cherry picked from commit 018dca9) Signed-off-by: mini-1235 <[email protected]> Co-authored-by: Maurice Alexander Purnawan <[email protected]> * Jazzy sync Jan 23, 2026 (ros-navigation#5890) * No need to spam the logs (ros-navigation#5674) Signed-off-by: Tim Clephas <[email protected]> * Conditionally call onLoop based on node status (ros-navigation#5700) Signed-off-by: Steve Macenski <[email protected]> * Allow for no progress checkers to be configured (ros-navigation#5701) Signed-off-by: SteveMacenski <[email protected]> * Fix: wait for drive_on_heading_client instead of backup_client (ros-navigation#5724) The basic navigator was waiting for the backup_client in the driveOnHeading function. Signed-off-by: agennart <[email protected]> Co-authored-by: agennart <[email protected]> * Fix: reset controller_server loop_rate when missed desired rate ros-navigation#5712 (ros-navigation#5723) When a single iteration takes longer than the expected period, this impacts the next iterations behavior since they will have less time to perform the control logic, thus increasing the actual controller_frequency. By resetting the loop_rate on sleep() failure, this ensures that each iteration will have a full period to exectue its logic. Signed-off-by: agennart <[email protected]> Co-authored-by: agennart <[email protected]> * temporary fix bug null pointer (ros-navigation#5749) * temporary fix bug null pointer Signed-off-by: suifengersan123 <[email protected]> * add return Signed-off-by: suifengersan123 <[email protected]> * remove return Signed-off-by: suifengersan123 <[email protected]> --------- Signed-off-by: suifengersan123 <[email protected]> * fix: change warning to exception when goal poses cannot be transformed (ros-navigation#5759) - Replace RCLCPP_WARN with std::runtime_error exception in onPreempt method - Remove bt_action_server_->terminatePendingGoal() call after accepting goal - Add required stdexcept include for exception handling Fixes issue where navigators accept pending goal but are not properly terminated if rejected during goal pose transformation. Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> * Update obstacle layer usage of max ranges (ros-navigation#5697) * Use cell distance for obstacle marking max range Signed-off-by: Simon Dathan <[email protected]> * Don't raytrace clear the cell containing the current observation Signed-off-by: Simon Dathan <[email protected]> * Add tests for max marking and clearing ranges Signed-off-by: Simon Dathan <[email protected]> * Fix cpplint failures Signed-off-by: Simon Dathan <[email protected]> * Fix distance calculation Signed-off-by: Simon Dathan <[email protected]> * fix casting, formatting Signed-off-by: Simon Dathan <[email protected]> * check origin is in map, update CMakeLists Signed-off-by: Simon Dathan <[email protected]> * use hypot instead of squared dist Signed-off-by: Simon Dathan <[email protected]> * Move origin calc out of loop Signed-off-by: Simon Dathan <[email protected]> * Revert don't raytrace observation cell Signed-off-by: Simon Dathan <[email protected]> * Revert don't raytrace origin if it is observation cell Signed-off-by: Simon Dathan <[email protected]> * Remove new line Signed-off-by: Simon Dathan <[email protected]> --------- Signed-off-by: Simon Dathan <[email protected]> * [mppi] Don't reset zone-based speed limits (ros-navigation#5768) * [mppi] Don't reset zone-based speed limits Signed-off-by: Adi Vardi <[email protected]> * [mppi] update motion model params from speed_limit Signed-off-by: Adi Vardi <[email protected]> * fix linting issue Signed-off-by: Adi Vardi <[email protected]> * Revert: reset speed limits after param change Signed-off-by: Adi Vardi <[email protected]> --------- Signed-off-by: Adi Vardi <[email protected]> * Bugfix inactive publishers (ros-navigation#5748) * Do not publish costmap unless active Signed-off-by: Christopher Thompson <[email protected]> * Fix style Signed-off-by: Christopher Thompson <[email protected]> * Fix typo Signed-off-by: Christopher Thompson <[email protected]> * Use layers isEnabled() to prevent publishing Signed-off-by: Christopher Thompson <[email protected]> * Fix style Signed-off-by: Christopher Thompson <[email protected]> * Add missing include for CostmapLayer type Signed-off-by: Christopher Thompson <[email protected]> * Remove extra scoping Signed-off-by: Christopher Thompson <[email protected]> --------- Signed-off-by: Christopher Thompson <[email protected]> Co-authored-by: Christopher Thompson <[email protected]> * Fix MAX_NON_OBSTACLE_COST in theta star planner (ros-navigation#5865) Signed-off-by: mini-1235 <[email protected]> * Bump jazzy to 1.3.11 for release Signed-off-by: SteveMacenski <[email protected]> --------- Signed-off-by: Tim Clephas <[email protected]> Signed-off-by: Steve Macenski <[email protected]> Signed-off-by: SteveMacenski <[email protected]> Signed-off-by: agennart <[email protected]> Signed-off-by: suifengersan123 <[email protected]> Signed-off-by: Simon Dathan <[email protected]> Signed-off-by: Adi Vardi <[email protected]> Signed-off-by: Christopher Thompson <[email protected]> Signed-off-by: mini-1235 <[email protected]> Co-authored-by: Tim Clephas <[email protected]> Co-authored-by: Saitama <[email protected]> Co-authored-by: agennart <[email protected]> Co-authored-by: suifengersan123 <[email protected]> Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Simon Dathan <[email protected]> Co-authored-by: Adi Vardi <[email protected]> Co-authored-by: Christopher Thompson <[email protected]> Co-authored-by: Christopher Thompson <[email protected]> Co-authored-by: Maurice Alexander Purnawan <[email protected]> * Fix parameters in route server (backport Jazzy) (ros-navigation#5904) * Fix parameters in route server (backport Jazzy) Signed-off-by: mini-1235 <[email protected]> * Fix Signed-off-by: mini-1235 <[email protected]> --------- Signed-off-by: mini-1235 <[email protected]> * Add cancel timeout when cancelling actions (backport Jazzy) (ros-navigation#5903) * Add cancel timeout when cancelling actions (backport Jazzy) Signed-off-by: mini-1235 <[email protected]> * Declare parameter Signed-off-by: mini-1235 <[email protected]> * Update cancel timeout Signed-off-by: mini-1235 <[email protected]> --------- Signed-off-by: mini-1235 <[email protected]> * Backport docking in reverse fixes for jazzy (ros-navigation#5971) * Increase docking coverage && fix backward docking (backport Jazzy) (ros-navigation#5097) * Increase docking coverage && fix backward docking (backport Jazzy) Signed-off-by: Iacopo Moles <[email protected]> Increase docking coverage && fix backward docking (ros-navigation#5097) * Add dock_database tests Signed-off-by: Alberto Tudela <[email protected]> * Add utils test Signed-off-by: Alberto Tudela <[email protected]> * Improve filter tests Signed-off-by: Alberto Tudela <[email protected]> * Added simple charging tests Signed-off-by: Alberto Tudela <[email protected]> * Improve comments Signed-off-by: Alberto Tudela <[email protected]> * Fix backward and redo main test Signed-off-by: Alberto Tudela <[email protected]> * Change test period to reduce test time Signed-off-by: Alberto Tudela <[email protected]> * Revert "Change test period to reduce test time" This reverts commit ef1555e. Signed-off-by: Alberto Tudela <[email protected]> * Delete print pose Signed-off-by: Alberto Tudela <[email protected]> --------- Signed-off-by: Alberto Tudela <[email protected]> Signed-off-by: Iacopo Moles <[email protected]> * bump package versions Signed-off-by: Iacopo Moles <[email protected]> * Revert "bump package versions" This reverts commit a35c23d. Signed-off-by: Iacopo Moles <[email protected]> --------- Signed-off-by: Alberto Tudela <[email protected]> Signed-off-by: Iacopo Moles <[email protected]> Co-authored-by: Alberto Tudela <[email protected]> --------- Signed-off-by: Prathmesh Atkale <[email protected]> Signed-off-by: Pau Reverté <[email protected]> Signed-off-by: Mike Slembrouck <[email protected]> Signed-off-by: mikeslembrouckZYGO <[email protected]> Signed-off-by: Simon Dathan <[email protected]> Signed-off-by: EricoMeger <[email protected]> Signed-off-by: Guillaume Doisy <[email protected]> Signed-off-by: Maurice <[email protected]> Signed-off-by: mini-1235 <[email protected]> Signed-off-by: Maurice Alexander Purnawan <[email protected]> Signed-off-by: SatArw <[email protected]> Signed-off-by: Satwik Arawalli <[email protected]> Signed-off-by: Andrei Costinescu <[email protected]> Signed-off-by: Tim Clephas <[email protected]> Signed-off-by: Steve Macenski <[email protected]> Signed-off-by: SteveMacenski <[email protected]> Signed-off-by: agennart <[email protected]> Signed-off-by: suifengersan123 <[email protected]> Signed-off-by: Adi Vardi <[email protected]> Signed-off-by: Christopher Thompson <[email protected]> Signed-off-by: Alberto Tudela <[email protected]> Signed-off-by: Iacopo Moles <[email protected]> Co-authored-by: Prathmesh2931 <[email protected]> Co-authored-by: Pau Reverté <[email protected]> Co-authored-by: mikeslembrouckZYGO <[email protected]> Co-authored-by: Simon Dathan <[email protected]> Co-authored-by: Érico Meger <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Guillaume Doisy <[email protected]> Co-authored-by: Guillaume Doisy <[email protected]> Co-authored-by: Maurice Alexander Purnawan <[email protected]> Co-authored-by: Johannes Plapp <[email protected]> Co-authored-by: Sandeep Dutta <[email protected]> Co-authored-by: Steve Macenski <[email protected]> Co-authored-by: Satwik Arawalli <[email protected]> Co-authored-by: Andrei Costinescu <[email protected]> Co-authored-by: Tim Clephas <[email protected]> Co-authored-by: Saitama <[email protected]> Co-authored-by: agennart <[email protected]> Co-authored-by: suifengersan123 <[email protected]> Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Adi Vardi <[email protected]> Co-authored-by: Christopher Thompson <[email protected]> Co-authored-by: Christopher Thompson <[email protected]> Co-authored-by: Iacopo Moles <[email protected]> Co-authored-by: Alberto Tudela <[email protected]>
…ibers (ros-navigation#5807) * Optimize MPPI visualization to skip processing when no subscribers - Added subscription count check in TrajectoryVisualizer::add Signed-off-by: SatArw <[email protected]> * Update nav2_mppi_controller/src/trajectory_visualizer.cpp Remove redundant brackets in the if statement. Co-authored-by: Steve Macenski <[email protected]> Signed-off-by: Satwik Arawalli <[email protected]> --------- Signed-off-by: SatArw <[email protected]> Signed-off-by: Satwik Arawalli <[email protected]> Co-authored-by: Steve Macenski <[email protected]>
Basic Info
Description of contribution in a few bullet points
TrajectoryVisualizer::addto check subscription counts before executing the marker generation loops.get_subscription_count()on the/trajectories(MarkerArray) and/optimal_trajectory(Path) publishers.visualizeis set totrue:/optimal_trajectoryonly: Generates and publishes the visualization data for only the optimal trajectory./trajectories: Generates the visualization data for all the trajectories (including the optimal_trajectory).controller_serverCPU usage.Description of documentation updates required from your changes
Description of how this change was tested
nav2_mppi_controllerGTest suite locally. Passed 17/17 (100%) tests./trajectoriesCases


Navigation Task

Average CPU Load Summary

CPU Usage Timeline (Before vs After)

Future work that may be required in bullet points
For Maintainers:
backport-*.