Integrate roslaunch into Roslaunch

From wikidb
Jump to: navigation, search

Create FloorHugger Package

Create a FloorHugger package to house the launch scripts.

 cd ~/catkin_ws_indigo/src
 
 catkin_create_pkg floor_hugger
 
 . catkin_ws_indigo/devel/setup.bash

Test

 cp ...../usb_cam_server.launch ~/catkin_ws_indigo/src/floor_hugger/launch
 
 roslaunch floor_hugger usb_cam_server.launch
 
 cat camshift_rotate.launch
   <launch>
     <node name="move_node" pkg="follow" type="move_it" 
       output="screen" 
     />
   </launch>
  • type: is binary generated from move_it.cpp
  • name: overrides moveNode in above source
  • pkg: in the pacage this is all in

CamShift Launch Script

 cat camshift_rotate.launch<launch>
     <node name="usb_cam" pkg="usb_cam" type="usb_cam_node" output="screen" >
        <param name="video_device" value="/dev/video0" />
        <param name="image_width" value="320" />
        <param name="image_height" value="240" />
        <param name="pixel_format" value="mjpeg" />
        <param name="camera_frame_id" value="usb_cam" />
        <param name="io_method" value="mmap"/>
     </node>

     <node name="tracker_node" pkg="follow" type="cam_shift_tracker" 
         output="screen" 
     />
 
     <node name="move_node" pkg="follow" type="move_it" 
         output="screen" 
     />

     <node name="motor_node" pkg="phidgets" type="motor_control_hc" 
         output="screen" 
     />
 </launch>

Execute

 roslaunch floor_hugger camshift_rotate.launch

Investigate

 rosnode list
   /motor_node
   /move_node
   /rosout
   /tracker_node
   /usb_cam

 rostopic list
   /cmd_vel
   /odom
   /phidgets/motorcontrol
   /rosout
   /rosout_agg
   /tracker
   /usb_cam/camera_info
   /usb_cam/image_raw
 
 rqt_graph

CamshiftGraph.png