0
$\begingroup$

I have been trying to generate a map using lidar/laser scan data in my 4_wheel_bot with the help of slam_gmapping package. When i start the simulation the output of the terminal shows "Registering First Scan", after i set the "map" frame as fixed frame in rviz, when i move the bot using teleop_twist_keyboard node, the laser particles also moves along with the bot - this is a video. So i can't generate a map. Hers's my github repo project link for your reference. And i notice that the bot is moving slow in rviz when compared to bot moving in gazebo. I don't know the reason why its happening. Would be glad if anyone help me find out what's wrong in my code or what am i missing. thank you.

Here's the gazebo.launch file

<?xml version="1.0"?>
<launch>
    
    <rosparam file="$(find mobile_robot)/config/diff_drive_controller.yaml" command="load" ns = "diff_drive_controller"/>

    <rosparam file="$(find mobile_robot)/config/joint_state_controller.yaml" command="load" ns = "joint_state_controller"/>

    <include file="$(find mobile_robot)/launch/slam_gmapping.launch"/> 
    
    <param name="robot_description" command="xacro '$(find mobile_robot)/urdf/robot_core.urdf.xacro'"/>

    <arg name="rviz_config_file" default="$(find mobile_robot)/config/robot_config.rviz"/>

    <node name="controller_spawner" pkg="controller_manager" type="spawner" output = "screen" 
        args = "diff_drive_controller
                joint_state_controller"/>

    <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
    
    <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output = "screen"/>
    
    <node pkg="rviz" type="rviz" name="rviz" args = "-d $(arg rviz_config_file)"/>

    
    <include file="$(find gazebo_ros)/launch/empty_world.launch">
        <arg name="world_name" value="$(find mobile_robot)/worlds/myrover_house.world"/>
        <arg name="paused" default="false"/>
        <arg name="use_sim_time" default="true"/>
        <arg name="gui" default="true"/>
        <arg name="headless" default="false"/>
        <arg name="debug" default="false"/>
    </include>

    <node name="spawning_lidar" pkg="gazebo_ros" type="spawn_model" args=" -urdf -param robot_description -model my_rover" />

    <node name="rqt_robot_steering" pkg="rqt_robot_steering" type="rqt_robot_steering">
        <!-- <param name="default_topic" value="/cmd_vel"/> -->
        <remap from="/cmd_vel" to="/diff_drive_controller/cmd_vel"/>
    </node>

</launch>

and the slam_gmapping.launch file

<?xml version="1.0"?>
<launch>
  <node pkg="gmapping" type="slam_gmapping" name="gmapping" output="screen">
    <!-- Set parameters for slam_gmapping -->
    <!-- <param name="use_sim_time" value="true"/> -->
    <param name="base_frame" value="base_footprint"/>
    <param name="odom_frame" value="odom"/>
    <param name="map_frame" value="map"/>
    <param name="scan" value="scan"/>
    <param name="maxUrange" value="10.0"/>
    <param name="sigma" value="0.05"/>
    <param name="kernelSize" value="1"/>
    <param name="iterations" value="5"/>
    <param name="lskip" value="0"/>
    <param name="minimumScore" value="500"/>
    <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.5"/>
    <param name="temporalUpdate" value="-1.0"/>
    <param name="resampleThreshold" value="0.5"/>
    <param name="particles" value="30"/>
    <param name="xmin" value="-30.0"/>
    <param name="ymin" value="-30.0"/>
    <param name="xmax" value="30.0"/>
    <param name="ymax" value="30.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"/>
    <param name="tf_delay" value="0.1"/>
    <!-- Add other slam_gmapping parameters as needed -->
  </node>
</launch>

the log i see in the terminal when i execute the launch file

$roslaunch mobile_robot gazebo.launch 
... logging to /home/vasanth/.ros/log/b917bc16-4405-11ee-945c-49a7dae72a81/roslaunch-Postbox-7991.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://Postbox:40769/

SUMMARY
========

PARAMETERS
 * /diff_drive_controller/angular/z/has_acceleration_limits: True
 * /diff_drive_controller/angular/z/has_velocity_limits: True
 * /diff_drive_controller/angular/z/max_acceleration: 6.0
 * /diff_drive_controller/angular/z/max_velocity: 2.0
 * /diff_drive_controller/base_frame_id: base_link
 * /diff_drive_controller/commandTopic: /cmd_vel
 * /diff_drive_controller/enable_odom_tf: True
 * /diff_drive_controller/estimate_velocity_from_position: False
 * /diff_drive_controller/left_wheel: ['front_left_whee...
 * /diff_drive_controller/linear/x/has_acceleration_limits: True
 * /diff_drive_controller/linear/x/has_velocity_limits: True
 * /diff_drive_controller/linear/x/max_acceleration: 6.0
 * /diff_drive_controller/linear/x/max_velocity: 2.0
 * /diff_drive_controller/odom_frame_id: odom
 * /diff_drive_controller/pose_covariance_diagonal: [0.001, 0.001, 10...
 * /diff_drive_controller/publish_rate: 50
 * /diff_drive_controller/right_wheel: ['front_right_whe...
 * /diff_drive_controller/twist_covariance_diagonal: [0.001, 0.001, 10...
 * /diff_drive_controller/type: diff_drive_contro...
 * /diff_drive_controller/wheel_radius: 0.033
 * /diff_drive_controller/wheel_separation: 0.4182
 * /gazebo/enable_ros_network: True
 * /gmapping/angularUpdate: 0.5
 * /gmapping/base_frame: base_footprint
 * /gmapping/delta: 0.05
 * /gmapping/iterations: 5
 * /gmapping/kernelSize: 1
 * /gmapping/lasamplerange: 0.005
 * /gmapping/lasamplestep: 0.005
 * /gmapping/linearUpdate: 1.0
 * /gmapping/llsamplerange: 0.01
 * /gmapping/llsamplestep: 0.01
 * /gmapping/lskip: 0
 * /gmapping/map_frame: map
 * /gmapping/maxUrange: 10.0
 * /gmapping/minimumScore: 500
 * /gmapping/odom_frame: odom
 * /gmapping/particles: 30
 * /gmapping/resampleThreshold: 0.5
 * /gmapping/scan: scan
 * /gmapping/sigma: 0.05
 * /gmapping/srr: 0.1
 * /gmapping/srt: 0.2
 * /gmapping/str: 0.1
 * /gmapping/stt: 0.2
 * /gmapping/temporalUpdate: -1.0
 * /gmapping/tf_delay: 0.1
 * /gmapping/xmax: 30.0
 * /gmapping/xmin: -30.0
 * /gmapping/ymax: 30.0
 * /gmapping/ymin: -30.0
 * /joint_state_controller/gazebo_ros_control/pid_gains/front_left_wheel_joint/d: 0.0
 * /joint_state_controller/gazebo_ros_control/pid_gains/front_left_wheel_joint/i: 0.0
 * /joint_state_controller/gazebo_ros_control/pid_gains/front_left_wheel_joint/p: 1.0
 * /joint_state_controller/gazebo_ros_control/pid_gains/front_right_wheel_joint/d: 0.0
 * /joint_state_controller/gazebo_ros_control/pid_gains/front_right_wheel_joint/i: 0.0
 * /joint_state_controller/gazebo_ros_control/pid_gains/front_right_wheel_joint/p: 1.0
 * /joint_state_controller/gazebo_ros_control/pid_gains/rear_left_wheel_joint/d: 0.0
 * /joint_state_controller/gazebo_ros_control/pid_gains/rear_left_wheel_joint/i: 0.0
 * /joint_state_controller/gazebo_ros_control/pid_gains/rear_left_wheel_joint/p: 1.0
 * /joint_state_controller/gazebo_ros_control/pid_gains/rear_right_wheel_joint/d: 0.0
 * /joint_state_controller/gazebo_ros_control/pid_gains/rear_right_wheel_joint/i: 0.0
 * /joint_state_controller/gazebo_ros_control/pid_gains/rear_right_wheel_joint/p: 1.0
 * /joint_state_controller/publish_rate: 50
 * /joint_state_controller/type: joint_state_contr...
 * /robot_description: <?xml version="1....
 * /rosdistro: noetic
 * /rosversion: 1.16.0
 * /use_sim_time: True

NODES
  /
    controller_spawner (controller_manager/spawner)
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)
    gmapping (gmapping/slam_gmapping)
    joint_state_publisher (joint_state_publisher/joint_state_publisher)
    robot_state_publisher (robot_state_publisher/robot_state_publisher)
    rqt_robot_steering (rqt_robot_steering/rqt_robot_steering)
    rviz (rviz/rviz)
    spawning_lidar (gazebo_ros/spawn_model)

auto-starting new master
process[master]: started with pid [8004]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to b917bc16-4405-11ee-945c-49a7dae72a81
process[rosout-1]: started with pid [8014]
started core service [/rosout]
process[gmapping-2]: started with pid [8017]
process[controller_spawner-3]: started with pid [8018]
process[joint_state_publisher-4]: started with pid [8019]
process[robot_state_publisher-5]: started with pid [8020]
process[rviz-6]: started with pid [8022]
process[gazebo-7]: started with pid [8025]
process[gazebo_gui-8]: started with pid [8029]
process[spawning_lidar-9]: started with pid [8032]
process[rqt_robot_steering-10]: started with pid [8037]
[INFO] [1693050201.020967, 0.000000]: Controller Spawner: Waiting for service controller_manager/load_controller
[ INFO] [1693050227.674029184]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1693050227.720103929]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[ INFO] [1693050228.560645607]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1693050228.567941180]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting...
[INFO] [1693050231.071503, 0.000000]: Waiting for /clock to be available...
[INFO] [1693050231.306232, 0.000000]: Controller Spawner: Waiting for service controller_manager/load_controller
Error: Non-unique names detected in <link name='link'>
  <collision name='surface'>
    <pose>0 0 1 0 -0 0</pose>
    <geometry>
      <box>
        <size>1.5 0.8 0.03</size>
      </box>
    </geometry>
    <surface>
      <friction>
        <ode>
          <mu>0.6</mu>
          <mu2>0.6</mu2>
        </ode>
        <torsional>
          <ode/>
        </torsional>
      </friction>
      <contact>
        <ode/>
      </contact>
      <bounce/>
    </surface>
    <max_contacts>10</max_contacts>
  </collision>
  <visual name='visual1'>
    <pose>0 0 1 0 -0 0</pose>
    <geometry>
      <box>
        <size>1.4 0.8 0.04</size>
      </box>
    </geometry>
    <material>
      <script>
        <uri>file://media/materials/scripts/gazebo.material</uri>
        <name>Gazebo/Wood</name>
      </script>
    </material>
  </visual>
  <collision name='front_left_leg'>
    <pose>0.68 0.38 0.5 0 -0 0</pose>
    <geometry>
      <cylinder>
        <radius>0.02</radius>
        <length>1</length>
      </cylinder>
    </geometry>
    <max_contacts>10</max_contacts>
    <surface>
      <contact>
        <ode/>
      </contact>
      <bounce/>
      <friction>
        <torsional>
          <ode/>
        </torsional>
        <ode/>
      </friction>
    </surface>
  </collision>
  <visual name='front_left_leg'>
    <pose>0.68 0.38 0.5 0 -0 0</pose>
    <geometry>
      <cylinder>
        <radius>0.02</radius>
        <length>1</length>
      </cylinder>
    </geometry>
    <material>
      <script>
        <uri>file://media/materials/scripts/gazebo.material</uri>
        <name>Gazebo/Grey</name>
      </script>
    </material>
  </visual>
  <collision name='front_right_leg'>
    <pose>0.68 -0.38 0.5 0 -0 0</pose>
    <geometry>
      <cylinder>
        <radius>0.02</radius>
        <length>1</length>
      </cylinder>
    </geometry>
    <max_contacts>10</max_contacts>
    <surface>
      <contact>
        <ode/>
      </contact>
      <bounce/>
      <friction>
        <torsional>
          <ode/>
        </torsional>
        <ode/>
      </friction>
    </surface>
  </collision>
  <visual name='front_right_leg'>
    <pose>0.68 -0.38 0.5 0 -0 0</pose>
    <geometry>
      <cylinder>
        <radius>0.02</radius>
        <length>1</length>
      </cylinder>
    </geometry>
    <material>
      <script>
        <uri>file://media/materials/scripts/gazebo.material</uri>
        <name>Gazebo/Grey</name>
      </script>
    </material>
  </visual>
  <collision name='back_right_leg'>
    <pose>-0.68 -0.38 0.5 0 -0 0</pose>
    <geometry>
      <cylinder>
        <radius>0.02</radius>
        <length>1</length>
      </cylinder>
    </geometry>
    <max_contacts>10</max_contacts>
    <surface>
      <contact>
        <ode/>
      </contact>
      <bounce/>
      <friction>
        <torsional>
          <ode/>
        </torsional>
        <ode/>
      </friction>
    </surface>
  </collision>
  <visual name='back_right_leg'>
    <pose>-0.68 -0.38 0.5 0 -0 0</pose>
    <geometry>
      <cylinder>
        <radius>0.02</radius>
        <length>1</length>
      </cylinder>
    </geometry>
    <material>
      <script>
        <uri>file://media/materials/scripts/gazebo.material</uri>
        <name>Gazebo/Grey</name>
      </script>
    </material>
  </visual>
  <collision name='back_left_leg'>
    <pose>-0.68 0.38 0.5 0 -0 0</pose>
    <geometry>
      <cylinder>
        <radius>0.02</radius>
        <length>1</length>
      </cylinder>
    </geometry>
    <max_contacts>10</max_contacts>
    <surface>
      <contact>
        <ode/>
      </contact>
      <bounce/>
      <friction>
        <torsional>
          <ode/>
        </torsional>
        <ode/>
      </friction>
    </surface>
  </collision>
  <visual name='back_left_leg'>
    <pose>-0.68 0.38 0.5 0 -0 0</pose>
    <geometry>
      <cylinder>
        <radius>0.02</radius>
        <length>1</length>
      </cylinder>
    </geometry>
    <material>
      <script>
        <uri>file://media/materials/scripts/gazebo.material</uri>
        <name>Gazebo/Grey</name>
      </script>
    </material>
  </visual>
  <self_collide>0</self_collide>
  <inertial>
    <pose>0 0 0 0 -0 0</pose>
    <inertia>
      <ixx>1</ixx>
      <ixy>0</ixy>
      <ixz>0</ixz>
      <iyy>1</iyy>
      <iyz>0</iyz>
      <izz>1</izz>
    </inertia>
    <mass>1</mass>
  </inertial>
  <enable_wind>0</enable_wind>
  <kinematic>0</kinematic>
</link>

[ INFO] [1693050238.122411856]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ERROR] [1693050239.728919, 144.834000]: Spawn service failed. Exiting.
[ INFO] [1693050239.780270495, 144.834000000]: Physics dynamic reconfigure ready.
[spawning_lidar-9] process has died [pid 8032, exit code 1, cmd /opt/ros/noetic/lib/gazebo_ros/spawn_model -urdf -param robot_description -model my_rover __name:=spawning_lidar __log:=/home/vasanth/.ros/log/b917bc16-4405-11ee-945c-49a7dae72a81/spawning_lidar-9.log].
log file: /home/vasanth/.ros/log/b917bc16-4405-11ee-945c-49a7dae72a81/spawning_lidar-9*.log
[ INFO] [1693050243.120524667, 144.834000000]: Camera Plugin: Using the 'robotNamespace' param: '/'
[ INFO] [1693050243.373539783, 144.834000000]: Camera Plugin (ns = /)  <tf_prefix_>, set to ""
[ WARN] [1693050243.373716031, 144.834000000]: dynamic reconfigure is not enabled for this image topic [image_raw] becuase <cameraName> is not specified
[ INFO] [1693050243.675149081, 144.834000000]: Laser Plugin: Using the 'robotNamespace' param: '/'
[ INFO] [1693050243.675501314, 144.834000000]: Starting Laser Plugin (ns = /)
[ INFO] [1693050243.690094500, 144.834000000]: Laser Plugin (ns = /)  <tf_prefix_>, set to ""
[ INFO] [1693050245.469902715, 144.834000000]: Loading gazebo_ros_control plugin
[ INFO] [1693050245.470527990, 144.834000000]: Starting gazebo_ros_control plugin in namespace: /
[ INFO] [1693050245.473759576, 144.834000000]: gazebo_ros_control plugin is waiting for model URDF in parameter [robot_description] on the ROS param server.
[ERROR] [1693050245.811513231, 144.834000000]: No p gain specified for pid.  Namespace: /gazebo_ros_control/pid_gains/front_left_wheel_joint
[ERROR] [1693050245.816438967, 144.834000000]: No p gain specified for pid.  Namespace: /gazebo_ros_control/pid_gains/front_right_wheel_joint
[ERROR] [1693050245.820620174, 144.834000000]: No p gain specified for pid.  Namespace: /gazebo_ros_control/pid_gains/rear_left_wheel_joint
[ERROR] [1693050245.828072314, 144.834000000]: No p gain specified for pid.  Namespace: /gazebo_ros_control/pid_gains/rear_right_wheel_joint
[ INFO] [1693050246.366291745, 144.834000000]: Loaded gazebo_ros_control.
[INFO] [1693050246.534720, 144.845000]: Controller Spawner: Waiting for service controller_manager/switch_controller
[INFO] [1693050246.549710, 144.845000]: Controller Spawner: Waiting for service controller_manager/unload_controller
[INFO] [1693050246.568833, 144.845000]: Loading controller: diff_drive_controller
Warning: TF_REPEATED_DATA ignoring data with redundant timestamp for frame odom at time 144.984000 according to authority unknown_publisher
         at line 278 in /tmp/binarydeb/ros-noetic-tf2-0.7.6/src/buffer_core.cpp
[ WARN] [1693050246.904435374, 144.884000000]: TF_REPEATED_DATA ignoring data with redundant timestamp for frame odom at time 144.984000 according to authority unknown_publisher
[ INFO] [1693050247.354878057, 144.929000000]: Controller state will be published at 50Hz.
[ INFO] [1693050247.358824592, 144.929000000]: Wheel separation will be multiplied by 1.
[ INFO] [1693050247.364894975, 144.930000000]: Left wheel radius will be multiplied by 1.
[ INFO] [1693050247.365615800, 144.930000000]: Right wheel radius will be multiplied by 1.
[ INFO] [1693050247.368460863, 144.930000000]: Velocity rolling window size of 10.
[ INFO] [1693050247.372301323, 144.930000000]: Velocity commands will be considered old if they are older than 0.5s.
[ INFO] [1693050247.376242342, 144.930000000]: Allow mutiple cmd_vel publishers is enabled
[ INFO] [1693050247.381389614, 144.930000000]: Base frame_id set to base_link
[ INFO] [1693050247.385178344, 144.930000000]: Odometry frame_id set to odom
[ INFO] [1693050247.389428603, 144.930000000]: Publishing to tf is enabled
[ INFO] [1693050247.450222270, 144.932000000]: Odometry params : wheel separation 0.4182, left wheel radius 0.033, right wheel radius 0.033
[ INFO] [1693050247.475057275, 144.933000000]: Adding left wheel with joint name: front_left_wheel_joint and right wheel with joint name: front_right_wheel_joint
[ INFO] [1693050247.478379921, 144.933000000]: Adding left wheel with joint name: rear_left_wheel_joint and right wheel with joint name: rear_right_wheel_joint
[ INFO] [1693050247.594705885, 144.934000000]: Dynamic Reconfigure:
DynamicParams:
    Odometry parameters:
        left wheel radius multiplier: 1
        right wheel radius multiplier: 1
        wheel separation multiplier: 1
    Publication parameters:
        Publish executed velocity command: disabled
        Publication rate: 50
        Publish frame odom on tf: enabled
[INFO] [1693050247.639965, 144.935000]: Loading controller: joint_state_controller
[INFO] [1693050249.170244, 145.011000]: Controller Spawner: Loaded controllers: diff_drive_controller, joint_state_controller
[INFO] [1693050249.234255, 145.013000]: Started controllers: diff_drive_controller, joint_state_controller
[ INFO] [1693050250.048258148, 145.046000000]: Laser is mounted upwards.
 -maxUrange 10 -maxUrange 29.99 -sigma     0.05 -kernelSize 1 -lstep 0.05 -lobsGain 3 -astep 0.05
 -srr 0.1 -srt 0.2 -str 0.1 -stt 0.2
 -linearUpdate 1 -angularUpdate 0.5 -resampleThreshold 0.5
 -xmin -30 -xmax 30 -ymin -30 -ymax 30 -delta 0.05 -particles 30
[ INFO] [1693050250.261842299, 145.054000000]: Initialization complete
update frame 0
update ld=0 ad=0
Laser Pose= 0.200032 6.68523e-05 0.000334243
m_count 0
Registering First Scan

Update: after removed the mesh tag for wheels, this is the error shown in the terminal while i move the bot using rqt_robot_steering.

[ INFO] [1693977112.627791829, 145.104000000]: Laser is mounted upwards.
 -maxUrange 10 -maxUrange 29.99 -sigma     0.05 -kernelSize 1 -lstep 0.05 -lobsGain 3 -astep 0.05
 -srr 0.1 -srt 0.2 -str 0.1 -stt 0.2
 -linearUpdate 1 -angularUpdate 0.5 -resampleThreshold 0.5
 -xmin -30 -xmax 30 -ymin -30 -ymax 30 -delta 0.05 -particles 30
[ INFO] [1693977112.694976333, 145.115000000]: Initialization complete
update frame 0
update ld=0 ad=0
Laser Pose= 0.2 9.00711e-11 4.50356e-10
m_count 0
Registering First Scan
update frame 777
update ld=0.627733 ad=0.502618
Laser Pose= 0.565636 0.0773314 0.390381
m_count 1
Scan Matching Failed, using odometry. Likelihood=6.95304e-310
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2273.8
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2280.4
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2280.43
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2280.32
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2280.43
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2280.44
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2287.14
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2280.48
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2274.07
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2293.87
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2280.51
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2280.55
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2287.04
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2287.13
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2280.42
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2267.18
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2287.07
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2273.79
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2280.5
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2280.35
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2287.15
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2267.21
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2273.81
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2273.88
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2267.18
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2273.87
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2287.16
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2280.38
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Scan Matching Failed, using odometry. Likelihood=-2280.46
lp:0.2 9.00711e-11 4.50356e-10
op:0.565636 0.0773314 0.390381
Average Scan Matching Score=29.5552
neff= 29.8461
Registering Scans:Done
$\endgroup$

4 Answers 4

1
$\begingroup$

Your gazebo simulation has some problems:

  • in gazebo.launch you do not set ros parameter /use_sim_time before launching the slam_gmapping node
  • I don't think that setting ros parameter /gmapping/use_sim_time like you do in slam_gmapping.launch does anything useful.
  • you have a problem with the odom that is being calculated by the diff_drive_controller node, because the distance that odom reports is very different from the distance that gazebo thinks the robot has moved. You may have specified an inconsistent wheel radius between the robot's urdf and the diff_drive_controller.
$\endgroup$
5
  • $\begingroup$ I added a stl file for wheels instead of cylinder shape in the urdf file. I calculated the wheel diameter(0.066) using online tool. That's what i define the wheel_radius(0.033) in diff_drive_controller.yaml file. I removed the use_sim_time parameter in slam_gmapping.launch file... still the same. i have been trying to find out the issue for the last one week. $\endgroup$
    – Vasanth
    Aug 13, 2023 at 13:47
  • $\begingroup$ i really need some guidance to overcome this issue $\endgroup$
    – Vasanth
    Aug 17, 2023 at 3:38
  • $\begingroup$ I will repeat: most likely there is something wrong with the way you specify the wheel size. Either you have the wrong value, or you have mixed up radius vs. diameter. $\endgroup$
    – Mike973
    Aug 17, 2023 at 12:17
  • $\begingroup$ i cross checked that one already. Basically, i copied the wheels stl file from turtlebot3_description. The value of radius, diameter and length are same. I can replaced the robot description of turtlebot3, It works fine, i can drive the turtlebot3, the laser particles does not move. So, what i did wrong in my robot description(my_rover). That's where i am stuck at. $\endgroup$
    – Vasanth
    Aug 18, 2023 at 3:23
  • $\begingroup$ so, what i did wrong and what males the issue? $\endgroup$
    – Vasanth
    Aug 23, 2023 at 5:14
0
$\begingroup$

The odometry data looks fine. The lidar frame's transformation relative to the robot frame is correct. I will be interested to see the TF between map frame and odom frame which is usually generated by localisation node (Gmapping in this case). Please add the log files of gmapping node or the roslaunch with mapping in it.

$\endgroup$
9
  • $\begingroup$ there, i updated the question with the roslaunch files with mapping in it, as you asked to see. $\endgroup$
    – Vasanth
    Aug 26, 2023 at 5:29
  • $\begingroup$ Could I see the log file usually available in .ros/log/ of home directory or copy of log you see in terminal while executing this launch file. I need to see the warnings and errors while executing this launch file. $\endgroup$ Aug 26, 2023 at 8:05
  • $\begingroup$ there are lot of log files in that log directory. So i update the question with the log i see in terminal while i executing the launch file $\endgroup$
    – Vasanth
    Aug 26, 2023 at 12:00
  • $\begingroup$ The gmapping has started and registered its first scan. That's how rviz shows initial map and TF between map <---> odom. After that the updates will happen based on two parameter which are linearUpdate and angularUpdate. They look fine here. So the problem can be due to gmapping node not getting messages from scan topic or TF tree is broken. To see the TF tree run this command rosrun tf view_frames which saved the TF tree information as PDF. Please post the picture of that PDF. $\endgroup$ Aug 27, 2023 at 11:34
  • $\begingroup$ You can see the generated frames.pdf file in my github repo is mentioned in the question. $\endgroup$
    – Vasanth
    Aug 28, 2023 at 4:50
0
$\begingroup$

So, it works now. The issue is on the scaling factor of stl files for the wheels. I replaced the wheels as shape, and configured the inertial value in urdf,now the laser is not moving.

$\endgroup$
-1
$\begingroup$

I think this error may be related to the odom.

$\endgroup$
0

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.