aboutsummaryrefslogtreecommitdiff
path: root/apps/uORB/topics/actuator_controls.h
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2012-08-05 13:43:16 -0700
committerpx4dev <px4@purgatory.org>2012-08-05 14:13:34 -0700
commit9804447a66391a1e216068cbd849e0011c851f7a (patch)
tree290375f61f5fcab6a837f39e45e65cb5fbce3308 /apps/uORB/topics/actuator_controls.h
parent9804776a0c8bd67d4a533e3302f1a598c35b868b (diff)
downloadpx4-firmware-9804447a66391a1e216068cbd849e0011c851f7a.tar.gz
px4-firmware-9804447a66391a1e216068cbd849e0011c851f7a.tar.bz2
px4-firmware-9804447a66391a1e216068cbd849e0011c851f7a.zip
More work on the mixer architecture.
Solve the multiple publishers issue with 'control groups', one group per controller. Mixer inputs now specify both group and control offset within the group. Avoid using %f when loading/saving mixers; use scaled integers instead.
Diffstat (limited to 'apps/uORB/topics/actuator_controls.h')
-rw-r--r--apps/uORB/topics/actuator_controls.h27
1 files changed, 19 insertions, 8 deletions
diff --git a/apps/uORB/topics/actuator_controls.h b/apps/uORB/topics/actuator_controls.h
index 5cdaf0a4e..2b7d7de5d 100644
--- a/apps/uORB/topics/actuator_controls.h
+++ b/apps/uORB/topics/actuator_controls.h
@@ -32,11 +32,15 @@
****************************************************************************/
/**
- * @file Actuator control topic - mixer inputs.
+ * @file actuator_controls.h
*
- * Values published to this topic are the outputs of the vehicle control
+ * Actuator control topics - mixer inputs.
+ *
+ * Values published to these topics are the outputs of the vehicle control
* system, and are expected to be mixed and used to drive the actuators
* (servos, speed controls, etc.) that operate the vehicle.
+ *
+ * Each topic can be published by a single controller
*/
#ifndef TOPIC_ACTUATOR_CONTROLS_H
@@ -45,17 +49,24 @@
#include <stdint.h>
#include "../uORB.h"
-#define NUM_ACTUATOR_CONTROLS 16
+#define NUM_ACTUATOR_CONTROLS 8
+#define NUM_ACTUATOR_CONTROL_GROUPS 4 /**< for sanity checking */
-struct actuator_controls_s
-{
+struct actuator_controls_s {
float control[NUM_ACTUATOR_CONTROLS];
};
-ORB_DECLARE(actuator_controls);
+/* actuator control sets; this list can be expanded as more controllers emerge */
+ORB_DECLARE(actuator_controls_0);
+ORB_DECLARE(actuator_controls_1);
+ORB_DECLARE(actuator_controls_2);
+ORB_DECLARE(actuator_controls_3);
+
+/* control sets with pre-defined applications */
+#define ORB_ID_VEHICLE_ATTITUDE_CONTROLS ORB_ID(actuator_controls_0)
-struct actuator_armed_s
-{
+/** global 'actuator output is live' control. */
+struct actuator_armed_s {
bool armed;
};