mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 15:43:33 +08:00
Merge branch 'offboard_fix'
This commit is contained in:
@@ -538,12 +538,16 @@ MavlinkReceiver::handle_message_set_position_target_local_ned(mavlink_message_t
|
|||||||
offboard_control_sp.ignore &= ~(1 << i);
|
offboard_control_sp.ignore &= ~(1 << i);
|
||||||
offboard_control_sp.ignore |= (set_position_target_local_ned.type_mask & (1 << i));
|
offboard_control_sp.ignore |= (set_position_target_local_ned.type_mask & (1 << i));
|
||||||
}
|
}
|
||||||
|
|
||||||
offboard_control_sp.ignore &= ~(1 << OFB_IGN_BIT_YAW);
|
offboard_control_sp.ignore &= ~(1 << OFB_IGN_BIT_YAW);
|
||||||
offboard_control_sp.ignore |= (set_position_target_local_ned.type_mask & (1 << 10)) <<
|
if (set_position_target_local_ned.type_mask & (1 << 10)) {
|
||||||
(OFB_IGN_BIT_YAW - 10);
|
offboard_control_sp.ignore |= (1 << OFB_IGN_BIT_YAW);
|
||||||
|
}
|
||||||
|
|
||||||
offboard_control_sp.ignore &= ~(1 << OFB_IGN_BIT_YAWRATE);
|
offboard_control_sp.ignore &= ~(1 << OFB_IGN_BIT_YAWRATE);
|
||||||
offboard_control_sp.ignore |= (set_position_target_local_ned.type_mask & (1 << 11)) <<
|
if (set_position_target_local_ned.type_mask & (1 << 11)) {
|
||||||
(OFB_IGN_BIT_YAWRATE - 11);
|
offboard_control_sp.ignore |= (1 << OFB_IGN_BIT_YAWRATE);
|
||||||
|
}
|
||||||
|
|
||||||
offboard_control_sp.timestamp = hrt_absolute_time();
|
offboard_control_sp.timestamp = hrt_absolute_time();
|
||||||
|
|
||||||
|
|||||||
@@ -205,6 +205,7 @@ private:
|
|||||||
|
|
||||||
bool _can_loiter_at_sp; /**< flags if current position SP can be used to loiter */
|
bool _can_loiter_at_sp; /**< flags if current position SP can be used to loiter */
|
||||||
bool _pos_sp_triplet_updated; /**< flags if position SP triplet needs to be published */
|
bool _pos_sp_triplet_updated; /**< flags if position SP triplet needs to be published */
|
||||||
|
bool _pos_sp_triplet_published_invalid_once; /**< flags if position SP triplet has been published once to UORB */
|
||||||
|
|
||||||
control::BlockParamFloat _param_loiter_radius; /**< loiter radius for fixedwing */
|
control::BlockParamFloat _param_loiter_radius; /**< loiter radius for fixedwing */
|
||||||
control::BlockParamFloat _param_acceptance_radius; /**< acceptance for takeoff */
|
control::BlockParamFloat _param_acceptance_radius; /**< acceptance for takeoff */
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ Navigator::Navigator() :
|
|||||||
_gpsFailure(this, "GPSF"),
|
_gpsFailure(this, "GPSF"),
|
||||||
_can_loiter_at_sp(false),
|
_can_loiter_at_sp(false),
|
||||||
_pos_sp_triplet_updated(false),
|
_pos_sp_triplet_updated(false),
|
||||||
|
_pos_sp_triplet_published_invalid_once(false),
|
||||||
_param_loiter_radius(this, "LOITER_RAD"),
|
_param_loiter_radius(this, "LOITER_RAD"),
|
||||||
_param_acceptance_radius(this, "ACC_RAD"),
|
_param_acceptance_radius(this, "ACC_RAD"),
|
||||||
_param_datalinkloss_obc(this, "DLL_OBC"),
|
_param_datalinkloss_obc(this, "DLL_OBC"),
|
||||||
@@ -469,9 +470,8 @@ Navigator::task_main()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* if nothing is running, set position setpoint triplet invalid once */
|
/* if nothing is running, set position setpoint triplet invalid once */
|
||||||
static bool published_once = false;
|
if (_navigation_mode == nullptr && !_pos_sp_triplet_published_invalid_once) {
|
||||||
if (_navigation_mode == nullptr && !published_once) {
|
_pos_sp_triplet_published_invalid_once = true;
|
||||||
published_once = true;
|
|
||||||
_pos_sp_triplet.previous.valid = false;
|
_pos_sp_triplet.previous.valid = false;
|
||||||
_pos_sp_triplet.current.valid = false;
|
_pos_sp_triplet.current.valid = false;
|
||||||
_pos_sp_triplet.next.valid = false;
|
_pos_sp_triplet.next.valid = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user