11-22-22 update links
@ -41,7 +41,10 @@ The SDK 8.1 README provides more technical background:
|
||||
|
||||
>Because of the new robot-centric coordinate system, the pitch and roll angles returned by the `IMU` interface will be different from the ones returned by the `BNO055IMU` interface. When you are migrating your code, pay careful attention to the documentation.
|
||||
|
||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
||||
|
||||
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Universal-IMU-Interface]]</i><p>
|
||||
|
||||
|
||||
|
||||
## Potential Usage
|
||||
|
||||
@ -71,7 +74,7 @@ The FTC SDK can also provide values for **angular velocity**, which is the rate
|
||||
|
||||
Let's get started!
|
||||
|
||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
||||
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Universal-IMU-Interface]]</i><p>
|
||||
|
||||
## Configure IMU
|
||||
|
||||
@ -91,7 +94,7 @@ When done, **save** and **activate** this configuration.
|
||||
|
||||
_If a Blocks OpMode is open at the computer's programming screen, close and re-open that OpMode to capture this updated configuration. Blocks are provided only for devices in the configuration that's active **upon opening** an OpMode._
|
||||
|
||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
||||
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Universal-IMU-Interface]]</i><p>
|
||||
|
||||
## Axes Definition
|
||||
|
||||
@ -115,7 +118,7 @@ _Fun fact: the IMU is located approximately under the word "PROUD", near the low
|
||||
|
||||
This tutorial will **not** discuss the FTC [Field Coordinate System](https://github.com/FIRST-Tech-Challenge/FtcRobotController/blob/master/FtcRobotController/src/main/java/org/firstinspires/ftc/robotcontroller/external/samples/FTC_FieldCoordinateSystemDefinition.pdf). Your OpModes might relate robot orientation to the overall field or ['global coordinates'](https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Vuforia-for-Blocks#vuforia-introduction) for navigation, but that's beyond the focus here on using the IMU.
|
||||
|
||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
||||
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Universal-IMU-Interface]]</i><p>
|
||||
|
||||
## Physical Hub Mounting
|
||||
|
||||
@ -123,7 +126,7 @@ Under SDK 8.1, you can specify the **physical orientation** of the Hub on the ro
|
||||
|
||||
Before jumping into programming, let's discuss your options for physically mounting the Hub on the robot. In general, the Hub's mounting can be considered **Orthogonal** or **Non-Orthogonal**.
|
||||
|
||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
||||
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Universal-IMU-Interface]]</i><p>
|
||||
|
||||
**Orthogonal Mounting**
|
||||
|
||||
@ -143,7 +146,7 @@ Here are some common examples:
|
||||
|
||||
With six cube faces, and four 90-degree positions on each face, there are **24 possible Orthogonal orientations**.
|
||||
|
||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
||||
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Universal-IMU-Interface]]</i><p>
|
||||
|
||||
**Non-Orthogonal Mounting**
|
||||
|
||||
@ -157,7 +160,7 @@ Here are some scenarios, ranging from simple to complex:
|
||||
|
||||
For any Non-Orthogonal scenarios, SDK 8.1 provides **two ways** to describe the Hub's orientation. See below for the **Angles** method and the **Quaternion** method.
|
||||
|
||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
||||
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Universal-IMU-Interface]]</i><p>
|
||||
|
||||
## IMU Programming
|
||||
|
||||
@ -174,7 +177,7 @@ The programming steps include:
|
||||
|
||||
The following sections cover these topics in order.
|
||||
|
||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
||||
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Universal-IMU-Interface]]</i><p>
|
||||
|
||||
## Parameters
|
||||
|
||||
@ -184,7 +187,7 @@ In the FTC Blocks menu, under `Sensors` and `IMU`, see the three methods for spe
|
||||
|
||||
[[/images/Universal-IMU-Interface/045-Blocks-parameters-toolbox-labels.png]]
|
||||
|
||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
||||
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Universal-IMU-Interface]]</i><p>
|
||||
|
||||
### Parameters for Method 1, Orthogonal
|
||||
|
||||
@ -209,7 +212,7 @@ IMU.Parameters myIMUparameters;
|
||||
myIMUparameters = new IMU.Parameters(new RevHubOrientationOnRobot(RevHubOrientationOnRobot.LogoFacingDirection.UP, RevHubOrientationOnRobot.UsbFacingDirection.FORWARD));
|
||||
```
|
||||
|
||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
||||
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Universal-IMU-Interface]]</i><p>
|
||||
|
||||
### Hub Axes for Setting Parameters
|
||||
|
||||
@ -231,7 +234,7 @@ Hub rotations also follow the right-hand rule.
|
||||
|
||||
_The legacy `BNO055IMU` driver used **different Hub axes**: its X axis pointed to the USB port, and Y axis pointed to the left-side motor ports. The new SDK 8.1 universal IMU driver uses the above Hub axes for BNO055 and BHI260AP._
|
||||
|
||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
||||
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Universal-IMU-Interface]]</i><p>
|
||||
|
||||
### Parameters for Method 2, Angles
|
||||
|
||||
@ -273,7 +276,7 @@ myIMUparameters = new IMU.Parameters(new RevHubOrientationOnRobot(new Orientatio
|
||||
|
||||
_This example does not use the final Java parameter `acquisitionTime`, here set to 0._
|
||||
|
||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
||||
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Universal-IMU-Interface]]</i><p>
|
||||
|
||||
### Parameters for Method 3, Quaternion
|
||||
|
||||
@ -304,7 +307,7 @@ Here's a Quaternion-related **side note** from the SDK 8.1 README:
|
||||
>The `IMU` interface is also suitable for implementation by **third-party vendors for IMUs** that support providing the orientation in the form of a **quaternion**.
|
||||
-->
|
||||
|
||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
||||
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Universal-IMU-Interface]]</i><p>
|
||||
|
||||
## Initialize IMU
|
||||
|
||||
@ -330,7 +333,7 @@ imu.initialize(new IMU.Parameters(new RevHubOrientationOnRobot(RevHubOrientation
|
||||
imu.initialize(myIMUparameters);
|
||||
```
|
||||
|
||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
||||
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Universal-IMU-Interface]]</i><p>
|
||||
|
||||
## Read IMU Angles - Basic
|
||||
|
||||
@ -374,7 +377,7 @@ Note that the robot's orientation is described here **intrinsically**; the axes
|
||||
|
||||
_Again, the IMU **output** results are given in the **Robot Coordinate System**, or Robot axes. Only for a non-Orthogonal orientation, **Hub axes** were used temporarily for **input** parameters, describing the Hub's rotation to achieve its mounted orientation._
|
||||
|
||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
||||
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Universal-IMU-Interface]]</i><p>
|
||||
|
||||
## Read IMU Angles - Flexible
|
||||
|
||||
@ -407,7 +410,7 @@ myRobotOrientation.thirdAngle
|
||||
|
||||
_Pay close attention to the selection of **axes order**, which greatly affects the IMU results. If you care mostly about Heading (Yaw), choose an axes order that starts with Z._
|
||||
|
||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
||||
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Universal-IMU-Interface]]</i><p>
|
||||
|
||||
## Read Angular Velocity
|
||||
|
||||
@ -439,7 +442,7 @@ myRobotAngularVelocity.yRotationRate
|
||||
|
||||
These are also shown in each of the Java **Sample OpModes** listed in a section below.
|
||||
|
||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
||||
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Universal-IMU-Interface]]</i><p>
|
||||
|
||||
## Reset Heading
|
||||
|
||||
@ -494,7 +497,7 @@ There does seem to be some weirdness with the yaw reset, if both pitch and roll
|
||||
|
||||
-->
|
||||
|
||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
||||
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Universal-IMU-Interface]]</i><p>
|
||||
|
||||
## Sample OpModes
|
||||
|
||||
@ -506,15 +509,13 @@ Here's an [**image**](https://raw.githubusercontent.com/wiki/FIRST-Tech-Challeng
|
||||
|
||||
In Java, three Sample OpModes demonstrate the new universal IMU interface:
|
||||
|
||||
- [**ConceptExploringIMUOrientation.java**](https://github.com/FIRST-Tech-Challenge/FtcRobotController/blob/master/FtcRobotController/src/main/java/org/firstinspires/ftc/robotcontroller/external/samples/ConceptExploringIMUOrientation.java) [**<i>[draft link]</i>**](https://github.com/WestsideRobotics/Universal-IMU-Interface/blob/main/Examples/ConceptExploringIMUOrientation.java) provides a tool to experiment with setting your Hub orientation on the robot
|
||||
- [**ConceptExploringIMUOrientation.java**](https://github.com/FIRST-Tech-Challenge/FtcRobotController/blob/master/FtcRobotController/src/main/java/org/firstinspires/ftc/robotcontroller/external/samples/ConceptExploringIMUOrientation.java) provides a tool to experiment with setting your Hub orientation on the robot
|
||||
|
||||
- [**SensorIMUOrthogonal.java**](https://github.com/FIRST-Tech-Challenge/FtcRobotController/blob/master/FtcRobotController/src/main/java/org/firstinspires/ftc/robotcontroller/external/samples/SensorIMUOrthogonal.java) [**<i>[draft link]</i>**](https://github.com/WestsideRobotics/Universal-IMU-Interface/blob/main/Examples/SensorIMUOrthogonal.java) shows how to define your Hub orientation on the robot, for simple orthogonal (90 degree) mounting
|
||||
- [**SensorIMUOrthogonal.java**](https://github.com/FIRST-Tech-Challenge/FtcRobotController/blob/master/FtcRobotController/src/main/java/org/firstinspires/ftc/robotcontroller/external/samples/SensorIMUOrthogonal.java) shows how to define your Hub orientation on the robot, for simple orthogonal (90 degree) mounting
|
||||
|
||||
- [**SensorIMUNonOrthogonal.java**](https://github.com/FIRST-Tech-Challenge/FtcRobotController/blob/master/FtcRobotController/src/main/java/org/firstinspires/ftc/robotcontroller/external/samples/SensorIMUNonOrthogonal.java) [**<i>[draft link]</i>**](https://github.com/WestsideRobotics/Universal-IMU-Interface/blob/main/Examples/SensorIMUNonOrthogonal.java) shows how to define (with the Angles method) your Hub orientation on the robot for a non-orthogonal orientation
|
||||
- [**SensorIMUNonOrthogonal.java**](https://github.com/FIRST-Tech-Challenge/FtcRobotController/blob/master/FtcRobotController/src/main/java/org/firstinspires/ftc/robotcontroller/external/samples/SensorIMUNonOrthogonal.java) shows how to define (with the Angles method) your Hub orientation on the robot for a non-orthogonal orientationThese three Java samples include extensive comments describing the IMU interface, consistent with this tutorial. In particular, `SensorIMUNonOrthogonal.java` describes three helpful examples.
|
||||
|
||||
These three Java samples include extensive comments describing the IMU interface, consistent with this tutorial. In particular, `SensorIMUNonOrthogonal.java` describes three helpful examples.
|
||||
|
||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
||||
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Universal-IMU-Interface]]</i><p>
|
||||
|
||||
## SDK Resources
|
||||
|
||||
@ -536,7 +537,7 @@ The new universal IMU classes for SDK 8.1 are:
|
||||
|
||||
The Javadocs describe other IMU methods and variables not covered in this basic tutorial.
|
||||
|
||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
||||
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Universal-IMU-Interface]]</i><p>
|
||||
|
||||
## Summary
|
||||
|
||||
@ -554,7 +555,7 @@ Updating to SDK 8.1 is **optional** for POWERPLAY, if you are not planning to us
|
||||
|
||||
However **all teams** are encouraged to begin using the universal IMU classes and methods for **new** Blocks and Java code, and consider migrating **existing** code.
|
||||
|
||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
||||
<p align="right"><i>[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Universal-IMU-Interface]]</i><p>
|
||||
|
||||
<i>Questions, comments and corrections to westsiderobotics@verizon.net</i>
|
||||
|
||||
|
Reference in New Issue
Block a user