Skip to content
This repository has been archived by the owner on Dec 30, 2024. It is now read-only.

Commit

Permalink
Added Pinpoint Localization!
Browse files Browse the repository at this point in the history
  • Loading branch information
Logan-Nash authored and Logan-Nash committed Oct 17, 2024
1 parent ce3ae6c commit f5ac5ea
Show file tree
Hide file tree
Showing 5 changed files with 945 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ the pose exponential method of localization. It's basically a way of turning mov
robot's coordinate frame to the global coordinate frame. If you're interested in reading more about
it, then check out pages 177 - 183 of [Controls Engineering in the FIRST Robotics Competition](https://file.tavsys.net/control/controls-engineering-in-frc.pdf)
by Tyler Veness. However, the OTOS localizer uses its own onboard system for calculating localization,
which I do not know about.
which we do not know about.

## Setting Your Localizer
Go to line `70` in the `PoseUpdater` class, and replace the `new ThreeWheelLocalizer(hardwareMap)`
Expand All @@ -15,6 +15,7 @@ with the localizer that applies to you:
don't change it from the default
* If you're using three wheel odometry with the IMU, put `new ThreeWheelIMULocalizer(hardwareMap)`
* If you're using OTOS, put `new OTOSLocalizer(hardwareMap)`
* If you're using Pinpoint, put `new PinpointLocalizer(hardwareMap)`

## Tuning
To start, you'll want to select your localizer of choice. Below, I'll have instructions for the drive
Expand Down Expand Up @@ -241,6 +242,23 @@ that applies to you and follow the directions there.
robot around and see if the movements look accurate on FTC Dashboard. If they don't, then you'll
want to re-run some of the previous steps. Otherwise, congrats on tuning your localizer!

## Pinpoint Localizer
* First you will need to plug in the pinpoint to the i2c port. Ensure that the dead wheel encoder wires are
plugged into the proper ports on the pinpoint to ensure no error within the tuning steps.
* Then, go to the `PinpointLocalier.java` file and go to where it tells you to replace
the current statement with your pinpoint port in the constructor. Replace the `deviceName` parameter
with the name of the port that the pinpoint is connected to.
* Next, follow the instructions left by the TODO: comment and enter in the odometry measurements either in
mms or inches (We have the conversion rates listed).
* First, to ensure that your pinpoint is properly connected, please run the `SensorGoBildaPinpointExample.java`
file left in the `tuning` folder located within `localization`.
* Once completed, the localizer should be properly tuned. To test it out, you can go to
`Localization Test` and push around or drive around your robot. Go to [FTC Dashboard](http://192.168.43.1:8080/dash)
and on the top right, switch the drop down from the default view to the field view. Then, on the bottom
left corner, you should see a field and the robot being drawn on the field. You can then move your
robot around and see if the movements look accurate on FTC Dashboard. If they don't, then you'll
want to re-run some of the previous steps. Otherwise, congrats on tuning your localizer!

## Using Road Runner's Localizer
Of course, many teams have experience using Road Runner in the past and so have localizers from Road
Runner that are tuned. There is an adapter for the Road Runner three wheel localizer to the Pedro
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,5 @@ of the curvature formula, we can estimate a centripetal force correction and app
control.

## Questions?
If you still have more questions, feel free to contact us at `[email protected]`
If you still have more questions, feel free to contact us at `[email protected]` or
within our discord linked here(https://discord.gg/2GfC4qBP5s)
Loading

0 comments on commit f5ac5ea

Please sign in to comment.