ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I feel really uncomfortable while reading this question. Because I think it is not the right way to run a launch file. Launch files are designed to run nodes (C++/python). Anyways, I found a similar question #q341272
Below is the answer:
#include <cstdlib>
...
std::system("roslaunch your_package your_node");
Finally, as @Mike Scheutzow said that ROS environment variables must be set up correctly before running the above code. Therefore, please source
the setup.bash