[LiDAR navigation] /scan topic comes from a camera node rather than the desired LiDAR node

Hi guys. I’m trying to use a rplidar to run amcl navigation with my pre-built map on Turtlebot2, ROS Kinetic. Below is my amcl launch file:

<launch>
  <!-- Define laser type-->
  <arg name="laser_sensor" default="$(env TURTLEBOT_LASER_SENSOR)" />
  <!-- <arg name="laser_sensor" default="rplidar" /> -->

  <!-- laser driver -->
  <include file="$(find turtlebot_navigation)/laser/driver/$(arg laser_sensor)_laser.launch" />

  <!-- Map server -->
  <arg name="map_file" default="$(env TURTLEBOT_MAP_FILE)"/>
  <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />

  <!-- AMCL -->
  <arg name="custom_amcl_launch_file" default="$(find turtlebot_navigation)/launch/includes/amcl/$(arg laser_sensor)_amcl.launch.xml"/>
  <arg name="initial_pose_x" default="0.0"/> <!-- Use 17.0 for willow's map in simulation -->
  <arg name="initial_pose_y" default="0.0"/> <!-- Use 17.0 for willow's map in simulation -->
  <arg name="initial_pose_a" default="0.0"/>
  <include file="$(arg custom_amcl_launch_file)">
    <arg name="initial_pose_x" value="$(arg initial_pose_x)"/>
    <arg name="initial_pose_y" value="$(arg initial_pose_y)"/>
    <arg name="initial_pose_a" value="$(arg initial_pose_a)"/>
  </include>

  <!-- Move base -->
  <arg name="custom_param_file" default="$(find turtlebot_navigation)/param/$(arg laser_sensor)_costmap_params.yaml"/>
  <include file="$(find turtlebot_navigation)/launch/includes/rplidar_move_base.launch.xml">
    <arg name="custom_param_file" value="$(arg custom_param_file)"/>
  </include>

</launch>

where the “laser_sensor” is the used LiDAR. But the weird thing is that when I ran this launch file, the /scan topic came from a camera node rather than the pre-defined lidarNode. Here is the rqt_graph. However, when I ran cartographer SLAM, the /scan topic was correctly published by the desired lidarNode. I have no idea why this went wrong with the navigation. I don’t even equip the turtlebot2 with a camera. Could someone explain how to fix it? I really appreciate your help!

Hello @lightwish.wong,

welcome to the forum!

You can create a /scan topic from a depth camera, this is a common practice. So maybe this is what is happening here.

There are a few packages that convert from a depth image to a planar laser scan message. Here are a few:

depthimage_to_laserscan takes a depth image and generates a 2D laser scan based on the provided parameters.

Package laserscan_kinect converts depth image from the depth sensor to a 2D laser scanner format. The conversion algorithm allows to remove a ground from the depth image and compensate the sensor mount tilt angle relative to the ground.

So maybe you have one of these nodes running in your setup. You have to instrospect your system and find out which node is publishing what.

Hope this information helped,

Regards,

Roberto

Hi @rzegers ,
Many thanks for your detailed explanation! The reason is exactly what you said. Finally I found out that another guy who previously borrowed my robot created a new workspace, which contains a package with the same name as mine, even the launch file inside. And when I input roslaunch [package_name] [launch_file_name], somehow it is his launch file that is executed by default. I think maybe roslaunch [launch_file_path] is more reliable. What a coincidence! Thank you again for your reply!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.