WestsideRobotics
2022-12-26 10:21:10 -08:00
3 changed files with 58 additions and 51 deletions

@ -99,7 +99,7 @@ The same points apply as for DS Self Inspect 1 (immediately above), except:
- Item 10's No would be **rejected** if the DS Pairing Method was set to Control Hub. - Item 10's No would be **rejected** if the DS Pairing Method was set to Control Hub.
- Item 11 indicates whether the **device name** meets FTC format requirements. It does not check whether the paired device has a matching RC name (team number). - Item 11 indicates whether the **device name** meets FTC format requirements. It does not check whether the paired device has a matching RC name (team number).
- Item 12 verifies that the Driver Hub does **not** have an RC app installed. - Item 12 verifies that the Driver Hub does **not** have an RC app installed.
- Item 13 ensures the DS app meets the minimum version **for the current FTC season**, based on the device's system date. This particular version 7.0.1 does not exactly match the RC phone's 7.0. Such a "Point mismatch" is allowed under [updated FTC rules](https://ftc-qa.firstinspires.org/qa/176). Otherwise, an "incorrect" red mark here can be cleared by correcting the date in the **Android device Settings**. - Item 13 ensures the DS app meets the minimum version **for the current FTC season**, based on the device's system date. This particular version 7.0.1 does not exactly match the RC phone's 7.0. Such a "Point mismatch" is allowed under updated FTC rules (was Q&A #176 for 2021-2022 season). Otherwise, an "incorrect" red mark here can be cleared by correcting the date in the **Android device Settings**.
<br> <br>
<p align="center">[[/images/FTC-Self-Inspect/tDS-3b.png]] <p align="center">[[/images/FTC-Self-Inspect/tDS-3b.png]]
@ -148,7 +148,7 @@ Now we change to **Robot Controller** Self Inspect screens. Again, RC screens c
This RC Self Inspect screen displayed on the paired DS phone is the "same" as the previous one on the RC phone, with two differences: This RC Self Inspect screen displayed on the paired DS phone is the "same" as the previous one on the RC phone, with two differences:
- The 3-dots menu is missing from the header. This menu offered a single choice, to disconnect the Wi-Fi Direct. But this cannot be performed as an RC action, from a DS phone connected by that same Wi-Fi Direct. - The 3-dots menu is missing from the header. This menu offered a single choice, to disconnect the Wi-Fi Direct. But this cannot be performed as an RC action, from a DS phone connected by that same Wi-Fi Direct.
- Item 14 did not appear on the RC phone's display of this RC Self Inspect. Here is the verification that the DS app and RC app have matching versions; in this case both apps are version 7.0. Any "Point mismatch" (e.g. 7.0 vs. 7.0.1) is allowed under [updated FTC rules](https://ftc-qa.firstinspires.org/qa/176). - Item 14 did not appear on the RC phone's display of this RC Self Inspect. Here is the verification that the DS app and RC app have matching versions; in this case both apps are version 7.0. Any "Point mismatch" (e.g. 7.0 vs. 7.0.1) is allowed under updated FTC rules (was Q&A #176 for 2021-2022 season).
[<p align="right"><i>Return to Top</i>](#introduction)<p> [<p align="right"><i>Return to Top</i>](#introduction)<p>
@ -175,7 +175,7 @@ This is also the same screen, except the RC phone was connected to an internet r
This display on a paired Driver Hub is the "same" RC Self Inspect screen as the one immediately above, but there are two differences: This display on a paired Driver Hub is the "same" RC Self Inspect screen as the one immediately above, but there are two differences:
- The 3-dots menu is missing from the header. This menu offered a single choice, to disconnect the Wi-Fi Direct. But this cannot be performed as an RC action, from a Driver Hub connected by that same Wi-Fi Direct. - The 3-dots menu is missing from the header. This menu offered a single choice, to disconnect the Wi-Fi Direct. But this cannot be performed as an RC action, from a Driver Hub connected by that same Wi-Fi Direct.
- Item 14 did not appear on the RC phone's display of this RC Self Inspect. Here is the check for matching versions of the DS app and RC app. In this case, the DS app is 7.0.1 and the RC app is 7.0, rejected here as a mismatch. Such a "Point mismatch" is allowed under [updated FTC rules](https://ftc-qa.firstinspires.org/qa/176). - Item 14 did not appear on the RC phone's display of this RC Self Inspect. Here is the check for matching versions of the DS app and RC app. In this case, the DS app is 7.0.1 and the RC app is 7.0, rejected here as a mismatch. Such a "Point mismatch" is allowed under updated FTC rules (was Q&A #176 for 2021-2022 season).
[<p align="right"><i>Return to Top</i>](#introduction)<p> [<p align="right"><i>Return to Top</i>](#introduction)<p>
@ -196,7 +196,7 @@ Looking now at the **Control Hub**, the Self Inspect screen has a few difference
- Item 9 does apply here to the Control Hub. Its password must be changed from the factory default ("password"). - Item 9 does apply here to the Control Hub. Its password must be changed from the factory default ("password").
- Items 10 and 11 should be Yes and Yes for Control Hub, which uses only Standard/infra Wi-Fi. Item 11 does not indicate **what** the Control Hub is connected to (but it must be the DS phone displaying this screen). - Items 10 and 11 should be Yes and Yes for Control Hub, which uses only Standard/infra Wi-Fi. Item 11 does not indicate **what** the Control Hub is connected to (but it must be the DS phone displaying this screen).
- Item 12 shows the Standard Wi-Fi **network name**, or Access Point (AP), that is broadcast by the Control Hub. The check-mark indicates the AP has a correctly formatted FTC name. This does **not** check that the DS and RC names match (team number). In fact, this DS phone is 2468-A-DS and this Control Hub is 9999-A-RC, an **illegal combination** to be flagged by the FTC team or the Field Inspector. - Item 12 shows the Standard Wi-Fi **network name**, or Access Point (AP), that is broadcast by the Control Hub. The check-mark indicates the AP has a correctly formatted FTC name. This does **not** check that the DS and RC names match (team number). In fact, this DS phone is 2468-A-DS and this Control Hub is 9999-A-RC, an **illegal combination** to be flagged by the FTC team or the Field Inspector.
- Item 14 appears only on DS displays of RC Self Inspect. Here is the check for matching versions of DS app and RC app; in this case both apps are version 7.0. Any "Point mismatch" (e.g. 7.0 vs. 7.0.1) is allowed under [updated FTC rules](https://ftc-qa.firstinspires.org/qa/176). - Item 14 appears only on DS displays of RC Self Inspect. Here is the check for matching versions of DS app and RC app; in this case both apps are version 7.0. Any "Point mismatch" (e.g. 7.0 vs. 7.0.1) is allowed under updated FTC rules (was Q&A #176 for 2021-2022 season).
- Item 15 verifies that an RC device does **not** have an DS app installed. This would be quite a mistake for a Control Hub, lacking an onboard screen. - Item 15 verifies that an RC device does **not** have an DS app installed. This would be quite a mistake for a Control Hub, lacking an onboard screen.
[<p align="right"><i>Return to Top</i>](#introduction)<p> [<p align="right"><i>Return to Top</i>](#introduction)<p>
@ -208,7 +208,7 @@ For a Control Hub, the Self Inspect categories displayed on Driver Hub are the s
<p align="center">[[/images/FTC-Self-Inspect/tRC-6b.png]] <p align="center">[[/images/FTC-Self-Inspect/tRC-6b.png]]
<br><i><b>RC Self Inspect 6, appearing on Driver Hub paired to Control Hub</b></i><p> <br><i><b>RC Self Inspect 6, appearing on Driver Hub paired to Control Hub</b></i><p>
The only reporting difference here is the 'mismatch' between the Driver Hub's DS app version of 7.0.1 and the Control Hub's 7.0. This is likely to happen since Driver Hubs are typically auto-updated, in this case to a DS version intended only for old Android 6 phones. Such a "Point mismatch" is allowed under [updated FTC rules](https://ftc-qa.firstinspires.org/qa/176).<p> The only reporting difference here is the 'mismatch' between the Driver Hub's DS app version of 7.0.1 and the Control Hub's 7.0. This is likely to happen since Driver Hubs are typically auto-updated, in this case to a DS version intended only for old Android 6 phones. Such a "Point mismatch" is allowed under updated FTC rules (was Q&A #176 for 2021-2022 season).<p>
<br> <br>
<p align="center">[[/images/FTC-Self-Inspect/tRC-6a.png]] <p align="center">[[/images/FTC-Self-Inspect/tRC-6a.png]]

@ -1,18 +1,23 @@
## Introduction ## Introduction
<!--
converted to RTD, published 11/21/22
http://ftc-docs.firstinspires.org/programming_resources/imu/imu.html
-->
In September 2022, REV Robotics began shipping [**Control Hubs**](https://www.revrobotics.com/rev-31-1595/) with a different internal Inertial Measurement Unit (IMU). An IMU can measure many aspects of device motion; here we focus on **rotation**. In September 2022, REV Robotics began shipping [**Control Hubs**](https://www.revrobotics.com/rev-31-1595/) with a different internal Inertial Measurement Unit (IMU). An IMU can measure many aspects of device motion; here we focus on **rotation**.
The new IMU chip is designated [BHI260AP](https://www.bosch-sensortec.com/products/smart-sensors/bhi260ap/), replacing the old Hub's IMU chip [BNO055](https://www.bosch-sensortec.com/products/smart-sensors/bno055/). Both are from Bosch Sensortec. The new IMU chip is designated [BHI260AP](https://www.bosch-sensortec.com/products/smart-sensors/bhi260ap/), replacing the old Hub's IMU chip [BNO055](https://www.bosch-sensortec.com/products/smart-sensors/bno055/). Both are from Bosch Sensortec.
The new [**FTC SDK**](https://github.com/FIRST-Tech-Challenge/FtcRobotController/releases) **version 8.1** provides a **universal interface** that supports both the BHI260AP and BNO055 IMU. This basic tutorial introduces some new features: The new [**FTC SDK**](https://github.com/FIRST-Tech-Challenge/FtcRobotController/releases) **version 8.1.1** provides a **universal interface** that supports both the BHI260AP and BNO055 IMU. This basic tutorial introduces some new features:
- robot configuration allows selection of IMU type - robot configuration allows selection of IMU type
- universal classes and methods supporting both IMU types - universal classes and methods supporting both IMU types
- three ways to specify Hub mounting orientation on the robot - three ways to specify Hub mounting orientation on the robot
Teams using the new Control Hub IMU must use the new SDK 8.1. Teams using the new Control Hub IMU must use the new SDK 8.1.1.
Updating to SDK 8.1 is **optional** for POWERPLAY, if you are not planning to use the new Control Hub IMU. Updating to SDK 8.1 or 8.1.1 is **optional** for POWERPLAY, if you are not planning to use the new Control Hub IMU.
However **all teams** are encouraged to begin using the universal IMU classes and methods for **new** Blocks and Java code. And, migrating **existing code** would allow you to switch easily (and perhaps urgently) to a new Control Hub during the season. However **all teams** are encouraged to begin using the universal IMU classes and methods for **new** Blocks and Java code. And, migrating **existing code** would allow you to switch easily (and perhaps urgently) to a new Control Hub during the season.
@ -27,7 +32,7 @@ Each Hub's IMU type is listed there, as of FTC SDK 8.0.
_Reminder: REV Expansion Hubs purchased after December 2021 have no internal IMU._ _Reminder: REV Expansion Hubs purchased after December 2021 have no internal IMU._
Do you have existing OpModes using the old IMU? Your code can run unchanged, using Hubs with the BNO055. The new SDK 8.1 fully supports legacy Blocks and Java code using classes and methods for the BNO055 IMU. Do you have existing OpModes using the old IMU? Your code can run unchanged, using Hubs with the BNO055. The new SDK 8.1.1 fully supports legacy Blocks and Java code using classes and methods for the BNO055 IMU.
The SDK 8.1 README provides more technical background: The SDK 8.1 README provides more technical background:
>Unlike the old `BNO055IMU` interface, which only worked correctly when the REV Hub was mounted flat on your robot, the `IMU` interface allows you to specify the orientation of the REV Hub on your robot. It will account for this, and give you your orientation in a Robot Coordinate System, instead of a special coordinate system for the REV Hub. As a result, your pitch and yaw will be 0 when your *robot* is level, instead of when the REV Hub is level, which will result in much more reliable orientation angle values for most mounting orientations. >Unlike the old `BNO055IMU` interface, which only worked correctly when the REV Hub was mounted flat on your robot, the `IMU` interface allows you to specify the orientation of the REV Hub on your robot. It will account for this, and give you your orientation in a Robot Coordinate System, instead of a special coordinate system for the REV Hub. As a result, your pitch and yaw will be 0 when your *robot* is level, instead of when the REV Hub is level, which will result in much more reliable orientation angle values for most mounting orientations.
@ -36,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. >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 ## Potential Usage
@ -66,7 +74,7 @@ The FTC SDK can also provide values for **angular velocity**, which is the rate
Let's get started! 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 ## Configure IMU
@ -86,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._ _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 ## Axes Definition
@ -110,15 +118,15 @@ _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. 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 ## Physical Hub Mounting
Under SDK 8.1, you can specify the **physical orientation** of the Hub on the robot. This allows you to receive IMU angle values expressed in **robot axes**, useful for understanding and managing the robot's movement. Under SDK 8.1.1, you can specify the **physical orientation** of the Hub on the robot. This allows you to receive IMU angle values expressed in **robot axes**, useful for understanding and managing the robot's movement.
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**. 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** **Orthogonal Mounting**
@ -138,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**. 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** **Non-Orthogonal Mounting**
@ -150,13 +158,13 @@ Here are some scenarios, ranging from simple to complex:
- The Hub is tilted at multiple angles, with or without in-plane rotation. - The Hub is tilted at multiple angles, with or without in-plane rotation.
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. For any Non-Orthogonal scenarios, SDK 8.1.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 ## IMU Programming
SDK 8.1 offers new classes and methods that apply **universally** to both types of IMU. Once configured, the IMU type will not affect your programming. SDK 8.1.1 offers new classes and methods that apply **universally** to both types of IMU. Once configured, the IMU type will not affect your programming.
The programming steps include: The programming steps include:
- set the IMU **parameters**, or use defaults - set the IMU **parameters**, or use defaults
@ -169,7 +177,7 @@ The programming steps include:
The following sections cover these topics in order. 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 ## Parameters
@ -179,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]] [[/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 ### Parameters for Method 1, Orthogonal
@ -204,7 +212,7 @@ IMU.Parameters myIMUparameters;
myIMUparameters = new IMU.Parameters(new RevHubOrientationOnRobot(RevHubOrientationOnRobot.LogoFacingDirection.UP, RevHubOrientationOnRobot.UsbFacingDirection.FORWARD)); 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 ### Hub Axes for Setting Parameters
@ -224,9 +232,9 @@ In this starting orientation, the Hub axes are **aligned with** the Robot Coordi
Hub rotations also follow the right-hand rule. 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._ _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.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 ### Parameters for Method 2, Angles
@ -268,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._ _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 ### Parameters for Method 3, Quaternion
@ -290,7 +298,7 @@ Or, consider a single rotation of +30 degrees about the X axis. Namely, the Hub
new RevHubOrientationOnRobot(new Quaternion(0.9659258f, 0.258819f, 0.0f, 0.0f, 0)); new RevHubOrientationOnRobot(new Quaternion(0.9659258f, 0.258819f, 0.0f, 0.0f, 0));
``` ```
This basic tutorial does not cover the math behind Quaternions, an advanced substitute for Euler Angles described above. The SDK 8.1 IMU interface supports the use of Quaternions, for FTC teams familiar with them. This basic tutorial does not cover the math behind Quaternions, an advanced substitute for Euler Angles described above. The SDK 8.1.1 IMU interface supports the use of Quaternions, for FTC teams familiar with them.
<!-- <!--
This text does not appear at the published wiki. This text does not appear at the published wiki.
@ -299,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**. >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 ## Initialize IMU
@ -325,7 +333,7 @@ imu.initialize(new IMU.Parameters(new RevHubOrientationOnRobot(RevHubOrientation
imu.initialize(myIMUparameters); 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 ## Read IMU Angles - Basic
@ -369,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._ _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 ## Read IMU Angles - Flexible
@ -402,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._ _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 ## Read Angular Velocity
@ -434,7 +442,7 @@ myRobotAngularVelocity.yRotationRate
These are also shown in each of the Java **Sample OpModes** listed in a section below. 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 ## Reset Heading
@ -489,11 +497,11 @@ 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 ## Sample OpModes
The SDK 8.1 contains Sample OpModes demonstrating the above. In FTC Blocks, a simple example is called `SensorIMU`. The SDK 8.1.1 contains Sample OpModes demonstrating the above. In FTC Blocks, a simple example is called `SensorIMU`.
<p align="center">[[/images/Universal-IMU-Interface/350-Blocks-IMU-Sample.png]] <p align="center">[[/images/Universal-IMU-Interface/350-Blocks-IMU-Sample.png]]
@ -501,41 +509,39 @@ Here's an [**image**](https://raw.githubusercontent.com/wiki/FIRST-Tech-Challeng
In Java, three Sample OpModes demonstrate the new universal IMU interface: 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|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Universal-IMU-Interface]]</i><p>
[<p align="right"><i>Return to Top</i>](#introduction)<p>
## SDK Resources ## SDK Resources
Advanced programmers are invited to browse the FTC [**Javadocs documentation**](https://javadoc.io/doc/org.firstinspires.ftc) (API), particularly in: Advanced programmers are invited to browse the FTC [**Javadocs documentation**](https://javadoc.io/doc/org.firstinspires.ftc) (API), particularly in:
- `com.qualcomm.robotcore.hardware` - [`com.qualcomm.robotcore.hardware`](https://javadoc.io/static/org.firstinspires.ftc/RobotCore/8.1.1/index.html?com/qualcomm/robotcore/hardware/package-summary.html)
- `org.firstinspires.ftc.robotcore.external.navigation` - [`org.firstinspires.ftc.robotcore.external.navigation`](https://javadoc.io/static/org.firstinspires.ftc/RobotCore/8.1.1/index.html?org/firstinspires/ftc/robotcore/external/navigation/package-summary.html)
The new universal IMU classes for SDK 8.1 are: The new universal IMU features for SDK 8.1.1 are:
- `IMU` - [`IMU`](https://javadoc.io/static/org.firstinspires.ftc/RobotCore/8.1.1/index.html?com/qualcomm/robotcore/hardware/IMU.html) (interface)
- `ImuOrientationOnRobot` - [`ImuOrientationOnRobot`](https://javadoc.io/static/org.firstinspires.ftc/RobotCore/8.1.1/index.html?com/qualcomm/robotcore/hardware/IMU.Parameters.html) (parameter field)
- `YawPitchRollAngles` - [`YawPitchRollAngles`](https://javadoc.io/static/org.firstinspires.ftc/RobotCore/8.1.1/index.html?org/firstinspires/ftc/robotcore/external/navigation/YawPitchRollAngles.html) (class)
- `RevHubOrientationOnRobot` - [`RevHubOrientationOnRobot`](https://javadoc.io/static/org.firstinspires.ftc/Hardware/8.1.1/index.html?com/qualcomm/hardware/rev/RevHubOrientationOnRobot.html) (class)
The Javadocs describe other IMU methods and variables not covered in this basic tutorial. 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 ## Summary
The FTC SDK 8.1 provides a universal interface that supports both the BHI260AP and BNO055 IMU. This basic tutorial introduced some new features: The FTC SDK 8.1.1 provides a universal interface that supports both the BHI260AP and BNO055 IMU. This basic tutorial introduced some new features:
- robot configuration allows selection of IMU type - robot configuration allows selection of IMU type
@ -543,13 +549,13 @@ The FTC SDK 8.1 provides a universal interface that supports both the BHI260AP a
- new Blocks and Java methods to read data from both IMU types - new Blocks and Java methods to read data from both IMU types
Teams using the new Control Hub IMU must use the new SDK 8.1. Teams using the new Control Hub IMU must use the new SDK 8.1.1.
Updating to SDK 8.1 is **optional** for POWERPLAY, if you are not planning to use the new Control Hub IMU. Updating to SDK 8.1 or 8.1.1 is **optional** for POWERPLAY, if you are not planning to use the new Control Hub IMU.
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. 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> <i>Questions, comments and corrections to westsiderobotics@verizon.net</i>

@ -36,6 +36,7 @@
* [Everyday Objects](Using-a-TensorFlow-Pretrained-Model-to-Detect-Everyday-Objects) * [Everyday Objects](Using-a-TensorFlow-Pretrained-Model-to-Detect-Everyday-Objects)
* [FTC Single Hub - **<i>new!</i>**](FTC-Single-Hub) * [FTC Single Hub - **<i>new!</i>**](FTC-Single-Hub)
* [Datalogging - **<i>new!</i>**](Datalogging) * [Datalogging - **<i>new!</i>**](Datalogging)
* [Universal IMU Interface - **<i>new!</i>**](Universal-IMU-Interface)
* [Webcam Controls](FTC-Webcam-Controls) * [Webcam Controls](FTC-Webcam-Controls)
* [Custom Blocks (myBlocks)](Custom-FTC-Blocks-(myBlocks)) * [Custom Blocks (myBlocks)](Custom-FTC-Blocks-(myBlocks))
* [External Libraries](External-Libraries-in-OnBot-Java-and-Blocks) * [External Libraries](External-Libraries-in-OnBot-Java-and-Blocks)