aboutsummaryrefslogtreecommitdiff
path: root/src/modules/sensors/sensor_params.c
diff options
context:
space:
mode:
authorAnton Babushkin <anton.babushkin@me.com>2014-05-16 12:12:43 +0200
committerAnton Babushkin <anton.babushkin@me.com>2014-05-16 12:12:43 +0200
commit8c4b35cc23ddf1eaef0dfc90f8fbb066b5b845af (patch)
treeea6f3edcfa749eb5b0dcc7f307b0fa490d579617 /src/modules/sensors/sensor_params.c
parentd2553bfd2930eb02664d564559fa361b80c63f61 (diff)
parentf892a7278a4f452c12678fe00c6ff28c2354d548 (diff)
downloadpx4-firmware-8c4b35cc23ddf1eaef0dfc90f8fbb066b5b845af.tar.gz
px4-firmware-8c4b35cc23ddf1eaef0dfc90f8fbb066b5b845af.tar.bz2
px4-firmware-8c4b35cc23ddf1eaef0dfc90f8fbb066b5b845af.zip
Merge branch 'master' into offboard2
Diffstat (limited to 'src/modules/sensors/sensor_params.c')
-rw-r--r--src/modules/sensors/sensor_params.c142
1 files changed, 113 insertions, 29 deletions
diff --git a/src/modules/sensors/sensor_params.c b/src/modules/sensors/sensor_params.c
index 0823f9e70..ae0ff625b 100644
--- a/src/modules/sensors/sensor_params.c
+++ b/src/modules/sensors/sensor_params.c
@@ -488,6 +488,15 @@ PARAM_DEFINE_INT32(BAT_V_SCALE_IO, 10000);
* @group Battery Calibration
*/
PARAM_DEFINE_FLOAT(BAT_V_SCALING, 0.0082f);
+#elif CONFIG_ARCH_BOARD_AEROCORE
+/**
+ * Scaling factor for battery voltage sensor on AeroCore.
+ *
+ * For R70 = 133K, R71 = 10K --> scale = 1.8 * 143 / (4096*10) = 0.0063
+ *
+ * @group Battery Calibration
+ */
+PARAM_DEFINE_FLOAT(BAT_V_SCALING, 0.0063f);
#else
/**
* Scaling factor for battery voltage sensor on FMU v1.
@@ -536,6 +545,20 @@ PARAM_DEFINE_INT32(RC_MAP_ROLL, 1);
PARAM_DEFINE_INT32(RC_MAP_PITCH, 2);
/**
+ * Failsafe channel mapping.
+ *
+ * The RC mapping index indicates which channel is used for failsafe
+ * If 0, whichever channel is mapped to throttle is used
+ * otherwise the value indicates the specific rc channel to use
+ *
+ * @min 0
+ * @max 18
+ *
+ *
+ */
+PARAM_DEFINE_INT32(RC_MAP_FAILSAFE, 0); //Default to throttle function
+
+/**
* Throttle control channel mapping.
*
* The channel index (starting from 1 for channel 1) indicates
@@ -585,22 +608,30 @@ PARAM_DEFINE_INT32(RC_MAP_MODE_SW, 0);
PARAM_DEFINE_INT32(RC_MAP_RETURN_SW, 0);
/**
- * Assist switch channel mapping.
+ * Posctl switch channel mapping.
+ *
+ * @min 0
+ * @max 18
+ * @group Radio Calibration
+ */
+PARAM_DEFINE_INT32(RC_MAP_POSCTL_SW, 0);
+
+/**
+ * Loiter switch channel mapping.
*
* @min 0
* @max 18
* @group Radio Calibration
*/
-PARAM_DEFINE_INT32(RC_MAP_ASSIST_SW, 0);
+PARAM_DEFINE_INT32(RC_MAP_LOITER_SW, 0);
/**
- * Mission switch channel mapping.
+ * Offboard switch channel mapping.
*
* @min 0
* @max 18
* @group Radio Calibration
*/
-PARAM_DEFINE_INT32(RC_MAP_MISSIO_SW, 0);
PARAM_DEFINE_INT32(RC_MAP_OFFB_SW, 0);
/**
@@ -647,53 +678,106 @@ PARAM_DEFINE_INT32(RC_MAP_AUX3, 0);
/**
- * Roll scaling factor
+ * Failsafe channel PWM threshold.
*
+ * @min 800
+ * @max 2200
* @group Radio Calibration
*/
-PARAM_DEFINE_FLOAT(RC_SCALE_ROLL, 0.6f);
+PARAM_DEFINE_INT32(RC_FAILS_THR, 0);
/**
- * Pitch scaling factor
+ * Threshold for selecting assist mode
+ *
+ * min:-1
+ * max:+1
+ *
+ * 0-1 indicate where in the full channel range the threshold sits
+ * 0 : min
+ * 1 : max
+ * sign indicates polarity of comparison
+ * positive : true when channel>th
+ * negative : true when channel<th
*
- * @group Radio Calibration
*/
-PARAM_DEFINE_FLOAT(RC_SCALE_PITCH, 0.6f);
+PARAM_DEFINE_FLOAT(RC_ASSIST_TH, 0.25f);
/**
- * Yaw scaling factor
+ * Threshold for selecting auto mode
+ *
+ * min:-1
+ * max:+1
+ *
+ * 0-1 indicate where in the full channel range the threshold sits
+ * 0 : min
+ * 1 : max
+ * sign indicates polarity of comparison
+ * positive : true when channel>th
+ * negative : true when channel<th
*
- * @group Radio Calibration
*/
-PARAM_DEFINE_FLOAT(RC_SCALE_YAW, 2.0f);
+PARAM_DEFINE_FLOAT(RC_AUTO_TH, 0.75f);
+/**
+ * Threshold for selecting posctl mode
+ *
+ * min:-1
+ * max:+1
+ *
+ * 0-1 indicate where in the full channel range the threshold sits
+ * 0 : min
+ * 1 : max
+ * sign indicates polarity of comparison
+ * positive : true when channel>th
+ * negative : true when channel<th
+ *
+ */
+PARAM_DEFINE_FLOAT(RC_POSCTL_TH, 0.5f);
/**
- * Failsafe channel mapping.
+ * Threshold for selecting return to launch mode
+ *
+ * min:-1
+ * max:+1
+ *
+ * 0-1 indicate where in the full channel range the threshold sits
+ * 0 : min
+ * 1 : max
+ * sign indicates polarity of comparison
+ * positive : true when channel>th
+ * negative : true when channel<th
*
- * @min 0
- * @max 18
- * @group Radio Calibration
*/
-PARAM_DEFINE_INT32(RC_FS_CH, 0);
+PARAM_DEFINE_FLOAT(RC_RETURN_TH, 0.5f);
/**
- * Failsafe channel mode.
+ * Threshold for selecting loiter mode
*
- * 0 = too low means signal loss,
- * 1 = too high means signal loss
+ * min:-1
+ * max:+1
+ *
+ * 0-1 indicate where in the full channel range the threshold sits
+ * 0 : min
+ * 1 : max
+ * sign indicates polarity of comparison
+ * positive : true when channel>th
+ * negative : true when channel<th
*
- * @min 0
- * @max 1
- * @group Radio Calibration
*/
-PARAM_DEFINE_INT32(RC_FS_MODE, 0);
+PARAM_DEFINE_FLOAT(RC_LOITER_TH, 0.5f);
/**
- * Failsafe channel PWM threshold.
+ * Threshold for selecting offboard mode
+ *
+ * min:-1
+ * max:+1
+ *
+ * 0-1 indicate where in the full channel range the threshold sits
+ * 0 : min
+ * 1 : max
+ * sign indicates polarity of comparison
+ * positive : true when channel>th
+ * negative : true when channel<th
*
- * @min 0
- * @max 1
- * @group Radio Calibration
*/
-PARAM_DEFINE_FLOAT(RC_FS_THR, 800);
+PARAM_DEFINE_FLOAT(RC_OFFB_TH, 0.5f);