Robotics StackExchange | Archived questions

scan messages not published by the laserscan_nodelet manager when simulating multiple robots in gazebo

When setting up multiple robots in gazebo, i.e. one turtlebot and one turtlebot3, messages are not being published to the topic /robot1/scan.

Below is my one_robot.launch file.

    <?xml version='1.0'?>
<launch>
  <arg name="base"       value="$(optenv TURTLEBOT_BASE kobuki)"/> <!-- create, roomba -->
  <arg name="battery"    value="$(optenv TURTLEBOT_BATTERY /proc/acpi/battery/BAT0)"/>  <!-- /proc/acpi/battery/BAT0 -->
  <arg name="stacks"     value="$(optenv TURTLEBOT_STACKS hexagons)"/>  <!-- circles, hexagons -->
  <arg name="3d_sensor"  value="$(optenv TURTLEBOT_3D_SENSOR kinect)"/>  <!-- kinect, asus_xtion_pro -->

  <arg name="robot_name"/>
  <arg name="init_pose"/>


  <include file="$(find followme)/launch/$(arg base).launch.xml">
    <arg name="base" value="$(arg base)"/>
    <arg name="stacks" value="$(arg stacks)"/>
    <arg name="3d_sensor" value="$(arg 3d_sensor)"/>
    <arg name="robot_name" value="$(arg robot_name)"/>
    <arg name="init_pose" value = "$(arg init_pose)"/>
  </include>

  <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher">
    <param name="publish_frequency" type="double" value="30.0" />
  </node>

  <!-- Fake laser -->
  <node pkg="nodelet" type="nodelet" name="laserscan_nodelet_manager" args="manager"/>
  <node pkg="nodelet" type="nodelet" name="depthimage_to_laserscan"
        args="load depthimage_to_laserscan/DepthImageToLaserScanNodelet laserscan_nodelet_manager">
    <param name="scan_height" value="10"/>
    <param name="output_frame_id" value="$(arg robot_name)/camera_depth_frame"/>
    <param name="range_min" value="0.45"/>
    <remap from="image" to="$(arg robot_name)/camera/depth/image_raw"/>

  </node>

</launch>

Now, here's my robots.launch file

<?xml version='1.0'?>
<launch>
  <!-- No namespace here as we will share this description. 
       Access with slash at the beginning -->

  <param name="robot_description" 
    command="$(find xacro)/xacro --inorder $(find human_follower)/description/turtlebot3_burger.urdf.xacro" />

  <!-- BEGIN ROBOT 1-->
  <group ns="robot1">
    <param name="tf_prefix" value="robot1_tf" />
    <include file="$(find turtlebot_follower)/launch/one_robot.launch" >
      <arg name="init_pose" value="-x 1 -y 1 -z 0" />
      <arg name="robot_name"  value="Robot1" />   
</include>
  </group>

  <!-- BEGIN ROBOT 2-->
  <group ns="robot2">
    <param name="tf_prefix" value="robot2_tf" />
    <include file="$(find human_follower)/launch/one_robot.launch" >
      <arg name="init_pose" value="-x -1 -y 1 -z 0" />
      <arg name="robot_name"  value="Robot2" />
    </include>
  </group>
</launch>

And finally, here's my main.launch file, which I use to run the whole gazebo setup.

<?xml version='1.0'?>
<launch>
<arg name="gui"        default="true"/>
<arg name="world_file" default="$(find turtlebot_gazebo)/worlds/empty.world"/>
  <param name="/use_sim_time" value="true" />

  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="use_sim_time" value="true"/>
    <arg name="debug" value="false"/>
    <arg name="gui" value="$(arg gui)" />
    <arg name="world_name" value="$(arg world_file)"/>
  </include>

  <include file="$(find turtlebot_follower)/launch/robots.launch"/>
</launch>

I have tried the following things-

  1. My rostopic list - > rostopic list /clock /gazebo/link_states /gazebo/model_states /gazebo/parameter_descriptions /gazebo/parameter_updates /gazebo/set_link_state /gazebo/set_model_state /gazebo_gui/parameter_descriptions /gazebo_gui/parameter_updates /robot1/camera/depth/camera_info /robot1/camera/depth/image_raw /robot1/camera/depth/points /robot1/camera/parameter_descriptions /robot1/camera/parameter_updates /robot1/camera/rgb/camera_info /robot1/camera/rgb/image_raw /robot1/camera/rgb/image_raw/compressed /robot1/camera/rgb/image_raw/compressed/parameter_descriptions /robot1/camera/rgb/image_raw/compressed/parameter_updates /robot1/camera/rgb/image_raw/compressedDepth /robot1/camera/rgb/image_raw/compressedDepth/parameter_descriptions /robot1/camera/rgb/image_raw/compressedDepth/parameter_updates /robot1/camera/rgb/image_raw/theora /robot1/camera/rgb/image_raw/theora/parameter_descriptions /robot1/camera/rgb/image_raw/theora/parameter_updates /robot1/cmd_vel_mux/active /robot1/cmd_vel_mux/input/navi /robot1/cmd_vel_mux/input/safety_controller /robot1/cmd_vel_mux/input/switch /robot1/cmd_vel_mux/input/teleop /robot1/cmd_vel_mux/parameter_descriptions /robot1/cmd_vel_mux/parameter_updates /robot1/depthimage_to_laserscan/parameter_descriptions /robot1/depthimage_to_laserscan/parameter_updates /robot1/joint_states /robot1/laserscan_nodelet_manager/bond /robot1/mobile_base/commands/motor_power /robot1/mobile_base/commands/reset_odometry /robot1/mobile_base/commands/velocity /robot1/mobile_base/events/bumper /robot1/mobile_base/events/cliff /robot1/mobile_base/sensors/bumper_pointcloud /robot1/mobile_base/sensors/core /robot1/mobile_base/sensors/imu_data /robot1/mobile_base_nodelet_manager/bond /robot1/odom /robot1/scan /robot2/cmd_vel /robot2/imu /robot2/joint_states /robot2/odom /robot2/scan /rosout /rosout_agg /tf /tf_static

  2. On doing rostopic echo /robot1/scan WARNING: no messages received and simulated time is active. Is /clock being published?

  3. I have tried removing <remap from ="scan" to ="/scan"/>

  4. On running roswtf ->

    Loaded plugin tf.tfwtf Loaded plugin openni2launch.wtfplugin No package or stack in context ================================================================================ Static checks summary:

    Found 1 error(s).
    
    ERROR Local network configuration is invalid: Local hostname [remote-pc] resolves to [fc94:36fa:ebad:2ecb:e77c:a796:6027:1486], which does not appear to be a local IP address ['127.0.0.1', '192.168.1.11'].
    ================================================================================
    Beginning tests of your ROS graph. These may take awhile...
    analyzing graph...
    ... done analyzing graph
    running graph rules...
    ... done running graph rules
    running tf checks, this will take a second...
    ... tf checks complete
    
    Online checks summary:
    
    Found 3 warning(s).
    Warnings are things that may be just fine, but are sometimes at fault
    
    WARNING The following node subscriptions are unconnected:
     * /robot1/mobile_base_nodelet_manager:
       * /robot1/cmd_vel_mux/input/teleop
       * /robot1/mobile_base/sensors/core
       * /robot1/cmd_vel_mux/input/navi
       * /robot1/cmd_vel_mux/input/switch
       * /robot1/cmd_vel_mux/input/safety_controller
     * /robot1/laserscan_nodelet_manager:
       * /robot1/Robot1/camera/depth/image_raw
       * /robot1/Robot1/camera/depth/camera_info
     * /gazebo:
       * /gazebo/set_model_state
       * /gazebo/set_link_state
       * /robot2/cmd_vel
       * /robot1/mobile_base/commands/reset_odometry
       * /robot1/mobile_base/commands/motor_power
    
    WARNING The following nodes are unexpectedly connected:
     * /robot1/laserscan_nodelet_manager->/rostopic_22958_1548170385201 (/robot1/scan)
    
    WARNING These nodes have died:
     * robot2/spawn_minibot_model-11
     * robot1/spawn_turtlebot_model-4
    
    Found 1 error(s).
    
    ERROR Different number of openni2 sensors found.
     * 0 openni2 sensors found (expected: 1).
    
  5. When I run the setup with a single turtlebot, I the scan messages are published, but this is not the case with multi robot setup.

  6. Tried changing the frame id of the cameradepthframe, but no success.

Asked by Manav_Poddar on 2019-01-22 10:45:15 UTC

Comments

Answers