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

Creating a launch file for running 3 separate nodes

asked 2018-04-04 05:41:55 -0600

tolga-uni-lu gravatar image

updated 2018-04-06 02:15:30 -0600

Hello, I would like to activate 3 nodes of which I created 1. The other 2 are prebuilt nodes and each has a launch file. My nodes are as follows:

I want to create a launch file for this node coming after rosrun:

$ rosrun hand_raise_detector armraiselistener.py

The file should trigger below nodes coming after roslaunch:

$ roslaunch realsense_camera sr300_nodelet_rgbd.launch

$ roslaunch openpose_ros openpose_ros.launch

EDIT for solution:

<launch>
     <node pkg="hand_raise_detector" type="armraiselistener.py" name="armraiselistener" output="screen"/>
     <include file="/home/robolab3/catkin_ws/src/openpose_ros-master/openpose_ros/launch/openpose_ros.launch" />
     <include file="/home/robolab3/catkin_ws/src/realsense/realsense_camera/launch/sr300_nodelet_rgbd.launch" />
</launch>
edit retag flag offensive close merge delete

Comments

2

1 Answer

Sort by ยป oldest newest most voted
3

answered 2018-04-04 06:53:44 -0600

stevejp gravatar image

updated 2018-04-04 06:56:23 -0600

The setup you've described is fairly standard for a roslaunch file, and should be pretty straight forward to put together. In short you are just creating a launch file which runs your node and includes the launch files for the existing packages you are running. The skeleton will look something like this:

<launch>
     <node pkg="package_name" type="node" name="name" />
     <include file="$(find ros_package_name)/path_to_launch.launch" />
     <include file="$(find ros_package_name)/path_to_launch.launch" />
</launch>

Check out the wiki page on roslaunch here, and if you need further help there is a very thorough chapter (Chapter 6) in the book "A Gentle Introduction to ROS" which is available for free here. If you still can't get it working after you've looked through all of that update your question with the attempt you've made and I'm sure someone will help troubleshoot!

edit flag offensive delete link more

Comments

This works thank you. I have encountered a warning though. Do you know why I get this? My xml is below as well.

tolga-uni-lu gravatar image tolga-uni-lu  ( 2018-04-04 10:14:20 -0600 )edit
1

Your node name is illegal (have a read of the page linked in the error message)

stevejp gravatar image stevejp  ( 2018-04-04 10:55:22 -0600 )edit

I posted working code in the answer. Thanks for the help!

tolga-uni-lu gravatar image tolga-uni-lu  ( 2018-04-06 02:16:44 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-04-04 05:41:55 -0600

Seen: 1,636 times

Last updated: Apr 06 '18