mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 18:03:34 +08:00
Remove euler angles from attitude setpoint (#23482)
* Remove euler angles from attitude setpoint message * Remove usage of euler angles in attitude setpoint messages This commit removes the usage of euler angles in the vehicle_attitude_setpoint messages * Fix standard vtol
This commit is contained in:
@@ -122,8 +122,8 @@ RoverPositionControl::manual_control_setpoint_poll()
|
||||
|
||||
if (_control_mode.flag_control_attitude_enabled) {
|
||||
// STABILIZED mode generate the attitude setpoint from manual user inputs
|
||||
_att_sp.roll_body = 0.0;
|
||||
_att_sp.pitch_body = 0.0;
|
||||
float roll_body = 0.0;
|
||||
float pitch_body = 0.0;
|
||||
|
||||
/* reset yaw setpoint to current position if needed */
|
||||
if (_reset_yaw_sp) {
|
||||
@@ -137,10 +137,10 @@ RoverPositionControl::manual_control_setpoint_poll()
|
||||
_manual_yaw_sp = wrap_pi(_manual_yaw_sp + _att_sp.yaw_sp_move_rate * dt);
|
||||
}
|
||||
|
||||
_att_sp.yaw_body = _manual_yaw_sp;
|
||||
float yaw_body = _manual_yaw_sp;
|
||||
_att_sp.thrust_body[0] = _manual_control_setpoint.throttle;
|
||||
|
||||
Quatf q(Eulerf(_att_sp.roll_body, _att_sp.pitch_body, _att_sp.yaw_body));
|
||||
const Quatf q(Eulerf(roll_body, pitch_body, yaw_body));
|
||||
q.copyTo(_att_sp.q_d);
|
||||
|
||||
_att_sp.timestamp = hrt_absolute_time();
|
||||
|
||||
Reference in New Issue
Block a user