Merge pull request #2353 from andre-nguyen/offb_NaN_fix

fix NaN yaw breaking attitude setpoints when going back into posctl from offboard
This commit is contained in:
Lorenz Meier
2015-06-13 00:01:24 +02:00
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -680,7 +680,7 @@ MavlinkReceiver::handle_message_set_position_target_local_ned(mavlink_message_t
}
/* set the yaw sp value */
if (!offboard_control_mode.ignore_attitude) {
if (!offboard_control_mode.ignore_attitude && !isnan(set_position_target_local_ned.yaw)) {
pos_sp_triplet.current.yaw_valid = true;
pos_sp_triplet.current.yaw = set_position_target_local_ned.yaw;
@@ -689,7 +689,7 @@ MavlinkReceiver::handle_message_set_position_target_local_ned(mavlink_message_t
}
/* set the yawrate sp value */
if (!offboard_control_mode.ignore_bodyrate) {
if (!offboard_control_mode.ignore_bodyrate && !isnan(set_position_target_local_ned.yaw)) {
pos_sp_triplet.current.yawspeed_valid = true;
pos_sp_triplet.current.yawspeed = set_position_target_local_ned.yaw_rate;
+2 -2
View File
@@ -273,7 +273,7 @@ void Mavlink::handle_msg_set_position_target_local_ned(const mavlink_message_t *
}
/* set the yaw sp value */
if (!offboard_control_mode.ignore_attitude) {
if (!offboard_control_mode.ignore_attitude && !isnan(set_position_target_local_ned.yaw)) {
pos_sp_triplet.current.yaw_valid = true;
pos_sp_triplet.current.yaw = set_position_target_local_ned.yaw;
@@ -282,7 +282,7 @@ void Mavlink::handle_msg_set_position_target_local_ned(const mavlink_message_t *
}
/* set the yawrate sp value */
if (!offboard_control_mode.ignore_bodyrate) {
if (!offboard_control_mode.ignore_bodyrate && !isnan(set_position_target_local_ned.yaw)) {
pos_sp_triplet.current.yawspeed_valid = true;
pos_sp_triplet.current.yawspeed = set_position_target_local_ned.yaw_rate;