include multiple commands into one launch file

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

include multiple commands into one launch file

Yuli
Dear Mathieu
Is it possible to include the following commands
$ export ROS_NAMESPACE=stereo_camera
$ roslaunch zed_wrapper zed_camera.launch publish_tf:=false

$ rosrun tf static_transform_publisher 0 0 0 -1.5707963267948966 0 -1.5707963267948966 camera_link zed_center 100
$ roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start --Vis/CorFlowMaxLevel 5 --Stereo/MaxDisparity 200" right_image_topic:=/stereo_camera/right/image_rect_color stereo:=true

into one launch file?? I tried the one below but it wouldn't work. Thanks!


<launch>
  <arg name="rviz" default="false" />
  <arg name="rtabmapviz" default="true" />
 
  <include file="$(find zed_wrapper)/launch/zed_camera.launch">
    <arg name="publish_tf" value="false"/>
  </include>
 

  <node name="camera_base_link"
    pkg="tf" type="static_transform_publisher"
    args="0 0 0 -1.5707963267948966 0 -1.5707963267948966 camera_link zed_center 100" />
  <include file="$(find rtabmap_ros)/launch/rtabmap.launch">
    <arg name="rtabmap_args" value="--delete_db_on_start --Vis/CorFlowMaxLevel 5 --Stereo/MaxDisparity 200" />
    <arg name="right_image_topic" value="/stereo_camera/right/image_rect_color" />
    <arg name="stereo" value="true" />
    <arg name="rviz" value="$(arg rviz)" />
    <arg name="rtabmapviz" value="$(arg rtabmapviz)" />
  </include>
</launch>
Reply | Threaded
Open this post in threaded view
|

Re: include multiple commands into one launch file

matlabbe
Administrator
Do you have warnings/errors on the terminal?

You are missing the namespace for the stereo camera:
<launch>
  <arg name="rviz" default="false" />
  <arg name="rtabmapviz" default="true" />
  
  <group ns="stereo_camera">
    <include file="$(find zed_wrapper)/launch/zed_camera.launch">
      <arg name="publish_tf" value="false"/>
    </include>
  </group>
  
  <node name="camera_base_link" 
    pkg="tf" type="static_transform_publisher" 
    args="0 0 0 -1.5707963267948966 0 -1.5707963267948966 camera_link zed_center 100" />

  <include file="$(find rtabmap_ros)/launch/rtabmap.launch">
    <arg name="rtabmap_args" value="--delete_db_on_start --Vis/CorFlowMaxLevel 5 --Stereo/MaxDisparity 200" />
    <arg name="right_image_topic" value="/stereo_camera/right/image_rect_color" />
    <arg name="stereo" value="true" />
    <arg name="rviz" value="$(arg rviz)" />
    <arg name="rtabmapviz" value="$(arg rtabmapviz)" />
  </include>
</launch>