Skip to content

Commit

Permalink
fixed accel scaling in motors tab (#3547)
Browse files Browse the repository at this point in the history
fixed accel scaling
  • Loading branch information
flaviopinzarrone authored Dec 4, 2023
1 parent 00d1ed2 commit 22a2eee
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/js/msp/MSPHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,11 @@ MspHelper.prototype.process_data = function(dataHandler) {
break;

case MSPCodes.MSP_RAW_IMU:
// 512 for mpu6050, 256 for mma
// currently we are unable to differentiate between the sensor types, so we are goign with 512
FC.SENSOR_DATA.accelerometer[0] = data.read16() / 512;
FC.SENSOR_DATA.accelerometer[1] = data.read16() / 512;
FC.SENSOR_DATA.accelerometer[2] = data.read16() / 512;
// 2048 for mpu6050, 1024 for mma (times 4 since we don't scale in the firmware)
// currently we are unable to differentiate between the sensor types, so we are going with 2048
FC.SENSOR_DATA.accelerometer[0] = data.read16() / 2048;
FC.SENSOR_DATA.accelerometer[1] = data.read16() / 2048;
FC.SENSOR_DATA.accelerometer[2] = data.read16() / 2048;

// properly scaled
FC.SENSOR_DATA.gyroscope[0] = data.read16() * (4 / 16.4);
Expand Down

0 comments on commit 22a2eee

Please sign in to comment.