ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
For example, there is a launch file named "hector_height_mapping.launch" and located in the "rplidar_ros" package, after I start the launch file, the ros node name is "rplidarNode", then I start and stop it in the C++ code:
system("roslaunch rplidar_ros rplidar.launch"); //start
system("rosnode kill hector_height_mapping"); //stop
By the way, remember to new a thread, or the code would block and you cannot stop the node.
2 | No.2 Revision |
For example, there is a launch file named "hector_height_mapping.launch" "rplidar.launch" and located in the "rplidar_ros" package, after I start the launch file, the ros node name is "rplidarNode", then I start and stop it in the C++ code:
system("roslaunch rplidar_ros rplidar.launch"); //start
system("rosnode kill hector_height_mapping"); rplidarNode"); //stop
By the way, remember to new a thread, or the code would block and you cannot stop the node.
3 | No.3 Revision |
For example, there is a launch file named "rplidar.launch" and located in the "rplidar_ros" package, after I start the launch file, the ros node name is "rplidarNode", then I start and stop it in the ROS C++ code:
system("roslaunch rplidar_ros rplidar.launch"); //start
system("rosnode kill rplidarNode"); //stop
By the way, remember to new a thread, or the code would block and you cannot stop the node.