pros::v5::Imu class

Base classes

class Device

Public static functions

static Imu get_imu()
Gets a IMU sensor that is plugged in to the brain.
static std::vector<Imu> get_all_devices()
Gets all IMU sensors.

Constructors, destructors, conversion operators

Imu(const std::uint8_t port)
Creates an Imu object for the given port.
Imu(const Device& device)

Public functions

std::int32_t reset(bool blocking = false) const virtual
Calibrate IMU.
std::int32_t set_data_rate(std::uint32_t rate) const virtual
Set the Inertial Sensor's refresh interval in milliseconds.
double get_rotation() const virtual
Get the total number of degrees the Inertial Sensor has spun about the z-axis.
double get_heading() const virtual
Get the Inertial Sensor's heading relative to the initial direction of its x-axis.
pros::quaternion_s_t get_quaternion() const virtual
Get a quaternion representing the Inertial Sensor's orientation.
pros::euler_s_t get_euler() const virtual
Get the Euler angles representing the Inertial Sensor's orientation.
double get_pitch() const virtual
Get the Inertial Sensor's pitch angle bounded by (-180,180)
double get_roll() const virtual
Get the Inertial Sensor's roll angle bounded by (-180,180)
double get_yaw() const virtual
Get the Inertial Sensor's yaw angle bounded by (-180,180)
pros::imu_gyro_s_t get_gyro_rate() const virtual
Get the Inertial Sensor's raw gyroscope values.
std::int32_t tare_rotation() const virtual
Resets the current reading of the Inertial Sensor's rotation to zero.
std::int32_t tare_heading() const virtual
Resets the current reading of the Inertial Sensor's heading to zero.
std::int32_t tare_pitch() const virtual
Resets the current reading of the Inertial Sensor's pitch to zero.
std::int32_t tare_yaw() const virtual
Resets the current reading of the Inertial Sensor's yaw to zero.
std::int32_t tare_roll() const virtual
Resets the current reading of the Inertial Sensor's roll to zero.
std::int32_t tare() const virtual
Resets all 5 values of the Inertial Sensor to 0.
std::int32_t tare_euler() const virtual
Reset all 3 euler values of the Inertial Sensor to 0.
std::int32_t set_heading(const double target) const virtual
Sets the current reading of the Inertial Sensor's heading to target value Target will default to 360 if above 360 and default to 0 if below 0.
std::int32_t set_rotation(const double target) const virtual
Sets the current reading of the Inertial Sensor's rotation to target value.
std::int32_t set_yaw(const double target) const virtual
Sets the current reading of the Inertial Sensor's yaw to target value Will default to +/- 180 if target exceeds +/- 180.
std::int32_t set_pitch(const double target) const virtual
Sets the current reading of the Inertial Sensor's pitch to target value.
std::int32_t set_roll(const double target) const virtual
Sets the current reading of the Inertial Sensor's roll to target value Will default to +/- 180 if target exceeds +/- 180.
std::int32_t set_euler(const pros::euler_s_t target) const virtual
Sets the current reading of the Inertial Sensor's euler values to target euler values.
pros::imu_accel_s_t get_accel() const virtual
Get the Inertial Sensor's raw accelerometer values.
pros::ImuStatus get_status() const virtual
Get the Inertial Sensor's status.
bool is_calibrating() const virtual
Check whether the IMU is calibrating.
imu_orientation_e_t get_physical_orientation() const virtual
Returns the physical orientation of the IMU.

Friends

std::ostream& operator<<(std::ostream& os, const pros::Imu& imu)
This is the overload for the << operator for printing to streams.