Skip to content

Commit 2705197

Browse files
committed
Rescaled accelerations to m/s^2 from g's
1 parent 0a20571 commit 2705197

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

include/iarc7_fc_comms/MspCommands.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ namespace FcComms
216216

217217
uint8_t response[FcCommsMspConf::kMspMaxDataLength];
218218

219-
// Returns the IMU values
219+
// Returns the IMU values in m/s^2
220220
void getAcc(double (&acc_values)[3])
221221
{
222222
// Jetson runs in little endian mode and the FC
@@ -238,7 +238,7 @@ namespace FcComms
238238
// We are also using a hacked up version of cleanflight that does not
239239
// apply this scaling factor using a bitshift hack before sending so
240240
// we need to do it here.
241-
acc_values[i] = static_cast<double>(*temp)/(512.0 * 8.0);
241+
acc_values[i] = 9.8 * static_cast<double>(*temp)/(512.0 * 8.0);
242242
}
243243
}
244244
};

include/iarc7_fc_comms/MspFcComms.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ namespace FcComms
7272
FcCommsReturns __attribute__((warn_unused_result))
7373
printRawRC();
7474

75+
// Get the acceleration in m/s^2
7576
FcCommsReturns __attribute__((warn_unused_result))
7677
getAccelerations(double (&accelerations)[3]);
7778

0 commit comments

Comments
 (0)