# How to stop robot in code

**URL:** <https://get-help.theconstruct.ai/t/how-to-stop-robot-in-code/23675>\
**Category:** Open Discussions\
**Created:** [April 11, 2023, 9:17am UTC](https://get-help.theconstruct.ai/t/how-to-stop-robot-in-code/23675 "2023-04-11T09:17:56Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![bayodesegun](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/bayodesegun/32/10684_2.png) [@bayodesegun](https://get-help.theconstruct.ai/u/bayodesegun)\
**Post date:** [April 11, 2023, 3:23pm UTC](https://get-help.theconstruct.ai/t/how-to-stop-robot-in-code/23675/3 "2023-04-11T15:23:57Z")

</div>

In addition to what @ACTISA said, you can also stop the robot whenever ROS is shutting down. Have a look at [this post](https://get-help.robotigniteacademy.com/t/how-to-stop-your-robot-when-ros-is-shutting-down/225) for how to do that.

In general, to stop a robot in your code you just need to create a publisher to the applicable “velocity” topic and publish a stop message as required in your code.

---

_[View the full topic](https://get-help.theconstruct.ai/t/how-to-stop-robot-in-code/23675)._
