flight_mode_manager: call direct parent instead of grandparent

FlightTaskManualAcceleration and FlightTaskOrbit both inherit from
FlightTaskManualAltitudeSmoothVel but were calling FlightTask and
FlightTaskManualAltitude respectively, skipping the intermediate
parent's overrides (smoothing velocity init, parameter chain).

Fix the DEFINE_PARAMETERS_CUSTOM_PARENT macro argument and the
activate() call to use FlightTaskManualAltitudeSmoothVel.

Fixes bugprone-parent-virtual-call clang-tidy diagnostic.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
Ramon Roche 2026-02-09 15:10:11 -08:00
parent 83a4d648e3
commit 5d151c54a4
2 changed files with 2 additions and 2 deletions

View File

@ -52,7 +52,7 @@ protected:
StickAccelerationXY _stick_acceleration_xy{this};
WeatherVane _weathervane{this}; /**< weathervane library, used to implement a yaw control law that turns the vehicle nose into the wind */
DEFINE_PARAMETERS_CUSTOM_PARENT(FlightTask,
DEFINE_PARAMETERS_CUSTOM_PARENT(FlightTaskManualAltitudeSmoothVel,
(ParamFloat<px4::params::MPC_VEL_MANUAL>) _param_mpc_vel_manual,
(ParamFloat<px4::params::MPC_ACC_HOR>) _param_mpc_acc_hor
)

View File

@ -173,7 +173,7 @@ void FlightTaskOrbit::_sanitizeParams(float &radius, float &velocity) const
bool FlightTaskOrbit::activate(const trajectory_setpoint_s &last_setpoint)
{
bool ret = FlightTaskManualAltitude::activate(last_setpoint);
bool ret = FlightTaskManualAltitudeSmoothVel::activate(last_setpoint);
_currently_orbiting = false;
_orbit_radius = _radius_min;
_orbit_velocity = 1.f;