Add costmap source to collision monitor + dataset-based bag test (backport Jazzy)#5942
Add costmap source to collision monitor + dataset-based bag test (backport Jazzy)#5942arjangupta wants to merge 2 commits intoros-navigation:jazzyfrom
Conversation
|
@arjangupta, all pull requests must be targeted towards the |
thank you, it is already in main and this is a backport - do I need to do anything differently? |
…igation#5642) * Collision Monitor: add costmap sourced(unit tests) Signed-off-by: Mengting Yang <[email protected]> * nav2_collision_monitor: modified CostmapSource + dataset-based bag test (v1) Signed-off-by: Mengting Yang <[email protected]> * modified: nav2_collision_monitor/README.md Signed-off-by: Mengting Yang <[email protected]> * - annotate files to indicate AI-assisted drafts Signed-off-by: Mengting Yang <[email protected]> * collision_monitor: fix linter and address issues in the comment Signed-off-by: lotusymt <[email protected]> * nav2_collision_monitor: fix lint, coverage, and collision_monitor_node_test.cpp Signed-off-by: lotusymt <[email protected]> * Update nav2_collision_monitor/src/costmap.cpp Co-authored-by: Steve Macenski <[email protected]> Signed-off-by: Mengting Yang <[email protected]> * Update nav2_collision_monitor/src/costmap.cpp Co-authored-by: Steve Macenski <[email protected]> Signed-off-by: Mengting Yang <[email protected]> * Update nav2_collision_monitor/src/costmap.cpp Co-authored-by: Steve Macenski <[email protected]> Signed-off-by: Mengting Yang <[email protected]> * Reverse format change Signed-off-by: lotusymt <[email protected]> * Reverse format changes and comments Signed-off-by: lotusymt <[email protected]> * Refactor in_range and count_stopped functions Signed-off-by: Mengting Yang <[email protected]> Signed-off-by: lotusymt <[email protected]> * added costmap source to collision detector and tests( for failure path and collision detector) Signed-off-by: lotusymt <[email protected]> * fix configuration and test bugs Signed-off-by: lotusymt <[email protected]> --------- Signed-off-by: Mengting Yang <[email protected]> Signed-off-by: lotusymt <[email protected]> Signed-off-by: Mengting Yang <[email protected]> Co-authored-by: Steve Macenski <[email protected]> Co-authored-by: Arjan Gupta <[email protected]> Signed-off-by: Arjan Gupta <[email protected]>
Preserve the jazzy branch's original CMake variable pattern Signed-off-by: Arjan Gupta Signed-off-by: Arjan Gupta <[email protected]>
1b2ed1f to
65d907a
Compare
|
@arjangupta looks like you have build issues to address, check CI |
| nav2_msgs::msg::Costmap::ConstSharedPtr data_; | ||
|
|
||
| /// @brief Subscription handle for the costmap topic. | ||
| nav2::Subscription<nav2_msgs::msg::Costmap>::SharedPtr data_sub_; |
There was a problem hiding this comment.
This doesn't exist in Jazzy
| #include <nav2_ros_common/lifecycle_node.hpp> | ||
| #include <nav2_ros_common/subscription.hpp> |
| * @param base_shift_correction Whether to compensate robot motion during simulation checks. | ||
| */ | ||
| CostmapSource( | ||
| const nav2::LifecycleNode::WeakPtr & node, |
| nav2::Publisher<sensor_msgs::msg::LaserScan>::SharedPtr | ||
| scan_pub_; | ||
| nav2::Publisher<sensor_msgs::msg::PointCloud2>::SharedPtr | ||
| pointcloud_pub_; | ||
| nav2::Publisher<sensor_msgs::msg::Range>::SharedPtr | ||
| range_pub_; | ||
| nav2::Publisher<geometry_msgs::msg::PolygonInstanceStamped>::SharedPtr | ||
| polygon_source_pub_; | ||
| nav2::Publisher<nav2_msgs::msg::Costmap>::SharedPtr | ||
| costmap_pub_; |
Thanks for the feedback Steve, sorry about the compilation issues. I will close this for now and take some time to use the correct dependencies to bring in this feature into jazzy. I'll also compile and validate before opening a new PR. |
Quick Preface
Backports #5642 into the Jazzy branch (merge conflicts resolved).
Basic Info
Description of contribution in a few bullet points
CostmapSourceto Collision Monitor to allow collision checks against a subscribed local costmap (nav2_msgs/Costmap).CostmapSourceintoCollisionMonitor::configureSources()and expose params:*.topic,*.cost_threshold(0–255),*.treat_unknown_as_obstacle(bool).params/collision_monitor_params.yaml.README.md:test/collision_monitor_node_bag.cpp(metrics: time-to-stop, hold-stop%, time-to-resume, false-stop%).test/collision_monitor_node_bag.launch.pyto bring up CM, play a tiny bag, and run gtest.get_package_share_directory().Description of documentation updates required from your changes
.. warning::box on the Collision Monitor page describing the trade-offs of using a costmap source (persistence vs. latency/staleness), and list the new parameters.README.mdalready updated with a brief note and source entry.Description of how this change was tested
colcon test --packages-select nav2_collision_monitor; existing unit tests + the new launch test pass on Ubuntu.Future work that may be required in bullet points
For Maintainers:
backport-*.