Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛Fixed Imu::is_calibrating function for PROS 3 #626 #628

Merged
merged 5 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/pros/imu.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ namespace c {
#endif

typedef enum imu_status_e {
E_IMU_STATUS_CALIBRATING = 0x01,
E_IMU_STATUS_READY = 0, // IMU is connected but not currently calibrating
E_IMU_STATUS_CALIBRATING = 19, // IMU is calibrating
E_IMU_STATUS_ERROR = 0xFF, // NOTE: used for returning an error from the get_status function, not that the IMU is
// necessarily in an error state
} imu_status_e_t;
Expand Down
2 changes: 1 addition & 1 deletion src/devices/vdml_imu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pros::c::imu_status_e_t Imu::get_status() const {
}

bool Imu::is_calibrating() const {
return get_status() & pros::c::E_IMU_STATUS_CALIBRATING;
return get_status() == pros::c::E_IMU_STATUS_CALIBRATING;
}

std::int32_t Imu::tare_heading() const {
Expand Down