Function imu_get_euler

Source
pub unsafe extern "C" fn imu_get_euler(port: u8) -> euler_s_t
Expand description

Get the Euler angles representing the Inertial Sensor’s orientation

This function uses the following values of errno when an error state is reached: ENXIO - The given value is not within the range of V5 ports (1-21). ENODEV - The port cannot be configured as an Inertial Sensor EAGAIN - The sensor is still calibrating

\param port The V5 Inertial Sensor port number from 1-21 \return The Euler angles representing the sensor’s orientation. If the operation failed, all the structure’s members are filled with PROS_ERR_F and errno is set.

\b Example \code #define IMU_PORT 1

void opcontrol() { while (true) { euler_s_t eu = imu_get_euler(IMU_PORT); printf(“IMU euler angles: {pitch: %f, roll: %f, yaw: %f}\n”, eu.pitch, eu.roll, eu.yaw); delay(20); } } \endcode