acmerobotics / road-runner-quickstart

FTC quickstart for https://github.com/acmerobotics/road-runner
BSD 3-Clause Clear License
187 stars 997 forks source link

Three Tracking Wheel Localizing #48

Closed LetianLi closed 4 years ago

LetianLi commented 4 years ago

When putting in the locations of the three tracking (dead) wheels, do we put in lateral distance of the outside, middle, or inside of the left and right wheels. I||---------||I (outside distance), |I|---------|I| (middle distance), ||I---------I|| (inside distance),

rbrott commented 4 years ago

The middle distance. Ideally there is a single point of contact when the roller hits the floor.

LetianLi commented 4 years ago

We have two points of contact as we have two omni wheels next to each other. Will this be a problem.

LetianLi commented 4 years ago

Our heading is currently 10 degrees off. We have all measurements that are relative to the center of the 4 mecanum wheels. How do we fix this error? all our measurements seem correct, including wheel radius.

rbrott commented 4 years ago

Where are the other wheels? Are they all doubled?

LetianLi commented 4 years ago

All of our wheels are doubled. new Pose2d(1 + 3/16, 6 + 13/16, 0), // left new Pose2d(1 + 3/16, -6 - 13/16, 0), // right new Pose2d(4 + 9/16, -10/16, Math.toRadians(90)) // front

rbrott commented 4 years ago

OK 3/16 evaluates to 0. You probably want 3.0/16.0 instead.

LetianLi commented 4 years ago

Thank you! That solved the problem. I should have observed this stupid mistake myself!

LetianLi commented 4 years ago

After fixing the code, now the odometry wheel heading is about 0.2 to 0.5 degree difference compared to IMU, when turning 180 degree. Is that normal/acceptable? I think IMU (from rev hub) itself may have some errors too?

rbrott commented 4 years ago

That seems acceptable. I'd compare after a bigger turn (i.e., a few revolutions) and see if the error is still acceptable.