iRobotEducation / create3_examples

Example nodes to drive the iRobot® Create® 3 Educational Robot
BSD 3-Clause "New" or "Revised" License
51 stars 12 forks source link

"ROS Way" to kill goal or the whole Coverage Server? #12

Closed slowrunner closed 2 years ago

slowrunner commented 2 years ago

I have been either leaving the coverage server in the foreground of one terminal window and killing it with cntl-c, or with the PID if running in the background.

Is there a more ROS-way such as sending a kill "goal"?

How do I abort the explore goal?

justinIRBT commented 2 years ago

If you have a handle to the Coverage Server in a node, you can look at: https://github.com/iRobotEducation/create3_examples/blob/galactic/create3_coverage/src/behaviors/dock-behavior.cpp as an example for how to manage an action client programmatically. Specifically, to cancel a goal, it calls: m_dock_action_client->async_cancel_goal(m_dock_goal_handle);