aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2013-09-18 11:49:22 +0200
committerLorenz Meier <lm@inf.ethz.ch>2013-09-18 11:49:22 +0200
commit6624c8f1c40d08d594fd2f180bff1088eaff82d4 (patch)
tree438b152aa7de3a6e8c0cca70d4c48e032950a85d
parenta4ecdc95828484370e0e399d2f3c8b0e28f5c585 (diff)
downloadpx4-firmware-6624c8f1c40d08d594fd2f180bff1088eaff82d4.tar.gz
px4-firmware-6624c8f1c40d08d594fd2f180bff1088eaff82d4.tar.bz2
px4-firmware-6624c8f1c40d08d594fd2f180bff1088eaff82d4.zip
Hotfix: Make voltage scaling for standalone default
-rw-r--r--ROMFS/px4fmu_common/init.d/08_ardrone1
-rw-r--r--ROMFS/px4fmu_common/init.d/09_ardrone_flow1
-rw-r--r--src/modules/sensors/sensor_params.c3
3 files changed, 4 insertions, 1 deletions
diff --git a/ROMFS/px4fmu_common/init.d/08_ardrone b/ROMFS/px4fmu_common/init.d/08_ardrone
index 7dbbb8284..f6f09ac22 100644
--- a/ROMFS/px4fmu_common/init.d/08_ardrone
+++ b/ROMFS/px4fmu_common/init.d/08_ardrone
@@ -30,6 +30,7 @@ fi
# MAV_TYPE 2 = quadrotor
#
param set MAV_TYPE 2
+param set BAT_V_SCALING 0.008381
#
# Start MAVLink
diff --git a/ROMFS/px4fmu_common/init.d/09_ardrone_flow b/ROMFS/px4fmu_common/init.d/09_ardrone_flow
index 6333aae56..9b739f245 100644
--- a/ROMFS/px4fmu_common/init.d/09_ardrone_flow
+++ b/ROMFS/px4fmu_common/init.d/09_ardrone_flow
@@ -30,6 +30,7 @@ fi
# MAV_TYPE 2 = quadrotor
#
param set MAV_TYPE 2
+param set BAT_V_SCALING 0.008381
#
# Start MAVLink and MAVLink Onboard (PX4FLOW Sensor)
diff --git a/src/modules/sensors/sensor_params.c b/src/modules/sensors/sensor_params.c
index 950af2eba..ed4fcdd46 100644
--- a/src/modules/sensors/sensor_params.c
+++ b/src/modules/sensors/sensor_params.c
@@ -174,7 +174,8 @@ PARAM_DEFINE_FLOAT(BAT_V_SCALING, 0.0082f);
/* default is conversion factor for the PX4IO / PX4IOAR board, the factor for PX4FMU standalone is different */
/* PX4IOAR: 0.00838095238 */
/* FMU standalone: 1/(10 / (47+10)) * (3.3 / 4095) = 0.00459340659 */
-PARAM_DEFINE_FLOAT(BAT_V_SCALING, (3.3f * 52.0f / 5.0f / 4095.0f));
+/* FMU with PX4IOAR: (3.3f * 52.0f / 5.0f / 4095.0f) */
+PARAM_DEFINE_FLOAT(BAT_V_SCALING, 0.00459340659f);
#endif
PARAM_DEFINE_INT32(RC_MAP_ROLL, 1);