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-
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 ...