|
VEX V5 C++ API
|
Use the inertial class to control the inertial sensor. More...
Inherits vex::device, and vex::guido.
Classes | |
| class | accel |
| class to hold inertial sensor acceleration data More... | |
| class | attitude |
| class to hold inertial angle data More... | |
| class | gyro |
| recover inertial sensor temperature in deg C More... | |
| class | matrix |
| class to hold an inertial matrix More... | |
| class | quaternion |
| class to hold inertial quaternion data More... | |
Public Member Functions | |
| inertial (int32_t index) | |
| Creates a new inertial object on the port specified. More... | |
| ~inertial () | |
| bool | installed () |
| int32_t | value () |
| void | startCalibration (int32_t value=0) |
| Starts recalibration of the inertial sensor. More... | |
| bool | isCalibrating (void) |
| Returns true while the inertial sensor is performing a requested recalibration, changing to false once recalibration has completed. More... | |
| void | resetHeading () |
| reset the heading of the sensor to 0 More... | |
| void | resetRotation () |
| reset the rotation angle of the sensor to 0 More... | |
| void | setHeading (double value, rotationUnits units) |
| set the inertial sensor heading to a new value More... | |
| void | setRotation (double value, rotationUnits units) |
| set the inertial sensor rotation to angle More... | |
| double | angle (rotationUnits units=rotationUnits::deg) |
| Gets the angle (yaw angle) of the inertial sensor. More... | |
| double | roll (rotationUnits units=rotationUnits::deg) |
| Gets the roll angle of the inertial sensor. More... | |
| double | pitch (rotationUnits units=rotationUnits::deg) |
| Gets the pitch angle of the inertial sensor. More... | |
| double | yaw (rotationUnits units=rotationUnits::deg) |
| Gets the yaw angle of the inertial sensor. More... | |
| double | orientation (orientationType axis, rotationUnits units) |
| Gets an orientation angle of the inertial sensor. More... | |
| double | heading (rotationUnits units=rotationUnits::deg) |
| Gets the heading (yaw angle as 0-360 deg) of the inertial sensor. More... | |
| double | rotation (rotationUnits units=rotationUnits::deg) |
| Gets the absolute angle (yaw angle without limits) of the inertial sensor. More... | |
| void | orientation (quaternion &q) |
| Gets the inertial sensor orientation in quaternion form. More... | |
| quaternion | orientation () |
| Gets the inertial sensor orientation in quaternion form. More... | |
| void | orientation (attitude &a) |
| Gets the inertial sensor orientation in rotation form. More... | |
| double | gyroRate (axisType axis, velocityUnits units) |
| Gets the inertial sensor raw gyro data in specified units. More... | |
| double | acceleration (axisType axis) |
| Gets the inertial sensor raw acceleration data in G. More... | |
Public Member Functions inherited from vex::device | |
| device () | |
| device (int32_t index) | |
| ~device () | |
| V5_DeviceType | type () |
| void | init (int32_t index) |
Public Member Functions inherited from vex::guido | |
| virtual | ~guido () |
Protected Member Functions | |
| int32_t | status () |
| recover inertial sensor raw status More... | |
| inertial::gyro | gyroRate () |
| Gets the inertial sensor raw gyro data in dps. More... | |
| inertial::accel | acceleration () |
| Gets the inertial sensor raw acceleration data in G. More... | |
| void | setOrientation (inertial::orientationMode orientation) |
| Set the physical orientation of the inertial sensor, this will cause recalibration. More... | |
| void | setAccelerometerRange (uint8_t value) |
| void | setCollisionThreshold (double value) |
Additional Inherited Members | |
Protected Attributes inherited from vex::device | |
| int32_t | _index |
Use the inertial class to control the inertial sensor.
|
strongprotected |
| vex::inertial::inertial | ( | int32_t | index | ) |
Creates a new inertial object on the port specified.
| index | The port index for this inertial. The index is zero-based. |
| vex::inertial::~inertial | ( | ) |
|
virtual |
Reimplemented from vex::device.
|
virtual |
Reimplemented from vex::device.
| void vex::inertial::startCalibration | ( | int32_t | value = 0 | ) |
Starts recalibration of the inertial sensor.
|
virtual |
Returns true while the inertial sensor is performing a requested recalibration, changing to false once recalibration has completed.
Implements vex::guido.
| void vex::inertial::resetHeading | ( | ) |
reset the heading of the sensor to 0
| void vex::inertial::resetRotation | ( | ) |
reset the rotation angle of the sensor to 0
|
virtual |
set the inertial sensor heading to a new value
| value | The new heading for the inertial sensor |
| units | The rotation unit for the angle |
Implements vex::guido.
|
virtual |
set the inertial sensor rotation to angle
| value | The new absolute rotation angle for the inertial sensor |
| units | The rotation unit for the angle |
Implements vex::guido.
| double vex::inertial::angle | ( | rotationUnits | units = rotationUnits::deg | ) |
Gets the angle (yaw angle) of the inertial sensor.
| units | The measurement unit for the inertial device. |
| double vex::inertial::roll | ( | rotationUnits | units = rotationUnits::deg | ) |
Gets the roll angle of the inertial sensor.
| units | The measurement unit for the inertial sensor. |
| double vex::inertial::pitch | ( | rotationUnits | units = rotationUnits::deg | ) |
Gets the pitch angle of the inertial sensor.
| units | The measurement unit for the inertial device. |
| double vex::inertial::yaw | ( | rotationUnits | units = rotationUnits::deg | ) |
Gets the yaw angle of the inertial sensor.
| units | The measurement unit for the inertial sensor. |
| double vex::inertial::orientation | ( | orientationType | axis, |
| rotationUnits | units | ||
| ) |
Gets an orientation angle of the inertial sensor.
| axis | The orientation axis to recover, roll, pitch or yaw. |
| units | The measurement unit for the inertial sensor. |
|
virtual |
Gets the heading (yaw angle as 0-360 deg) of the inertial sensor.
| units | The measurement unit for the inertial sensor. |
Implements vex::guido.
|
virtual |
Gets the absolute angle (yaw angle without limits) of the inertial sensor.
| units | The measurement unit for the inertial sensor. |
Implements vex::guido.
| void vex::inertial::orientation | ( | quaternion & | q | ) |
Gets the inertial sensor orientation in quaternion form.
| q | reference to instance of a inertial::quaternion class |
| quaternion vex::inertial::orientation | ( | ) |
Gets the inertial sensor orientation in quaternion form.
| void vex::inertial::orientation | ( | attitude & | a | ) |
Gets the inertial sensor orientation in rotation form.
| a | reference to instance of a inertial::attitude class |
| double vex::inertial::gyroRate | ( | axisType | axis, |
| velocityUnits | units | ||
| ) |
Gets the inertial sensor raw gyro data in specified units.
| axis | the inertial sensor axis to use |
| units | The units return value |
| double vex::inertial::acceleration | ( | axisType | axis | ) |
Gets the inertial sensor raw acceleration data in G.
| axis | the inertial sensor axis to use |
|
protected |
recover inertial sensor raw status
|
protected |
Gets the inertial sensor raw gyro data in dps.
|
protected |
Gets the inertial sensor raw acceleration data in G.
|
protected |
Set the physical orientation of the inertial sensor, this will cause recalibration.
| orientation | the inertial sensor orientation |
|
protected |
|
protected |
1.8.15