Robotics StackExchange | Archived questions

Gmapping SLAM does not work on a real Turtlebot3 waffle (no map received)

Hello, I hope you can help me. I have a real turtlebot3 waffle with an LSD sensor. I am trying to map my office but its not working. hrer are the lauch files of gmapping and turtlebot3_slam:

I have tried to execute gmapping Slam with the following commands:

  1. -roslaunch turtlebot3bringup turtlebot3robot.launch

  2. roslaunch turtlebot3slam turtlebo3slam slam_methods:=gmapping

this is Issue:

... logging to /home/fsd/.ros/log/c4c4f2ce-99e3-11ea-8085-000c29a0d65b/roslaunch-ubuntu-4535.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://ubuntu:39949/

SUMMARY
========

PARAMETERS
 * /robot_description: <?xml version="1....
 * /robot_state_publisher/publish_frequency: 50.0
 * /robot_state_publisher/tf_prefix: 
 * /rosdistro: kinetic
 * /rosversion: 1.12.14
 * /turtlebot3_slam_gmapping/angularUpdate: 0.2
 * /turtlebot3_slam_gmapping/astep: 0.05
 * /turtlebot3_slam_gmapping/base_frame: base_footprint
 * /turtlebot3_slam_gmapping/delta: 0.05
 * /turtlebot3_slam_gmapping/iterations: 5
 * /turtlebot3_slam_gmapping/kernelSize: 1
 * /turtlebot3_slam_gmapping/lasamplerange: 0.005
 * /turtlebot3_slam_gmapping/lasamplestep: 0.005
 * /turtlebot3_slam_gmapping/linearUpdate: 1.0
 * /turtlebot3_slam_gmapping/llsamplerange: 0.01
 * /turtlebot3_slam_gmapping/llsamplestep: 0.01
 * /turtlebot3_slam_gmapping/lsigma: 0.075
 * /turtlebot3_slam_gmapping/lskip: 0
 * /turtlebot3_slam_gmapping/lstep: 0.05
 * /turtlebot3_slam_gmapping/map_frame: map
 * /turtlebot3_slam_gmapping/map_update_interval: 2.0
 * /turtlebot3_slam_gmapping/maxUrange: 3.0
 * /turtlebot3_slam_gmapping/minimumScore: 50
 * /turtlebot3_slam_gmapping/odom_frame: odom
 * /turtlebot3_slam_gmapping/ogain: 3.0
 * /turtlebot3_slam_gmapping/particles: 100
 * /turtlebot3_slam_gmapping/pub_map_odom_transform: True
 * /turtlebot3_slam_gmapping/resampleThreshold: 0.5
 * /turtlebot3_slam_gmapping/sigma: 0.05
 * /turtlebot3_slam_gmapping/srr: 0.1
 * /turtlebot3_slam_gmapping/srt: 0.2
 * /turtlebot3_slam_gmapping/str: 0.1
 * /turtlebot3_slam_gmapping/stt: 0.2
 * /turtlebot3_slam_gmapping/temporalUpdate: 0.5
 * /turtlebot3_slam_gmapping/xmax: 100.0
 * /turtlebot3_slam_gmapping/xmin: -100.0
 * /turtlebot3_slam_gmapping/ymax: 100.0
 * /turtlebot3_slam_gmapping/ymin: -100.0

NODES
  /
    robot_state_publisher (robot_state_publisher/robot_state_publisher)
    rviz (rviz/rviz)
    turtlebot3_slam_gmapping (gmapping/slam_gmapping)

ROS_MASTER_URI=http://localhost:11311

process[robot_state_publisher-1]: started with pid [4564]
process[turtlebot3_slam_gmapping-2]: started with pid [4565]
process[rviz-3]: started with pid [4566]
[ WARN] [1543086745.282958810]: MessageFilter [target=odom ]: Dropped 100.00% of messages so far. Please turn the [ros.gmapping.message_notifier] rosconsole logger to DEBUG for more information.

image description

turtlebot3_slam.launch

     <launch>   <!-- Arguments -->   
    <arg name="model" default="waffle" doc="waffle"/>  
    > <arg name="slam_methods" default="gmapping" doc="slam type [gmapping,cartographer, hector          >karto,frontier_exploration]"/>   
    > <arg name="configuration_basename" default="turtlebot3_lds_2d.lua"/>  
    > <arg name="open_rviz" default="true"/>
    > 
    >   <!-- TurtleBot3 -->   <include file="$(find turtlebot3_bringup)/launch/turtlebot3_remote.launch">
    >     <arg name="model" value="$(arg model)" />   </include>
    > 
    >   <!-- SLAM: Gmapping, Cartographer,
    > Hector, Karto, Frontier_exploration,RTAB-Map -->   
    > <include file="$(find turtlebot3_slam)/launch/turtlebot3_$(arg slam_methods).launch">
    >     <arg name="model" value="$(arg model)"/>
    >     <arg name="configuration_basename" value="$(arg configuration_basename)"/>  
    > </include>
    > 
    >   <!-- rviz -->   <group if="$(arg open_rviz)"> 
    >     <node pkg="rviz" type="rviz" name="rviz" required="true"
    >           args="-d $(find turtlebot3_slam)/rviz/turtlebot3_$(arg slam_methods).rviz"/>   </group>
    > </launch>

     turtlebot3_gmapping.launch

> <launch>
>       <!-- Arguments -->
>       <arg name="model" default="waffle" doc="waffle"/>
>       <arg name="configuration_basename"  default="turtlebot3_lds_2d.lua"/>
>       <arg name="set_base_frame" default="base_footprint"/>
>       <arg name="set_odom_frame" default="odom"/>
>       <arg name="set_map_frame"  default="map"/>
>       <!-- Gmapping -->
>       <node pkg="gmapping" type="slam_gmapping" name="turtlebot3_slam_gmapping" output="screen">
>       <param name="pub_map_odom_transform" value="true"/>
>         <param name="base_frame" value="$(arg set_base_frame)"/>
>         <param name="odom_frame" value="$(arg set_odom_frame)"/>
>         <param name="map_frame"  value="$(arg set_map_frame)"/>
>         <param name="map_update_interval" value="2.0"/>
>         <param name="maxUrange" value="3.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"/>
>         <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="1.0"/>
>         <param name="angularUpdate" value="0.2"/>
>         <param name="temporalUpdate" value="0.5"/>
>         <param name="resampleThreshold" value="0.5"/>
>         <param name="particles" value="100"/>
>         <param name="xmin" value="-100.0"/>
>         <param name="ymin" value="-100.0"/>
>         <param name="xmax" value="100.0"/>
>         <param name="ymax" value="100.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>
>     </launch>

Asked by dhaour9x on 2020-05-18 12:29:20 UTC

Comments

Please add the text from the error and remove the screen shot of it. It's always preferred to paste the text in and in this case I cannot read what the screenshot says.

Asked by billy on 2020-05-18 21:40:29 UTC

Thank you. I have updated my question

Asked by dhaour9x on 2020-05-19 10:50:17 UTC

After running bringup, check if the topics are being published or not using rostopic echo <topicName>

Asked by pravardhan on 2020-05-19 20:01:38 UTC

I have tested rostopic echo /scan and I got this:

header: 
  seq: 1537
  stamp: 
    secs: 1590484043
    nsecs: 808229021
  frame_id: "laser"
angle_min: 0.0
angle_max: 6.26573181152
angle_increment: 0.0174532923847
time_increment: 2.98800005112e-05
scan_time: 0.0
range_min: 0.119999997318
range_max: 3.5
ranges: [0.9120000004768372, 1.0010000467300415, 1.0019999742507935, 1.0019999742507935, 0.9319999814033508, 0.8730000257492065, 0.8799999952316284, 0.8870000243186951, 0.878000020980835, 0.8830000162124634, 0.9800000190734863, 1.093999981880188, 1.1119999885559082, 1.1080000400543213, 1.1039999723434448, 1.1069999933242798, 1.1180000305175781, 1.1150000095367432, 1.1260000467300415, 1.1130000352859497, 1.1390000581741333, 1.1160000562667847, 1.128000020980835, 1.1260000467300415, 1.1299999952316284, 1.1269999742507935, 1.1619999408721924, 1.1549999713897705, 1.024999976158142, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,

Asked by dhaour9x on 2020-05-26 04:10:38 UTC

Expand LaserScan in rviz and set the topic to /scan, looks like the values are being published correctly so they should be displayed in rviz without problem. Now to get the slam working I think the scan data must be published on /laser/scan topic instead of the /scan topic, please check with rosnode info what topic the gmapping node is subscribed to.

Asked by pravardhan on 2020-05-26 04:27:06 UTC

Answers

the Issue was solved withe the following commands. if you are using waffle platform, you can follow below waffle specific command.

Update OpenCR firmware from TurtleBot3 RPi

$ export OPENCR_PORT=/dev/ttyACM0
$ export OPENCR_MODEL=waffle
$ rm -rf ./opencr_update.tar.bz2
$ wget https://github.com/ROBOTIS-GIT/OpenCR-Binaries/raw/master/turtlebot3/ROS1/latest/opencr_update.tar.bz2 && tar -xvf opencr_update.tar.bz2 && cd ./opencr_update && ./update.sh $OPENCR_PORT $OPENCR_MODEL.opencr && cd ..

Update the source code in your PC

$ cd ~/catkin_ws/src/turtlebot3
$ git pull
$ cd ~/catkin_ws && catkin_make

Then I launched below commands From PC,

$ roscore

from TurtleBot3

$ roslaunch turtlebot3_bringup turtlebot3_robot.launch

from PC,

$ export TURTLEBOT3_MODEL=waffle
$ roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=gmapping

Asked by dhaour9x on 2020-05-26 11:51:32 UTC

Comments