aboutsummaryrefslogtreecommitdiff
path: root/src/modules/bottle_drop
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2014-08-31 15:55:03 +0200
committerLorenz Meier <lm@inf.ethz.ch>2014-08-31 15:55:03 +0200
commit056693df44561a8d1e19501585aa5f680b7aa086 (patch)
tree953d7b9abbb22a7333f5468faa03c53b900eb731 /src/modules/bottle_drop
parent592f6f2bcb632d6bb86c63b1055560d0c8b526b2 (diff)
downloadpx4-firmware-056693df44561a8d1e19501585aa5f680b7aa086.tar.gz
px4-firmware-056693df44561a8d1e19501585aa5f680b7aa086.tar.bz2
px4-firmware-056693df44561a8d1e19501585aa5f680b7aa086.zip
Add drag coefficients to adjust bottle drop to other objects to ease testing
Diffstat (limited to 'src/modules/bottle_drop')
-rw-r--r--src/modules/bottle_drop/bottle_drop.cpp10
-rw-r--r--src/modules/bottle_drop/bottle_drop_params.c89
2 files changed, 95 insertions, 4 deletions
diff --git a/src/modules/bottle_drop/bottle_drop.cpp b/src/modules/bottle_drop/bottle_drop.cpp
index 3eec5a879..30ee782cc 100644
--- a/src/modules/bottle_drop/bottle_drop.cpp
+++ b/src/modules/bottle_drop/bottle_drop.cpp
@@ -392,11 +392,17 @@ BottleDrop::task_main()
param_t param_gproperties = param_find("BD_GPROPERTIES");
param_t param_turn_radius = param_find("BD_TURNRADIUS");
param_t param_precision = param_find("BD_PRECISION");
+ param_t param_cd = param_find("BD_OBJ_CD");
+ param_t param_mass = param_find("BD_OBJ_MASS");
+ param_t param_surface = param_find("BD_OBJ_SURFACE");
param_get(param_precision, &precision);
param_get(param_turn_radius, &turn_radius);
param_get(param_gproperties, &z_0);
+ param_get(param_cd, &cd);
+ param_get(param_mass, &M);
+ param_get(param_surface, &A);
int vehicle_global_position_sub = orb_subscribe(ORB_ID(vehicle_global_position));
@@ -419,10 +425,10 @@ BottleDrop::task_main()
struct wind_estimate_s wind;
- /* wakeup source(s) */
+ // wakeup source(s)
struct pollfd fds[1];
- /* Setup of loop */
+ // Setup of loop
fds[0].fd = _command_sub;
fds[0].events = POLLIN;
diff --git a/src/modules/bottle_drop/bottle_drop_params.c b/src/modules/bottle_drop/bottle_drop_params.c
index 22e9baf8a..e5d35bf0a 100644
--- a/src/modules/bottle_drop/bottle_drop_params.c
+++ b/src/modules/bottle_drop/bottle_drop_params.c
@@ -41,6 +41,91 @@
#include <nuttx/config.h>
#include <systemlib/param/param.h>
+/**
+ * Ground drag property
+ *
+ * This parameter encodes the ground drag coefficient and the corresponding
+ * decrease in wind speed from the plane altitude to ground altitude.
+ *
+ * @unit unknown
+ * @min 0.001
+ * @max 0.1
+ * @group Payload drop
+ */
PARAM_DEFINE_FLOAT(BD_GPROPERTIES, 0.03f);
-PARAM_DEFINE_FLOAT(BD_TURNRADIUS, 90.0f);
-PARAM_DEFINE_FLOAT(BD_PRECISION, 10.0f);
+
+/**
+ * Plane turn radius
+ *
+ * The planes known minimal turn radius - use a higher value
+ * to make the plane maneuver more distant from the actual drop
+ * position. This is to ensure the wings are level during the drop.
+ *
+ * @unit meter
+ * @min 30.0
+ * @max 500.0
+ * @group Payload drop
+ */
+PARAM_DEFINE_FLOAT(BD_TURNRADIUS, 120.0f);
+
+/**
+ * Drop precision
+ *
+ * If the system is closer than this distance on passing over the
+ * drop position, it will release the payload. This is a safeguard
+ * to prevent a drop out of the required accuracy.
+ *
+ * @unit meter
+ * @min 1.0
+ * @max 80.0
+ * @group Payload drop
+ */
+PARAM_DEFINE_FLOAT(BD_PRECISION, 30.0f);
+
+/**
+ * Payload drag coefficient of the dropped object
+ *
+ * The drag coefficient (cd) is the typical drag
+ * constant for air. It is in general object specific,
+ * but the closest primitive shape to the actual object
+ * should give good results:
+ * http://en.wikipedia.org/wiki/Drag_coefficient
+ *
+ * @unit meter
+ * @min 1.0
+ * @max 80.0
+ * @group Payload drop
+ */
+PARAM_DEFINE_FLOAT(BD_OBJ_CD, 0.86f);
+
+/**
+ * Payload mass
+ *
+ * A typical small toy ball:
+ * 0.025 kg
+ *
+ * OBC water bottle:
+ * 0.6 kg
+ *
+ * @unit kilogram
+ * @min 0.001
+ * @max 5.0
+ * @group Payload drop
+ */
+PARAM_DEFINE_FLOAT(BD_OBJ_MASS, 0.6f);
+
+/**
+ * Payload front surface area
+ *
+ * A typical small toy ball:
+ * (0.045 * 0.045) / 4.0 * pi = 0.001590 m^2
+ *
+ * OBC water bottle:
+ * (0.063 * 0.063) / 4.0 * pi = 0.003117 m^2
+ *
+ * @unit m^2
+ * @min 0.001
+ * @max 0.5
+ * @group Payload drop
+ */
+PARAM_DEFINE_FLOAT(BD_OBJ_SURFACE, 0.00311724531f);