0
$\begingroup$

I have a Raspberry Pi 4B with Ubuntu 20.04 and ROS Noetic 1.16.0 and I'm trying to use Gmapping with the /map topping with my LiDAR (an EAI YDLIDAR X4 with its driver, I think Radar_Con_V1.3.5.). I have a folder for my LiDAR with the following files in the launch folder:

lidar_gmapping.launch:

<launch>
  <include file="$(find gmapping)/launch/slam_gmapping_pr2.launch" />

  <include file="$(find lidar)/launch/X4.launch" />

  <node name="rviz" pkg="rviz" type="rviz" args="-d $(find lidar)/launch/mapping.rviz" />
</launch>

X4.launch:

<launch>
  <node name="ydlidar_lidar_publisher"  pkg="ydlidar_ros_driver"  type="ydlidar_ros_driver_node" output="screen" respawn="false" >
    <!-- string property -->
    <param name="port"         type="string" value="/dev/ydlidar"/>  
    <param name="frame_id"     type="string" value="laser"/>
    <param name="ignore_array"     type="string" value=""/>

    <!-- int property -->
    <param name="baudrate"         type="int" value="128000"/>  
    <!-- 0:TYPE_TOF, 1:TYPE_TRIANGLE, 2:TYPE_TOF_NET -->
    <param name="lidar_type"       type="int" value="1"/>  
    <!-- 0:YDLIDAR_TYPE_SERIAL, 1:YDLIDAR_TYPE_TCP -->
    <param name="device_type"         type="int" value="0"/>  
    <param name="sample_rate"         type="int" value="5"/>  
    <param name="abnormal_check_count"         type="int" value="4"/>  

    <!-- bool property -->
    <param name="resolution_fixed"    type="bool"   value="true"/>
    <param name="auto_reconnect"    type="bool"   value="true"/>
    <param name="reversion"    type="bool"   value="false"/>
    <param name="inverted"    type="bool"   value="true"/>
    <param name="isSingleChannel"    type="bool"   value="false"/>
    <param name="intensity"    type="bool"   value="false"/>
    <param name="support_motor_dtr"    type="bool"   value="true"/>
    <param name="invalid_range_is_inf"    type="bool"   value="false"/>
    <param name="point_cloud_preservative"    type="bool"   value="false"/>

    <!-- float property -->
    <param name="angle_min"    type="double" value="-180" />
    <param name="angle_max"    type="double" value="180" />
    <param name="range_min"    type="double" value="0.1" />
    <param name="range_max"    type="double" value="12.0" />
    <!-- frequency is invalid, External PWM control speed -->
    <param name="frequency"    type="double" value="10.0"/>
  </node>
  <node pkg="tf" type="static_transform_publisher" name="base_link_to_laser4"
    args="0.0 0.0 0.2 0.0 0.0 0.0 /base_footprint /laser_frame 40" />
</launch>

mapping.rviz:

<launch>
  <node pkg="gmapping" type="slam_gmapping" name="slam_gmapping">
    <param name="base_frame" value="base_link"/>
    <param name="odom_frame" value="odom"/>
    <param name="map_frame" value="map"/>
    <param name="map_update_interval" value="5.0"/>
    <param name="maxUrange" value="10.0"/>
    <param name="maxRange" value="12.0"/>
    <param name="sigma" value="0.05"/>
    <param name="kernelSize" value="1"/>
    <param name="lstep" value="0.05"/>
    <param name="astep" value="0.05"/>
    <param name="iterations" value="5"/>
    <param name="lsigma" value="0.075"/>
    <param name="ogain" value="3.0"/>
    <param name="lskip" value="0"/>
    <param name="minimumScore" value="50.0"/>
    <param name="srr" value="0.1"/>
    <param name="srt" value="0.2"/>
    <param name="str" value="0.1"/>
    <param name="stt" value="0.2"/>
    <param name="linearUpdate" value="0.2"/>
    <param name="angularUpdate" value="0.1"/>
    <param name="temporalUpdate" value="-1.0"/>
    <param name="resampleThreshold" value="0.5"/>
    <param name="particles" value="30"/>
    <param name="xmin" value="-50.0"/>
    <param name="ymin" value="-50.0"/>
    <param name="xmax" value="50.0"/>
    <param name="ymax" value="50.0"/>
    <param name="delta" value="0.05"/>
    <param name="llsamplerange" value="0.01"/>
    <param name="llsamplestep" value="0.01"/>
    <param name="lasamplerange" value="0.005"/>
    <param name="lasamplestep" value="0.005"/>
  </node>

  <!-- Display for Laser Scan -->
  <node name="laser_scan_display" pkg="rviz" type="rviz" args="-d $(find rviz)/config/laser_scan.rviz" />

  <!-- Display for Map -->
  <node name="map_display" pkg="rviz" type="rviz" args="-d $(find rviz)/config/navigation.rviz" />
</launch>

However, when I run roslaunch lidar lidar_gmapping.launch and add the display panel and the map visualization to the Rviz window that is opened, in the Global Status, there's a warning that says "no TF data" and in the map there's also a warning that says "no map received". Why is this happening?

Extra information

Output of roslaunch lidar lidar_gmapping.launch:

... logging to /home/ubuntu/.ros/log/f2b56a54-ce5c-11ee-ae1a-2bc73f30bdf2/roslaunch-ubuntu-4561.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://192.168.1.53:43169/

SUMMARY
========

PARAMETERS
 * /rosdistro: noetic
 * /rosversion: 1.16.0
 * /slam_gmapping/angularUpdate: 0.5
 * /slam_gmapping/astep: 0.05
 * /slam_gmapping/delta: 0.05
 * /slam_gmapping/iterations: 5
 * /slam_gmapping/kernelSize: 1
 * /slam_gmapping/lasamplerange: 0.005
 * /slam_gmapping/lasamplestep: 0.005
 * /slam_gmapping/linearUpdate: 1.0
 * /slam_gmapping/llsamplerange: 0.01
 * /slam_gmapping/llsamplestep: 0.01
 * /slam_gmapping/lsigma: 0.075
 * /slam_gmapping/lskip: 0
 * /slam_gmapping/lstep: 0.05
 * /slam_gmapping/map_update_interval: 5.0
 * /slam_gmapping/maxUrange: 16.0
 * /slam_gmapping/ogain: 3.0
 * /slam_gmapping/particles: 30
 * /slam_gmapping/resampleThreshold: 0.5
 * /slam_gmapping/sigma: 0.05
 * /slam_gmapping/srr: 0.1
 * /slam_gmapping/srt: 0.2
 * /slam_gmapping/str: 0.1
 * /slam_gmapping/stt: 0.2
 * /slam_gmapping/temporalUpdate: 3.0
 * /slam_gmapping/xmax: 50.0
 * /slam_gmapping/xmin: -50.0
 * /slam_gmapping/ymax: 50.0
 * /slam_gmapping/ymin: -50.0
 * /use_sim_time: True
 * /ydlidar_lidar_publisher/abnormal_check_count: 4
 * /ydlidar_lidar_publisher/angle_max: 180.0
 * /ydlidar_lidar_publisher/angle_min: -180.0
 * /ydlidar_lidar_publisher/auto_reconnect: True
 * /ydlidar_lidar_publisher/baudrate: 128000
 * /ydlidar_lidar_publisher/device_type: 0
 * /ydlidar_lidar_publisher/frame_id: laser
 * /ydlidar_lidar_publisher/frequency: 10.0
 * /ydlidar_lidar_publisher/ignore_array: 
 * /ydlidar_lidar_publisher/intensity: False
 * /ydlidar_lidar_publisher/invalid_range_is_inf: False
 * /ydlidar_lidar_publisher/inverted: True
 * /ydlidar_lidar_publisher/isSingleChannel: False
 * /ydlidar_lidar_publisher/lidar_type: 1
 * /ydlidar_lidar_publisher/point_cloud_preservative: False
 * /ydlidar_lidar_publisher/port: /dev/ydlidar
 * /ydlidar_lidar_publisher/range_max: 12.0
 * /ydlidar_lidar_publisher/range_min: 0.1
 * /ydlidar_lidar_publisher/resolution_fixed: True
 * /ydlidar_lidar_publisher/reversion: False
 * /ydlidar_lidar_publisher/sample_rate: 5
 * /ydlidar_lidar_publisher/support_motor_dtr: True

NODES
  /
    base_link_to_laser4 (tf/static_transform_publisher)
    rviz (rviz/rviz)
    slam_gmapping (gmapping/slam_gmapping)
    ydlidar_lidar_publisher (ydlidar_ros_driver/ydlidar_ros_driver_node)

ROS_MASTER_URI=http://192.168.1.53:11311/

process[slam_gmapping-1]: started with pid [4575]
process[ydlidar_lidar_publisher-2]: started with pid [4576]
process[base_link_to_laser4-3]: started with pid [4577]
[ INFO] [1708263246.713349137]: YDLIDAR ROS Driver Version: 1.0.2
process[rviz-4]: started with pid [4586]
[YDLIDAR] SDK initializing
[YDLIDAR] SDK has been initialized
[YDLIDAR] SDK Version: 1.1.21
[YDLIDAR] Lidar successfully connected [/dev/ydlidar:128000]
[YDLIDAR] Lidar running correctly! The health status: good
[YDLIDAR] Baseplate device info
Firmware version: 1.10
Hardware version: 1
Model: X4
Serial: 2021090300020786
[YDLIDAR] Lidar init success, Elapsed time 717 ms
[YDLIDAR] Start to getting intensity flag
[YDLIDAR] End to getting intensity flag
[YDLIDAR] Create thread 0x7B725170
[YDLIDAR] Successed to start scan mode, Elapsed time 4576 ms
[YDLIDAR] Fixed Size: 505
[YDLIDAR] Sample Rate: 5.00K
[YDLIDAR] Successed to check the lidar, Elapsed time 0 ms
[YDLIDAR] Now lidar is scanning...

Also, rostopic echo /map (or /tf or /clock) outputs this:

WARNING: no messages received and simulated time is active.
Is /clock being published?

Can anyone please help me?

$\endgroup$

1 Answer 1

0
$\begingroup$

Your error message is pretty descriptive: "simulation time is active" is at least the starting point of your error. Based on the launch files posted, it appears that the issue would be in the slam_gmapping_pr2 launch file - I'd suggest looking into what settings that launch file has set and getting "use_sim_time" to be set to false (since you do not want simulation time when using live sensor data)

$\endgroup$
2
  • $\begingroup$ One way I've found myself in a similar situation was trying out the launch files from a package, one of which set a use_sim_time rosparam. This went away upon restarting my roscore instance, clearing the params... $\endgroup$
    – Gertlex
    Feb 19 at 6:35
  • $\begingroup$ Thanks! That solved the global status error, but I still can't get information from the /map topic... $\endgroup$ Feb 25 at 12:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.