aboutsummaryrefslogtreecommitdiff
path: root/src/modules/navigator/offboard.cpp
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2014-07-08 13:47:53 +0200
committerThomas Gubler <thomasgubler@gmail.com>2014-07-08 13:47:53 +0200
commitcf4a11c7e7cfa524992a96d41d885da38ab95ebd (patch)
treeb2dae2217b3f952868730d242415ac16f41c725f /src/modules/navigator/offboard.cpp
parent19017f100101dbf638bb91f7a520296f979ebb32 (diff)
downloadpx4-firmware-cf4a11c7e7cfa524992a96d41d885da38ab95ebd.tar.gz
px4-firmware-cf4a11c7e7cfa524992a96d41d885da38ab95ebd.tar.bz2
px4-firmware-cf4a11c7e7cfa524992a96d41d885da38ab95ebd.zip
fix merge errors in offboard.cpp
Diffstat (limited to 'src/modules/navigator/offboard.cpp')
-rw-r--r--src/modules/navigator/offboard.cpp19
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