vmount: compute gimbal yaw setpoint relative to vehicle yaw

This commit is contained in:
Nicolas de Palezieux 2018-01-08 11:03:39 +01:00 committed by Lorenz Meier
parent d8164377a8
commit 0fd043af01

View File

@ -187,7 +187,8 @@ void OutputBase::_handle_position_update(bool force_update)
}
float roll = _cur_control_data->type_data.lonlat.roll_angle;
float yaw = get_bearing_to_next_waypoint(vehicle_global_position.lat, vehicle_global_position.lon, lat, lon);
float yaw = get_bearing_to_next_waypoint(vehicle_global_position.lat, vehicle_global_position.lon, lat, lon)
- vehicle_global_position.yaw;
_angle_setpoints[0] = roll;
_angle_setpoints[1] = pitch;