My robot base link in rviz not in correct orientation with hector slam

asked 2019-07-24 04:37:36 -0500

kyubot gravatar image

updated 2019-07-24 04:43:56 -0500

Hello everyone,

I am trying to run hector_slam with mapping for driving differential drive wheel platform running ROS-Melodic + Jetson TX2 The odom to base_link works just fine as seen in below video. The robot rotates and moves according to real world robot. https://youtu.be/ROwW5_ERn3w

When trying to launch hector_slam with lidar sensor, the robot orientation and laser scanner doesn't match and when trying to move the robot, it goes to opposite direction in the map. https://youtu.be/Ua7o1XSh4MQ

I first wave my hand in front of the scanner to see where the front is then start move the robot in the forward direction however it seems like the robot is moving the other way.

My tf is described as below picture. image descriptionor https://ibb.co/X41RwFb

My launch file includes below description

     <node pkg="tf" type="static_transform_publisher" name="map_to_odom" 
      args="0.0 0.0 0.0 0 0 0.0 /map /odom 40" />
  <node pkg="tf" type="static_transform_publisher" name="odom_to_basefootprint" 
        args="0.0 0.0 0.0 0 0 0.0 /odom /base_footprint 40" />
  <node pkg="tf" type="static_transform_publisher" name="base_footprint_to_base_link" 
        args="0.0 0.0 0.0 0 0 0.0 /base_footprint /base_link 40" /> 
  <node pkg="tf" type="static_transform_publisher" name="base_link_to_laser" 
        args="0.0 0.0 0.2 0.0 0.0 0.0 /base_link /laser_frame 40" />

All parameters of tf is set to 0 for now.

Do I have to manually modify the parameters to align sensors and base_link etc?

I see other post like https://answers.ros.org/question/2421... but was not helpful.

Any comment would be much appreciated.

edit retag flag offensive close merge delete

Comments

I managed to solve this issue myself simply by turning the sensor mount in the opposite way. lol. I still need to figure out how to correctly setup slam for auto navigation.

kyubot gravatar imagekyubot ( 2019-07-26 02:08:50 -0500 )edit