diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-08-12 16:27:02 +0200 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-08-12 16:46:12 +0200 |
commit | 85eed22150e4a24098554992a6d77bce6f1ddf31 (patch) | |
tree | b90fd10a5ffe4ca43335012a01d1747a460b9a33 /src/modules/uORB | |
parent | a2e6b2bca0d967cb29eb855f6aebd7fcc933bfc1 (diff) | |
download | px4-firmware-85eed22150e4a24098554992a6d77bce6f1ddf31.tar.gz px4-firmware-85eed22150e4a24098554992a6d77bce6f1ddf31.tar.bz2 px4-firmware-85eed22150e4a24098554992a6d77bce6f1ddf31.zip |
offboard sp: correctly map acceleration/force in combined setpoint to setpoint triple
Conflicts:
src/modules/uORB/topics/position_setpoint_triplet.h
Diffstat (limited to 'src/modules/uORB')
-rw-r--r-- | src/modules/uORB/topics/offboard_control_setpoint.h | 21 | ||||
-rw-r--r-- | src/modules/uORB/topics/position_setpoint_triplet.h | 5 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/modules/uORB/topics/offboard_control_setpoint.h b/src/modules/uORB/topics/offboard_control_setpoint.h index 4f45ac14f..47c89f708 100644 --- a/src/modules/uORB/topics/offboard_control_setpoint.h +++ b/src/modules/uORB/topics/offboard_control_setpoint.h @@ -142,14 +142,35 @@ inline bool offboard_control_sp_ignore_velocity_all(const struct offboard_contro return false; } +/** + * Returns true if the acceleration setpoint at index should be ignored + */ inline bool offboard_control_sp_ignore_acceleration(const struct offboard_control_setpoint_s &offboard_control_sp, int index) { return (bool)(offboard_control_sp.ignore & (1 << (6 + index))); } +/** + * Returns true if all acceleration setpoints should be ignored + */ +inline bool offboard_control_sp_ignore_acceleration_all(const struct offboard_control_setpoint_s &offboard_control_sp) { + for (int i = 0; i < 3; i++) { + if (offboard_control_sp_ignore_acceleration(offboard_control_sp, i)) { + return true; + } + } + return false; +} + +/** + * Returns true if the bodyrate setpoint at index should be ignored + */ inline bool offboard_control_sp_ignore_bodyrates(const struct offboard_control_setpoint_s &offboard_control_sp, int index) { return (bool)(offboard_control_sp.ignore & (1 << (9 + index))); } +/** + * Returns true if the attitude setpoint should be ignored + */ inline bool offboard_control_sp_ignore_attitude(const struct offboard_control_setpoint_s &offboard_control_sp) { return (bool)(offboard_control_sp.ignore & (1 << 10)); } diff --git a/src/modules/uORB/topics/position_setpoint_triplet.h b/src/modules/uORB/topics/position_setpoint_triplet.h index ec2131abd..3ea3f671e 100644 --- a/src/modules/uORB/topics/position_setpoint_triplet.h +++ b/src/modules/uORB/topics/position_setpoint_triplet.h @@ -83,6 +83,11 @@ struct position_setpoint_s 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 */ + float a_x; //**< acceleration x setpoint */ + float a_y; //**< acceleration y setpoint */ + float a_z; //**< acceleration z setpoint */ + bool acceleration_valid; //*< true if acceleration setpoint is valid/should be used */ + bool acceleration_is_force; //*< interprete acceleration as force */ }; /** |