mc_pos_control: fixed yaw setpoint in AUTO

This commit is contained in:
Anton Babushkin 2014-02-01 10:29:51 +01:00
parent bb8be966fc
commit 8a20395159
1 changed files with 7 additions and 1 deletions

View File

@ -688,10 +688,16 @@ MulticopterPositionControl::task_main()
_reset_lat_lon_sp = true;
_reset_alt_sp = true;
/* update position setpoint */
_lat_sp = _pos_sp_triplet.current.lat;
_lon_sp = _pos_sp_triplet.current.lon;
_alt_sp = _pos_sp_triplet.current.alt;
/* update yaw setpoint if needed */
if (isfinite(_pos_sp_triplet.current.yaw)) {
_att_sp.yaw_body = _pos_sp_triplet.current.yaw;
}
} else {
/* no waypoint, loiter, reset position setpoint if needed */
reset_lat_lon_sp();
@ -711,7 +717,7 @@ MulticopterPositionControl::task_main()
_att_sp.roll_body = 0.0f;
_att_sp.pitch_body = 0.0f;
_att_sp.yaw_body = 0.0f;
_att_sp.yaw_body = _att.yaw;
_att_sp.thrust = 0.0f;
_att_sp.timestamp = hrt_absolute_time();