ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Yes, It is possible. You have to kill the node and You can restart that particular node again.

You can use this command, I think that will work for you.

system("roslaunch realsense2_camera rs_camera.launch");  //start
system("rosnode kill /camera/realsense2_camera");              //stop

You can also have a look at these links. These ways can be useful:

https://answers.ros.org/question/203154/is-it-possible-to-run-and-quit-launch-files-from-code-inside-a-node/ https://answers.ros.org/question/221077/killing-a-rosrun-process-using-python-script/ https://answers.ros.org/question/223090/start-or-stop-the-ros-node-in-another-node/

Yes, It is possible. You have to kill the node and You can restart that particular node again.

You can use this command, I think that will work for you.

system("roslaunch realsense2_camera rs_camera.launch");  //start
system("rosnode kill /camera/realsense2_camera");              //stop

You can also have a look at these links. These ways can be useful:

https://answers.ros.org/question/203154/is-it-possible-to-run-and-quit-launch-files-from-code-inside-a-node/ https://answers.ros.org/question/221077/killing-a-rosrun-process-using-python-script/ https://answers.ros.org/question/203154/is-it-possible-to-run-and-quit-launch-files-from-code-inside-a-node/

https://answers.ros.org/question/221077/killing-a-rosrun-process-using-python-script/

https://answers.ros.org/question/223090/start-or-stop-the-ros-node-in-another-node/

Yes, It is possible. You have to kill the node and You can restart that particular node again.

You can use this command, I think that will work for you.

system("roslaunch import os
os.system("roslaunch realsense2_camera rs_camera.launch");  //start
system("rosnode os.system("rosnode kill /camera/realsense2_camera");              //stop

You can also have a look at these links. These ways can be useful:

https://answers.ros.org/question/203154/is-it-possible-to-run-and-quit-launch-files-from-code-inside-a-node/

https://answers.ros.org/question/221077/killing-a-rosrun-process-using-python-script/

https://answers.ros.org/question/223090/start-or-stop-the-ros-node-in-another-node/

Yes, It is possible. You have to kill the node and You can restart that particular node again.

You can use this command, I think that will work for you.

import os
os.system("roslaunch realsense2_camera rs_camera.launch"); rs_camera.launch")    //start
os.system("rosnode kill /camera/realsense2_camera");     /camera/realsense2_camera")          //stop

You can also have a look at these links. These ways can be useful:

https://answers.ros.org/question/203154/is-it-possible-to-run-and-quit-launch-files-from-code-inside-a-node/

https://answers.ros.org/question/221077/killing-a-rosrun-process-using-python-script/

https://answers.ros.org/question/223090/start-or-stop-the-ros-node-in-another-node/