mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
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:
parent
83a4d648e3
commit
5d151c54a4
@ -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
|
||||
)
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user