Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TrackedVehicleSystem Yaw Incorrect #2692

Open
Rob-Dawson opened this issue Dec 5, 2024 · 2 comments
Open

TrackedVehicleSystem Yaw Incorrect #2692

Rob-Dawson opened this issue Dec 5, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Rob-Dawson
Copy link

Environment

  • OS Version: 24.04
  • Source or binary build?
    gz-sim 8.7.0

Description

  • Expected behavior: Yaw in Gazebo and odom should be accurate or reasonably accurate
  • Actual behavior: Wildly Inaccurate

Steps to reproduce

  1. Launch the Standard tracked_vehicle_simple.sdf
  2. Print Odom to terminal
  3. Compare

Output

I know the odom is printed as a quaternion so I converted it
yaw = math.atan2(2*(w*z+x*y), 1-2*(z**2 + y**2))
The yaw (in Gazebo) is -1.56 whereas the yaw output from odom is -2.4960000000000058.

I have changed the tracks_seperation to <tracks_separation>0.50017</tracks_separation> as this was the size of the box and removed the empty space between the base_link and the left and right tracks to ensure this is correct but i'm still getting incorrect odom (Gazebo Yaw -1.66, Odom yaw -1.852000000000027 which if left running will get progressively worse).

Has anyone been able to get an accurate reading from this? Is there a way to get a more accurate reading? I eventually want to get the robots odom but add some noise to make it more real world realistic

@Rob-Dawson Rob-Dawson added the bug Something isn't working label Dec 5, 2024
@azeey
Copy link
Contributor

azeey commented Dec 16, 2024

cc @peci1

@azeey azeey moved this from Inbox to In progress in Core development Dec 16, 2024
@peci1
Copy link
Contributor

peci1 commented Dec 16, 2024

Well, tracked vehicles are "skid-steer". They turn by skidding. And if you're skidding and you don't exactly know the parameters of the skid, your odometry goes... elsewhere :)

On our physical tracked robots (as well as the simulated ones) we only use forward velocity component of the odometry and completely throw away the rotation velocity from odometry. We use gyro instead, which is way more precise.

This (im)precision should normally be visible from the covariance of the odometry, but I fear that Gazebo outputs all zeros in odometry (which, by definition, is unknown covariance).

Anyways, the position component of odometry provided by Gazebo is a super-simple integrator of velocity * time_step, so I wouldn't use it long-term on any kind of robot (not even diff-drive). It just drifts too far too quickly. You need some kind of clever estimator to get better results (EKF, factorgraph, SLAM...). And use only the velocity components of the Gazebo-provided odometry.

It would help if you plotted some trajectory. Gazebo GUI offers a plotting window, so please open it and record the output of odometry. Unless the graph shows something very strange (like a random-looking curve), I would consider this issue closed.

If you need the exact position of the robot in the world, you should rather subscribe to its world pose instead of odometry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: In progress
Development

No branches or pull requests

3 participants