mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
FlightTaskAutoMapper: clarify influence of sticks
This commit is contained in:
committed by
Julian Kent
parent
079c5a11c2
commit
0d56035a46
@@ -180,22 +180,17 @@ bool FlightTaskAutoMapper::_highEnoughForLandingGear()
|
|||||||
|
|
||||||
float FlightTaskAutoMapper::_getLandSpeed()
|
float FlightTaskAutoMapper::_getLandSpeed()
|
||||||
{
|
{
|
||||||
float speed = 0;
|
float land_speed = math::gradual(_dist_to_ground,
|
||||||
|
|
||||||
if (_dist_to_ground > _param_mpc_land_alt1.get()) {
|
|
||||||
speed = _constraints.speed_down;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
const float land_speed = math::gradual(_dist_to_ground,
|
|
||||||
_param_mpc_land_alt2.get(), _param_mpc_land_alt1.get(),
|
_param_mpc_land_alt2.get(), _param_mpc_land_alt1.get(),
|
||||||
_param_mpc_land_speed.get(), _constraints.speed_down);
|
_param_mpc_land_speed.get(), _constraints.speed_down);
|
||||||
|
|
||||||
// user input assisted land speed
|
// user input assisted land speed
|
||||||
if (_param_mpc_land_rc_help.get()) {
|
if (_param_mpc_land_rc_help.get()
|
||||||
_sticks.evaluateSticks(_time_stamp_current);
|
&& (_dist_to_ground < _param_mpc_land_alt1.get())
|
||||||
speed = land_speed + _sticks.getPositionExpo()(2) * land_speed;
|
&& _sticks.evaluateSticks(_time_stamp_current)) {
|
||||||
}
|
// stick full up -1 -> stop, stick full down 1 -> double the speed
|
||||||
|
land_speed *= (1 + _sticks.getPositionExpo()(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
return speed;
|
return land_speed;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ Sticks::Sticks(ModuleParams *parent) :
|
|||||||
ModuleParams(parent)
|
ModuleParams(parent)
|
||||||
{};
|
{};
|
||||||
|
|
||||||
void Sticks::evaluateSticks(hrt_abstime now)
|
bool Sticks::evaluateSticks(hrt_abstime now)
|
||||||
{
|
{
|
||||||
_sub_manual_control_setpoint.update();
|
_sub_manual_control_setpoint.update();
|
||||||
|
|
||||||
@@ -80,6 +80,8 @@ void Sticks::evaluateSticks(hrt_abstime now)
|
|||||||
_positions.zero();
|
_positions.zero();
|
||||||
_positions_expo.zero();
|
_positions_expo.zero();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return _input_available;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sticks::applyGearSwitch(landing_gear_s &gear)
|
void Sticks::applyGearSwitch(landing_gear_s &gear)
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public:
|
|||||||
Sticks(ModuleParams *parent);
|
Sticks(ModuleParams *parent);
|
||||||
~Sticks() = default;
|
~Sticks() = default;
|
||||||
|
|
||||||
void evaluateSticks(hrt_abstime now); ///< checks and sets stick inputs
|
bool evaluateSticks(hrt_abstime now); ///< checks and sets stick inputs
|
||||||
void applyGearSwitch(landing_gear_s &gear); ///< Sets gears according to switch
|
void applyGearSwitch(landing_gear_s &gear); ///< Sets gears according to switch
|
||||||
bool isAvailable() { return _input_available; };
|
bool isAvailable() { return _input_available; };
|
||||||
const matrix::Vector<float, 4> &getPosition() { return _positions; };
|
const matrix::Vector<float, 4> &getPosition() { return _positions; };
|
||||||
|
|||||||
@@ -359,8 +359,11 @@ PARAM_DEFINE_FLOAT(MPC_LAND_VEL_XY, 10.0f);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable user assisted descent speed for autonomous land routine.
|
* Enable user assisted descent speed for autonomous land routine.
|
||||||
* When enabled, descent speed will be equal to MPC_LAND_SPEED at half throttle,
|
*
|
||||||
* MPC_Z_VEL_MAX_DN at zero throttle, and 0.5 * MPC_LAND_SPEED at full throttle.
|
* When enabled, descent speed will be:
|
||||||
|
* stick full up - 0
|
||||||
|
* stick centered - MPC_LAND_SPEED
|
||||||
|
* stick full down - 2 * MPC_LAND_SPEED
|
||||||
*
|
*
|
||||||
* @min 0
|
* @min 0
|
||||||
* @max 1
|
* @max 1
|
||||||
|
|||||||
Reference in New Issue
Block a user