mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-11 06:23:26 +08:00
FlightTaskOrbit: replace hardcoded 10m/s maximum speed with multicopter speed configuration (#25192)
This commit is contained in:
@@ -160,7 +160,7 @@ void FlightTaskOrbit::_sanitizeParams(float &radius, float &velocity) const
|
||||
{
|
||||
// clip the radius to be within range
|
||||
radius = math::constrain(radius, _radius_min, _param_mc_orbit_rad_max.get());
|
||||
velocity = math::constrain(velocity, -fabsf(_velocity_max), fabsf(_velocity_max));
|
||||
velocity = math::constrain(velocity, -fabsf(_param_mpc_xy_vel_max.get()), fabsf(_param_mpc_xy_vel_max.get()));
|
||||
|
||||
bool exceeds_maximum_acceleration = (velocity * velocity) >= _acceleration_max * radius;
|
||||
|
||||
|
||||
@@ -72,7 +72,6 @@ protected:
|
||||
private:
|
||||
/* TODO: Should be controlled by params */
|
||||
static constexpr float _radius_min = 1.f;
|
||||
static constexpr float _velocity_max = 10.f;
|
||||
static constexpr float _acceleration_max = 2.f;
|
||||
static constexpr float _horizontal_acceptance_radius = 2.f;
|
||||
|
||||
@@ -149,6 +148,7 @@ private:
|
||||
(ParamFloat<px4::params::MPC_ACC_UP_MAX>) _param_mpc_acc_up_max,
|
||||
(ParamFloat<px4::params::MPC_ACC_DOWN_MAX>) _param_mpc_acc_down_max,
|
||||
(ParamFloat<px4::params::MPC_Z_V_AUTO_UP>) _param_mpc_z_v_auto_up,
|
||||
(ParamFloat<px4::params::MPC_Z_V_AUTO_DN>) _param_mpc_z_v_auto_dn
|
||||
(ParamFloat<px4::params::MPC_Z_V_AUTO_DN>) _param_mpc_z_v_auto_dn,
|
||||
(ParamFloat<px4::params::MPC_XY_VEL_MAX>) _param_mpc_xy_vel_max
|
||||
)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user