Modified a spelling mistake
This commit is contained in:
parent
6a39aae98f
commit
672b9da6f9
|
@ -55,9 +55,9 @@ void Motions::SetMotionCallback(motion_callback_t callback) {
|
||||||
imu->temperature = seg.temperature / 326.8f + 25;
|
imu->temperature = seg.temperature / 326.8f + 25;
|
||||||
|
|
||||||
if (imu->flag == 1) {
|
if (imu->flag == 1) {
|
||||||
imu->accel[0] = seg.aceel_or_gyro[0] * 1.f * accel_range / 0x10000;
|
imu->accel[0] = seg.accel_or_gyro[0] * 1.f * accel_range / 0x10000;
|
||||||
imu->accel[1] = seg.aceel_or_gyro[1] * 1.f * accel_range / 0x10000;
|
imu->accel[1] = seg.accel_or_gyro[1] * 1.f * accel_range / 0x10000;
|
||||||
imu->accel[2] = seg.aceel_or_gyro[2] * 1.f * accel_range / 0x10000;
|
imu->accel[2] = seg.accel_or_gyro[2] * 1.f * accel_range / 0x10000;
|
||||||
imu->gyro[0] = 0;
|
imu->gyro[0] = 0;
|
||||||
imu->gyro[1] = 0;
|
imu->gyro[1] = 0;
|
||||||
imu->gyro[2] = 0;
|
imu->gyro[2] = 0;
|
||||||
|
@ -65,9 +65,9 @@ void Motions::SetMotionCallback(motion_callback_t callback) {
|
||||||
imu->accel[0] = 0;
|
imu->accel[0] = 0;
|
||||||
imu->accel[1] = 0;
|
imu->accel[1] = 0;
|
||||||
imu->accel[2] = 0;
|
imu->accel[2] = 0;
|
||||||
imu->gyro[0] = seg.aceel_or_gyro[0] * 1.f * gyro_range / 0x10000;
|
imu->gyro[0] = seg.accel_or_gyro[0] * 1.f * gyro_range / 0x10000;
|
||||||
imu->gyro[1] = seg.aceel_or_gyro[1] * 1.f * gyro_range / 0x10000;
|
imu->gyro[1] = seg.accel_or_gyro[1] * 1.f * gyro_range / 0x10000;
|
||||||
imu->gyro[2] = seg.aceel_or_gyro[2] * 1.f * gyro_range / 0x10000;
|
imu->gyro[2] = seg.accel_or_gyro[2] * 1.f * gyro_range / 0x10000;
|
||||||
} else {
|
} else {
|
||||||
imu->Reset();
|
imu->Reset();
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,7 +208,7 @@ struct ImuSegment {
|
||||||
std::uint64_t timestamp;
|
std::uint64_t timestamp;
|
||||||
std::uint8_t flag;
|
std::uint8_t flag;
|
||||||
std::int16_t temperature;
|
std::int16_t temperature;
|
||||||
std::int16_t aceel_or_gyro[3];
|
std::int16_t accel_or_gyro[3];
|
||||||
|
|
||||||
ImuSegment() = default;
|
ImuSegment() = default;
|
||||||
explicit ImuSegment(std::uint8_t *data) {
|
explicit ImuSegment(std::uint8_t *data) {
|
||||||
|
@ -228,9 +228,9 @@ struct ImuSegment {
|
||||||
timestamp = (static_cast<std::uint64_t>(timestamp_h) << 32) | timestamp_l;
|
timestamp = (static_cast<std::uint64_t>(timestamp_h) << 32) | timestamp_l;
|
||||||
flag = *(data + 12);
|
flag = *(data + 12);
|
||||||
temperature = (*(data + 13) << 8) | *(data + 14);
|
temperature = (*(data + 13) << 8) | *(data + 14);
|
||||||
aceel_or_gyro[0] = (*(data + 15) << 8) | *(data + 16);
|
accel_or_gyro[0] = (*(data + 15) << 8) | *(data + 16);
|
||||||
aceel_or_gyro[1] = (*(data + 17) << 8) | *(data + 18);
|
accel_or_gyro[1] = (*(data + 17) << 8) | *(data + 18);
|
||||||
aceel_or_gyro[2] = (*(data + 19) << 8) | *(data + 20);
|
accel_or_gyro[2] = (*(data + 19) << 8) | *(data + 20);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user