mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-18 05:57:34 +08:00
fix merge errors in offboard.cpp
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user