feat: publish collision string message during emergency stop (Resolves #159)#160
feat: publish collision string message during emergency stop (Resolves #159)#160yenode wants to merge 1 commit intoopen-rmf:mainfrom
Conversation
arjo129
left a comment
There was a problem hiding this comment.
This is great start. I'm wondering if we should add a custom message.
Also, we should find a way to stop gazebo and terminate rmf in such instances.
@luca-della-vedova, would love your input on this as well.
| #include <tf2_ros/transform_broadcaster.h> | ||
|
|
||
| #include <geometry_msgs/msg/transform_stamped.hpp> | ||
| #include <std_msgs/msg/string.hpp> |
There was a problem hiding this comment.
Thanks for this PR! Do you think that we should use string or some other custom message?
|
Also can you follow the instructions for DCO: https://github.com/open-rmf/rmf_simulation/pull/160/checks?check_run_id=67082126337 |
…open-rmf#159) Signed-off-by: Aditya Pachauri <adi.pachauri.444@gmail.com>
|
Thanks for the review and the feedback! I agree with moving to a custom message. Publishing the current _model_name, the timestamp, and the [x, y, z] coordinates should be more than enough for the CI script to fail the test and log the location of the collision. Can I define a new RobotCollision.msg in the rmf_fleet_msgs package? Regarding terminating Gazebo and RMF: Once the collision is published, do you prefer we attempt a ROS 2 lifecycle shutdown from within the simulation plugin itself, or should the Python CI test script listen for the custom message and broadcast a SIGINT to terminate the entire launch tree? |
New feature implementation
Implemented feature
This PR introduces a ROS 2 publisher to broadcast collision events, enabling automated CI and QA scripts to detect when simulated robots enter an emergency stop state.
Resolves: #159
Implementation description
To allow external testing scripts (such as those needed for rmf_ros2#504) to detect simulation level collisions, the following approach was taken:
In slotcar_common.cpp, modified the emergency_stop() method. When need_to_stop evaluates to true (indicating the robot is too close to an obstacle based on stop_distance and stop_radius), the node publishes a string containing the _model_name. This ensures test scripts can identify exactly which robot triggered the collision state.
GenAI Use
We follow OSRA's policy on GenAI tools
Generated-by: Gemini AI (Used exclusively for drafting and formatting this PR description text. All C++ code was written manually).