Remote roslaunch: The slave doesn't publish topics after restart

asked 2018-08-05 08:47:45 -0600

uddipan gravatar image

updated 2018-08-06 06:33:41 -0600

I am trying to run some ros nodes in the master system and others in the slave system. Remote roslaunch works fine, all the ros nodes launch at the startup of the master system (I have configured it to run roslaunch at the startup). But when the slave system shuts down, as expected the nodes on the slave system are not re-launched. I would like both of the ros systems to be running with all the nodes even after there is a unexpected shutdown on one of them. Is there a solution for this on ROS or do I have to write a bash script for this? Any other master-slave ROS architecture that could solve this problem?

Roslaunch:(I am using upstart to launch it)


env-loader="/home/odroid/ros_ws/devel/" />

<node name="webserver" pkg="ros_webserver" type="" respawn="true" output="log"/>

<node name="GPS" pkg="nmea_navsat_driver" type="nmea_serial_driver" respawn="true" output="log">
  <param name="port" value="/dev/ttyGPS" type="string" />
  <param name="baud" value="4800" type="string" />
  <remap from="fix" to="gps_data" />

<node name="web_video_server" pkg="web_video_server" type="web_video_server" respawn="true"/>

<node name="IMU" pkg="ros_phidgets_sensors" type="" respawn="true" output="log"/>

<node name="arduino" pkg="ros_arduino" type="" respawn="true" output="log"/>

<!-- The Slave node launch codes -->

  <node machine="machine_name" name="usb_cam_2" pkg="usb_cam" type="usb_cam_node" respawn="true" output="log" respawn_delay="30" >
    <param name="video_device" value="/dev/video6" />
    <param name="framerate" value="2" />
    <param name="image_width" value="640" />
    <param name="image_height" value="480" />
    <param name="pixel_format" value="yuyv" />
    <param name="camera_frame_id" value="usb_cam_2" />
    <param name="io_method" value="mmap"/>

   <node machine="machine_name" name="usb_cam_1" pkg="usb_cam" type="usb_cam_node" respawn="true" respawn_delay="30" output="log">
    <param name="video_device" value=" /dev/video8" />
    <param name="image_width" value="640" />
    <param name="image_height" value="480" />
    <param name="pixel_format" value="yuyv" />
    <param name="camera_frame_id" value="usb_cam_1" />
    <param name="io_method" value="mmap"/>

edit retag flag offensive close merge delete



Please provide more information about how "the slave system shuts down". Remote systems use a remote instance of roslaunch and a normal shut down won't trigger a relaunch.

Geoff gravatar image Geoff  ( 2018-08-05 20:20:54 -0600 )edit

Please post your launch files. It's possible you have forgotten something like the respawn="true" or have a required="true" attribute in there that is altering the behaviour from what you expect.

Geoff gravatar image Geoff  ( 2018-08-05 20:22:26 -0600 )edit

I am using two odroids for the master and slave systems. And I have seen the odroids restart/shutdown on occasions without a warning, I am not completely sure of what causes this. I have respawn = "true" on all my launch nodes but not required="true".

uddipan gravatar image uddipan  ( 2018-08-06 03:18:43 -0600 )edit

Please post the launch files.

Geoff gravatar image Geoff  ( 2018-08-06 05:46:20 -0600 )edit

posted it.

uddipan gravatar image uddipan  ( 2018-08-06 06:27:53 -0600 )edit