Skip to content

Instantly share code, notes, and snippets.

@jhh
Last active March 18, 2022 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhh/8448ba7ec2ea1559f3553c44adf07cf4 to your computer and use it in GitHub Desktop.
Save jhh/8448ba7ec2ea1559f3553c44adf07cf4 to your computer and use it in GitHub Desktop.
Odometry Test Protocol

Odometry Test Protocol

The objective is to evaluate how well our robot's swerve drive odometry tracks with actual field position while experiencing normal match driving for the duration of a match. We will capture odometry calculated Pose2d field position using the Third Coast telemetry system already on the robot.

Preparation

We need to do some up-front preparation to allow us to correlate the actual position of the robot on the field in the captured odometry Pose2d position time series.

  1. Decide how many field reference positions (1 or more) you will use. These will be field positions the robot drive goes to periodically during the test run. You can mark these on the field however you like (tape, red solo cups, etc).

    We will use four positions as an example in the rest of this document.

  2. Decide how you will position the robot and "zero-out" odometry at the beginning of each run.

  3. Decide on how many other conditions you will impose on test runs, for example smooth, choppy, yawing, hits from defender, etc... and how you will record these in your collected data. Are you stopping at the reference points or driving by them? Plan on briefing the drive team on how to apply these conditions while driving.

  4. Create a temporary MeasurableSubsystem with a Measure that can send a reference position number to telemetry when its corresponding button is pressed. This will allow us to annotate the time-series telemetry stream captured during the test.

    For example, four Shuffleboard buttons corresponding to the number of reference positions will cause the subsystem to send the corresponding number (1-4) to the telemetry stream. The rising edge of transitions between numbers (for example, 1 -> 2) will mark the time of button press.

  5. Determine the values to be capture in telemetry and set up the tcr tool from Third Coast Recorder to capture this data.

  6. Optionally, set up a Jupyter notebook template page for analysis.

Test Runs

  1. Check battery voltage.

  2. Brief the drive team on how and where they will drive during the test match.

  3. Position the robot in the starting position and zero odometry.

  4. Start the tcr tool capture configured for an appropriate time period.

  5. Press the corresponding button for the subsystem you created above as the robot pauses at or drives by reference positions.

  6. At the end of the test run record any special conditions you were testing for that run.

Analysis

  1. Create a new Jupyter notebook page from the template for each test run.

  2. Import the CSV and add any notes you collected from the test run.

  3. Draw conclusions from the results.

    • What are we using the odometry for?
    • What is considered "good-enough" odometry for our intended use?
    • Do we meet that criteria?
    • Are there special conditions we need to follow to meet the criteria?
@jhh
Copy link
Author

jhh commented Mar 18, 2022

Example Field Set Up

example_field_setup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment