How to run launch file in c++ program
How to run launch file in c++ program
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
How to run launch file in c++ program
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
Asked: 2022-10-03 04:21:51 -0600
Seen: 133 times
Last updated: Oct 04 '22
Are there any viewers for ImageMarker?
roslint python errors to stdout?
Release schedule for ROS Noetic
Considering upgrading Kinetic soon, should I wait till Noetic?
Why is my robot moving so slow with MoveIt?
(About) When Noetic feature freeze in core libraries
Error installing Ros Noetic in Debian Buster
How to install ROS noetic for testing?
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
@ravijoshi I think you should make your comment the answer.
@ROS_Practicer If you try this, you're also going to have to make sure that the
setup.bash
environment variables are all set properly.@Mike Scheutzow Thanks for your supervision always. The answer has been added.