mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 20:13:35 +08:00
FlightTasks: adapt to acceleration based control
This commit is contained in:
@@ -96,10 +96,12 @@ const vehicle_local_position_setpoint_s FlightTask::getPositionSetpoint()
|
||||
|
||||
_acceleration_setpoint.copyTo(vehicle_local_position_setpoint.acceleration);
|
||||
_jerk_setpoint.copyTo(vehicle_local_position_setpoint.jerk);
|
||||
_thrust_setpoint.copyTo(vehicle_local_position_setpoint.thrust);
|
||||
vehicle_local_position_setpoint.yaw = _yaw_setpoint;
|
||||
vehicle_local_position_setpoint.yawspeed = _yawspeed_setpoint;
|
||||
|
||||
// deprecated, only kept for output logging
|
||||
matrix::Vector3f(NAN, NAN, NAN).copyTo(vehicle_local_position_setpoint.thrust);
|
||||
|
||||
return vehicle_local_position_setpoint;
|
||||
}
|
||||
|
||||
@@ -109,7 +111,6 @@ void FlightTask::_resetSetpoints()
|
||||
_velocity_setpoint.setNaN();
|
||||
_acceleration_setpoint.setNaN();
|
||||
_jerk_setpoint.setNaN();
|
||||
_thrust_setpoint.setNaN();
|
||||
_yaw_setpoint = _yawspeed_setpoint = NAN;
|
||||
}
|
||||
|
||||
|
||||
@@ -165,7 +165,11 @@ public:
|
||||
virtual void setYawHandler(WeatherVane *ext_yaw_handler) {}
|
||||
|
||||
void updateVelocityControllerIO(const matrix::Vector3f &vel_sp,
|
||||
const matrix::Vector3f &thrust_sp) {_velocity_setpoint_feedback = vel_sp; _thrust_setpoint_feedback = thrust_sp; }
|
||||
const matrix::Vector3f &acc_sp)
|
||||
{
|
||||
_velocity_setpoint_feedback = vel_sp;
|
||||
_acceleration_setpoint_feedback = acc_sp;
|
||||
}
|
||||
|
||||
protected:
|
||||
uORB::SubscriptionData<vehicle_local_position_s> _sub_vehicle_local_position{ORB_ID(vehicle_local_position)};
|
||||
@@ -225,12 +229,10 @@ protected:
|
||||
matrix::Vector3f _velocity_setpoint;
|
||||
matrix::Vector3f _acceleration_setpoint;
|
||||
matrix::Vector3f _jerk_setpoint;
|
||||
matrix::Vector3f _thrust_setpoint;
|
||||
float _yaw_setpoint{};
|
||||
float _yawspeed_setpoint{};
|
||||
|
||||
matrix::Vector3f _velocity_setpoint_feedback;
|
||||
matrix::Vector3f _thrust_setpoint_feedback;
|
||||
matrix::Vector3f _acceleration_setpoint_feedback;
|
||||
|
||||
/* Counters for estimator local position resets */
|
||||
struct {
|
||||
|
||||
Reference in New Issue
Block a user