aboutsummaryrefslogtreecommitdiff
path: root/src/modules/uORB
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2014-08-25 09:19:36 +0200
committerThomas Gubler <thomasgubler@gmail.com>2014-08-25 09:19:36 +0200
commit55fde23233de3d311d6c8d0b2cd368e45af3caac (patch)
treead4bc02208c430cd67dd5407406ae515d4686dbe /src/modules/uORB
parent9be755ec61733142c86e3713b7845ea9ad929538 (diff)
downloadpx4-firmware-55fde23233de3d311d6c8d0b2cd368e45af3caac.tar.gz
px4-firmware-55fde23233de3d311d6c8d0b2cd368e45af3caac.tar.bz2
px4-firmware-55fde23233de3d311d6c8d0b2cd368e45af3caac.zip
support new yaw and yawrate fields in mavlnk position_target message
Diffstat (limited to 'src/modules/uORB')
-rw-r--r--src/modules/uORB/topics/offboard_control_setpoint.h22
-rw-r--r--src/modules/uORB/topics/position_setpoint_triplet.h2
2 files changed, 23 insertions, 1 deletions
diff --git a/src/modules/uORB/topics/offboard_control_setpoint.h b/src/modules/uORB/topics/offboard_control_setpoint.h
index 6e37896af..72a28e501 100644
--- a/src/modules/uORB/topics/offboard_control_setpoint.h
+++ b/src/modules/uORB/topics/offboard_control_setpoint.h
@@ -86,7 +86,9 @@ enum {OFB_IGN_BIT_POS_X,
OFB_IGN_BIT_BODYRATE_Y,
OFB_IGN_BIT_BODYRATE_Z,
OFB_IGN_BIT_ATT,
- OFB_IGN_BIT_THRUST
+ OFB_IGN_BIT_THRUST,
+ OFB_IGN_BIT_YAW,
+ OFB_IGN_BIT_YAWRATE,
};
/**
@@ -105,6 +107,10 @@ struct offboard_control_setpoint_s {
float attitude[4]; /**< attitude of vehicle (quaternion) */
float attitude_rate[3]; /**< body angular rates (x, y, z) */
float thrust; /**< thrust */
+ float yaw; /**< yaw: this is the yaw from the position_target message
+ (not from the full attitude_target message) */
+ float yaw_rate; /**< yaw rate: this is the yaw from the position_target message
+ (not from the full attitude_target message) */
uint16_t ignore; /**< if field i is set to true, the value should be ignored, see definition at top of file
for mapping */
@@ -249,6 +255,20 @@ inline bool offboard_control_sp_ignore_thrust(const struct offboard_control_setp
return (bool)(offboard_control_sp.ignore & (1 << OFB_IGN_BIT_THRUST));
}
+/**
+ * Returns true if the yaw setpoint should be ignored
+ */
+inline bool offboard_control_sp_ignore_yaw(const struct offboard_control_setpoint_s &offboard_control_sp) {
+ return (bool)(offboard_control_sp.ignore & (1 << OFB_IGN_BIT_YAW));
+}
+
+/**
+ * Returns true if the yaw rate setpoint should be ignored
+ */
+inline bool offboard_control_sp_ignore_yawrate(const struct offboard_control_setpoint_s &offboard_control_sp) {
+ return (bool)(offboard_control_sp.ignore & (1 << OFB_IGN_BIT_YAWRATE));
+}
+
/* register this as object request broker structure */
ORB_DECLARE(offboard_control_setpoint);
diff --git a/src/modules/uORB/topics/position_setpoint_triplet.h b/src/modules/uORB/topics/position_setpoint_triplet.h
index 3ea3f671e..cb2262534 100644
--- a/src/modules/uORB/topics/position_setpoint_triplet.h
+++ b/src/modules/uORB/topics/position_setpoint_triplet.h
@@ -79,7 +79,9 @@ struct position_setpoint_s
double lon; /**< longitude, in deg */
float alt; /**< altitude AMSL, in m */
float yaw; /**< yaw (only for multirotors), in rad [-PI..PI), NaN = hold current yaw */
+ bool yaw_valid; /**< true if yaw setpoint valid */
float yawspeed; /**< yawspeed (only for multirotors, in rad/s) */
+ bool yawspeed_valid; /**< true if yawspeed setpoint valid */
float loiter_radius; /**< loiter radius (only for fixed wing), in m */
int8_t loiter_direction; /**< loiter direction: 1 = CW, -1 = CCW */
float pitch_min; /**< minimal pitch angle for fixed wing takeoff waypoints */