diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-07-08 13:47:53 +0200 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-07-08 13:47:53 +0200 |
commit | cf4a11c7e7cfa524992a96d41d885da38ab95ebd (patch) | |
tree | b2dae2217b3f952868730d242415ac16f41c725f /src | |
parent | 19017f100101dbf638bb91f7a520296f979ebb32 (diff) | |
download | px4-firmware-cf4a11c7e7cfa524992a96d41d885da38ab95ebd.tar.gz px4-firmware-cf4a11c7e7cfa524992a96d41d885da38ab95ebd.tar.bz2 px4-firmware-cf4a11c7e7cfa524992a96d41d885da38ab95ebd.zip |
fix merge errors in offboard.cpp
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/navigator/offboard.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/modules/navigator/offboard.cpp b/src/modules/navigator/offboard.cpp index 71a14c029..fc4d183cd 100644 --- a/src/modules/navigator/offboard.cpp +++ b/src/modules/navigator/offboard.cpp @@ -67,17 +67,22 @@ Offboard::~Offboard() { } -bool -Offboard::on_active(struct position_setpoint_triplet_s *pos_sp_triplet) +void +Offboard::on_activation() +{ +} + +void +Offboard::on_active() { + struct position_setpoint_triplet_s *pos_sp_triplet = _navigator->get_position_setpoint_triplet(); + bool updated; orb_check(_navigator->get_offboard_control_sp_sub(), &updated); if (updated) { update_offboard_control_setpoint(); } - bool changed = false; - /* copy offboard setpoints to the corresponding topics */ if (_offboard_control_sp.mode == OFFBOARD_CONTROL_MODE_DIRECT_LOCAL_NED) { /* We accept position control only if none of the directions is ignored (as pos_sp_triplet does not @@ -97,8 +102,7 @@ Offboard::on_active(struct position_setpoint_triplet_s *pos_sp_triplet) pos_sp_triplet->current.valid = true; pos_sp_triplet->current.position_valid = true; - changed = true; - + _navigator->set_position_setpoint_triplet_updated(); } /* We accept velocity control only if none of the directions is ignored (as pos_sp_triplet does not * support deactivation of individual directions) */ @@ -117,13 +121,12 @@ Offboard::on_active(struct position_setpoint_triplet_s *pos_sp_triplet) pos_sp_triplet->current.valid = true; pos_sp_triplet->current.velocity_valid = true; - changed = true; + _navigator->set_position_setpoint_triplet_updated(); } //XXX: map acceleration setpoint once supported in setpoint triplet } - return changed; } void |