0
$\begingroup$

Rosanswers logo

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>

Originally posted by tolga-uni-lu on ROS Answers with karma: 33 on 2018-04-04

Post score: 0


Original comments

Comment by mgruhler on 2018-04-04:
http://wiki.ros.org/roslaunch/XML/include

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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!


Originally posted by stevejp with karma: 929 on 2018-04-04

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by tolga-uni-lu on 2018-04-04:
This works thank you. I have encountered a warning though. Do you know why I get this? My xml is below as well.

Comment by stevejp on 2018-04-04:
Your node name is illegal (have a read of the page linked in the error message)

Comment by tolga-uni-lu on 2018-04-06:
I posted working code in the answer. Thanks for the help!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.