FlightTaskOrbit: replace hardcoded 10m/s maximum speed with multicopter speed configuration (#25192)

This commit is contained in:
Matthias Grob
2025-07-10 21:16:11 +02:00
committed by GitHub
parent 140b426720
commit a4115db669
2 changed files with 3 additions and 3 deletions

View File

@@ -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;

View File

@@ -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
)
};