A ROS2 package for calling launch files from a ROS service
| ROS version | Branch |
|---|---|
| ROS2 | ros2 |
| ROS1 | ros1 |
launch_srv is a ROS package that provides:
- A service definition (Launch.srv) for calling launch files;
- A service server (launch_server.py) that implements this call;
- A launch file (foxglove.launch.py) that launches both the service server and foxglove_bridge.
This repo is a standard ROS2 package (ament_cmake).
-
A ROS2 workspace (colcon)
- See this tutorial to learn how to create your own workspace.
-
Foxglove bridge
-
sudo apt install ros-<distro>-foxglove-bridge
-
As mentioned above, this repo is a standard ROS2 package. Thus, you simply have to clone it inside your workspace's src directory, making sure to use the ros2 branch.
cd <path_to_your_ros2_ws>/src
git clone -b ros2 https://github.com/leggedrobotics-usp/launch_srv.gitThen, use colcon to build.
cd <path_to_your_ros2_ws>
colcon build --symlink-installRun the service server:
ros2 run launch_srv launch_server.pyEach service call will trigger the corresponding launch file on a separate process. Configure the inputs as follows:
package_name(string): the name of the package that contains the desired launch file;launch_file(string): the launch file name (complete, with extension);parameters(string): if necessary, input the parameter list;terminate(boolean): set tofalseto start the launch process, ortrueto terminate it.
If you want to call the service using Foxglove Studio, use the included launch file instead:
ros2 launch launch_srv foxglove.launch.pyWant a new feature? Open an Enhancement issue describing it.
- Fork the repo
- Check out a new branch (from the ros2 branch) and name it to what you intend to do:
-
git checkout -b BRANCH_NAME
-
- Commit your changes
- Please provide a git message that explains what you've done;
- Commit to the forked repository.
git commit -m "A short and relevant message"
- Push to the branch
-
git push origin BRANCH_NAME
-
- Make a pull request!
Victor T. N. 🤖
Made with ❤️ by @Vtn21