Skip to content

Canandgyro

Message/wire format spec, version 2024-offseason.

The device spec for Redux products will not change in a backwards-incompatible fashion in-season, from the first official release for a given year until after the FIRST Championship.

PropertyValue
FRC CAN Device Type0x4
DBC FileLink
Inherits from[CanandDevice]

The DBC files assumes a device id of 0. For more information on the CAN device type, see CanandDevice

Message summary:

API IndexMessageDescription
0x1fYAW_OUTPUTYaw angle frame
0x1eANGULAR_POSITION_OUTPUTAngular position quaternion frame
0x1dANGULAR_VELOCITY_OUTPUTAngular velocity frame
0x1cACCELERATION_OUTPUTAcceleration frame
0x1bCALIBRATETrigger Calibration
0x1aCALIBRATION_STATUSCalibration Status
0xbENUMERATEDevice enumerate response
0x7PARTY_MODEParty mode
0x6STATUSStatus frame
0x5CLEAR_STICKY_FAULTSClear device sticky faults
0x4REPORT_SETTINGSetting value report from device
0x3SET_SETTINGUpdate setting on device
0x2SETTING_COMMANDSetting control command

Periodic frame with the Canandgyro’s yaw value at full 32-bit float precision in radians.

Properties

PropertyValue
API Index0x1f
Message length6 bytes
Transmission directionDevice -> robot
Frame period settingYAW_FRAME_PERIOD
Default frame period10 milliseconds

Signals

Signal nameSignal typeOptionalDescription
yawyawYaw value

Periodic frame with an angular position quaternion. The quaternion is normalized and all values are scaled between -1.0 to 1.0 inclusive.

Properties

PropertyValue
API Index0x1e
Message length8 bytes
Transmission directionDevice -> robot

Signals

Signal nameSignal typeOptionalDescription
wquat16Quaternion w term
xquat16Quaternion x term
yquat16Quaternion y term
zquat16Quaternion z term

Manually triggers gyro calibration. This takes about 5 seconds.

Properties

PropertyValue
API Index0x1b
Message length8 bytes
Transmission directionRobot -> device

Signals

Signal nameSignal typeOptionalDescription
calibration_typeCALIBRATION_TYPECalibration type
reservedpad56_tReserved

Updates the yaw (Z-axis) rotation with the new sent angular position.

$$ \left[\cos\left(\frac{1}{2}(\phi_n - \phi)\right) + \sin\left(\frac{1}{2}(\phi_n - \phi)\right)\hat{\mathbf{k}}\right] \cdot \left(w + x \hat{\mathbf{i}} + y\hat{\mathbf{j}} + z\hat{\mathbf{k}}\right) $$

PropertyValue
Setting index0xfb
Typeyaw
Default valuen/a
Readable
Writable
Resets on factory default

Saved temperature associated with the saved x/y/z-axis zero-motion angular velocity offset.

PropertyValue
Setting index0xf2
Typerfloat32
Default value25
Readable
Writable
Resets on factory default

Yaw frame data. The absolute (single-turn) yaw is broadcast in radians between -pi inclusive and pi exclusive. Multiturn yaw can be computed by taking $\text{yaw} + \text{wraparound} * 2\pi$.

NameTypeDefault valueDescription
yawfloat32_t0.0Yaw angle
wraparoundint16_t0Wraparound counter
Flag indexFlag nameDefault valueDescription
0power_cycle0Device first boots.
1can_id_conflict0CAN id conflict.
2can_general_error0CAN general error.
3out_of_temperature_range0Out of temperature range (0-70°C).
4hardware_fault0Hardware fault.
5calibrating0Device is currently calibrating.
6angular_velocity_saturation0Saturation of angular velocity.
7acceleration_saturation0Saturation of acceleration.
Enum indexVariant nameDescription
0x0NORMALNormal calibration routine
0x1SAVE_ZROSave ZRO at calibration complete
0x2TEMP_CAL_0Temperature calibrate slot 0
0x3TEMP_CAL_1Temperature calibrate slot 1