fixed yaw/yawrate bit masking. fixed navigator overriding offboard setpoint

This commit is contained in:
Steven Blass 2014-11-17 19:58:18 -05:00
parent 97a1410ec9
commit 5f6d03099e
2 changed files with 6 additions and 5 deletions

View File

@ -540,10 +540,10 @@ MavlinkReceiver::handle_message_set_position_target_local_ned(mavlink_message_t
}
offboard_control_sp.ignore &= ~(1 << OFB_IGN_BIT_YAW);
offboard_control_sp.ignore |= (set_position_target_local_ned.type_mask & (1 << 10)) <<
OFB_IGN_BIT_YAW;
(OFB_IGN_BIT_YAW - 10);
offboard_control_sp.ignore &= ~(1 << OFB_IGN_BIT_YAWRATE);
offboard_control_sp.ignore |= (set_position_target_local_ned.type_mask & (1 << 11)) <<
OFB_IGN_BIT_YAWRATE;
(OFB_IGN_BIT_YAWRATE - 11);
offboard_control_sp.timestamp = hrt_absolute_time();

View File

@ -468,9 +468,10 @@ Navigator::task_main()
_navigation_mode_array[i]->run(_navigation_mode == _navigation_mode_array[i]);
}
/* if nothing is running, set position setpoint triplet invalid */
if (_navigation_mode == nullptr) {
// TODO publish empty sp only once
/* if nothing is running, set position setpoint triplet invalid once */
static bool published_once = false;
if (_navigation_mode == nullptr && !published_once) {
published_once = true;
_pos_sp_triplet.previous.valid = false;
_pos_sp_triplet.current.valid = false;
_pos_sp_triplet.next.valid = false;