Ask Your Question
0

Creating a launch file for running 3 separate nodes

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

tolga-uni-lu gravatar image

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

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 -0500

stevejp gravatar image

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

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 imagetolga-uni-lu ( 2018-04-04 10:14:20 -0500 )edit
1

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

stevejp gravatar imagestevejp ( 2018-04-04 10:55:22 -0500 )edit

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

tolga-uni-lu gravatar imagetolga-uni-lu ( 2018-04-06 02:16:44 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 599 times

Last updated: Apr 06 '18