ros-mobile-robots / diffbot

DiffBot is an autonomous 2wd differential drive robot using ROS Noetic on a Raspberry Pi 4 B. With its SLAMTEC Lidar and the ROS Control hardware interface it's capable of navigating in an environment using the ROS Navigation stack and making use of SLAM algorithms to create maps of unknown environments.
https://ros-mobile-robots.com
BSD 3-Clause "New" or "Revised" License
297 stars 86 forks source link

Laser scan translation wrong when robot turn #44

Open funnyrabbitvu opened 2 years ago

funnyrabbitvu commented 2 years ago

https://user-images.githubusercontent.com/48290085/145632117-82781293-bd34-4f18-8462-d6b6662ad1a6.mp4

Hi guys, I'm facing an issue that when I turn robot around in SLAM mode the laser scan effect was displaying wrong pose/translation, specially, its gonna fit the environment only when robot stop moving (showing in video). I'm thinking about that I got wrong odometry calculation or maybe the laser frequency update was not fast enough. This issue effected to navigation process that robot would turn into recovery mode. I didn't find the answer yet so I hope you guys could help me out. Actually, I tried to fix this by using all same configurations with the Turtlebot3 robot but I haven't solve it yet because this issue didn't happen to this robot :// Many thanks in advanced!

Regards, rabbit.

fjp commented 2 years ago

Hi @funnyrabbitvu, thanks for reporting this problem! I am also aware of this issue and like you mention this happens most likely because the odometry is not accurate enough. In simulation (and real world) there are a lot of settings to tweak in order to improve this issue. For the new robot Remo, found in the remo_description package (which is different to the "old diffbot_description"), I invested a lot of time to tune some of the following parameters. One of the important ones were to set the wheel base (distance between wheels) and wheel radius correctly. Otherwise the odometry calculations are obviously wrong and lead to the problem you are showing.

https://github.com/ros-mobile-robots/diffbot/blob/327f39559a7d7f2a49ea5a9534b941f7777e483b/diffbot_control/config/diffbot_control.yaml#L30-L34

Adapting these parameters improved the behavior but it is still not perfect as you can see in the following video of Remo twisting around:

https://user-images.githubusercontent.com/1286618/145669976-2c20a232-7f12-42be-b426-dc362efa2042.mp4

Now the thing is, that currently most values are tuned for Remo robot and not the "old diffbot model" (found in the diffbot_description), which you are using. To alleviate this issue for both models, we should tune both models as good as possible, e.g. the gazebo related settings in the diffbot/remo_description (for diffbot this hasn't been extensivly done yet) and also use a specific parameter set, depending on which robot is used by the user.

What I also noticed is that in Gazebo simulator the scans are not matching to the obstacles either:

https://user-images.githubusercontent.com/1286618/145671681-5315b8c5-2981-48a5-b46a-749b5d9c5d54.mp4

However, this might be not an issue as it also happens with turtlebot3:

https://user-images.githubusercontent.com/1286618/145672320-fae66885-3d0d-4296-a356-2b82e1b472a2.mp4

Regarding why for turtlebot3 the scans are aligned more accurately with the map, I have only some assumptions, which I want to list here:

Other settings I looked at but didn't seem to have a big impact are:

As it might help, I will also add some of the answers/sources I found regarding this issue and the parameters that influence it:

Finally, I want to highlight that I would love to see a good/clear solution to this issue, so any other findings you have about this are most welcome. I hope find time soon to add an IMU to the robot and also test it extensively in simulation. So far I just did a quick test with a simulated imu but without a lot of parameter tuning (imu and ekf).

funnyrabbitvu commented 2 years ago

Hi @funnyrabbitvu, thanks for reporting this problem! I am also aware of this issue and like you mention this happens most likely because the odometry is not accurate enough. In simulation (and real world) there are a lot of settings to tweak in order to improve this issue. For the new robot Remo, found in the remo_description package (which is different to the "old diffbot_description"), I invested a lot of time to tune some of the following parameters. One of the important ones were to set the wheel base (distance between wheels) and wheel radius correctly. Otherwise the odometry calculations are obviously wrong and lead to the problem you are showing.

https://github.com/ros-mobile-robots/diffbot/blob/327f39559a7d7f2a49ea5a9534b941f7777e483b/diffbot_control/config/diffbot_control.yaml#L30-L34

Adapting these parameters improved the behavior but it is still not perfect as you can see in the following video of Remo twisting around:

remo_twist_issue_wheel_base.mp4 Now the thing is, that currently most values are tuned for Remo robot and not the "old diffbot model" (found in the diffbot_description), which you are using. To alleviate this issue for both models, we should tune both models as good as possible, e.g. the gazebo related settings in the diffbot/remo_description (for diffbot this hasn't been extensivly done yet) and also use a specific parameter set, depending on which robot is used by the user.

What I also noticed is that in Gazebo simulator the scans are not matching to the obstacles either:

remo_twist_issue_gazebo.mp4 However, this might be not an issue as it also happens with turtlebot3:

turtlebot3_gazebo_twist_issue.mp4 Regarding why for turtlebot3 the scans are aligned more accurately with the map, I have only some assumptions, which I want to list here:

Other settings I looked at but didn't seem to have a big impact are:

As it might help, I will also add some of the answers/sources I found regarding this issue and the parameters that influence it:

Finally, I want to highlight that I would love to see a good/clear solution to this issue, so any other findings you have about this are most welcome. I hope find time soon to add an IMU to the robot and also test it extensively in simulation. So far I just did a quick test with a simulated imu but without a lot of parameter tuning (imu and ekf).

Many thanks for your awesome support, bro. I'm trying to figure it out with your guideline. I will report my working status.