0
$\begingroup$

enter image description hereLidar scans after rotation The picture above is the lidar scan in simulation only after rotation. Just to clarify, I know I can use an IMU but right now, I only want to get it working with odometry.

Basically, whenever I rotate the robot in RVIZ, with the lidar data decay rate set to 20 seconds, I see that the subsequent scans are different(scans are not static) and I know this is due to bad odometry but I can't find out why. The odometry has only two parameters, wheel radius and wheel base and I've lifted both the values directly from calculation. Moreover, there is no slippage or whatever, because the robot is running purely in simulation with ros2 control. Is there a way I can diagnose or test for why there is bad odometry? like some sort of test for the wheel base? Because of the bad odometry, I can't even create a map (unless the main frame is set to odom, then I can create a marginally better one).

$\endgroup$
5
  • $\begingroup$ Please add your TF tree to the post. $\endgroup$
    – billy
    Commented Nov 10, 2023 at 6:21
  • $\begingroup$ @billy hi billy, just added the tf frame above $\endgroup$
    – dipper
    Commented Nov 10, 2023 at 19:11
  • $\begingroup$ Two more questions: What happens if you move straight forwards or backwards? What frame is the displayed frame in RVIS? $\endgroup$
    – billy
    Commented Nov 11, 2023 at 5:08
  • $\begingroup$ @billy the frame is odom. And moving the robot backwards and forwards does almost the same thing but the lidar scans spreads a bit more linearly. $\endgroup$
    – dipper
    Commented Nov 11, 2023 at 8:56
  • $\begingroup$ I guess you should post the code that generates your ODOM message and the ODOM TF. $\endgroup$
    – billy
    Commented Nov 11, 2023 at 19:43

1 Answer 1

0
$\begingroup$

I would move the robot to a known position and check the odometry topic by echoing it.

If you want to check the actual robot pose in Gazebo, you can use the pose publisher plugin, see the demo world for an example.

Is every node using parameter use_sim_time:=true?

$\endgroup$
6
  • $\begingroup$ Could you please elaborate? Like how would I use this method to understand why the odometry is so bad? $\endgroup$
    – dipper
    Commented Nov 10, 2023 at 19:12
  • $\begingroup$ Based on what do you conclude that the odometry is bad? First test I would do is to start the simulation, echo the odometry topic and see if it makes sense. Then command a known motion (e.g. rotate 90°) and check the odometry output again. $\endgroup$
    – JRTG
    Commented Nov 10, 2023 at 20:23
  • $\begingroup$ I've done what you've said by rotating the robot 360 degrees to get it to its starting position with the x axis pointing in roughly the same direction like when it started but after rotating there's a noticeable difference in it. I can't get the x axis pointing in exactly the same direction. And yes sim time is true for all of them. $\endgroup$
    – dipper
    Commented Nov 11, 2023 at 8:43
  • $\begingroup$ And did you check if the pose in Gazebo corresponds to the odometry output? $\endgroup$
    – JRTG
    Commented Nov 11, 2023 at 8:49
  • $\begingroup$ Comparing the position of the robot in Gazebo and Rviz based on the scans, they seem to be a near exact match $\endgroup$
    – dipper
    Commented Nov 11, 2023 at 8:55

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.