mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 23:43:33 +08:00
testing tweaks
This commit is contained in:
@@ -47,11 +47,12 @@
|
||||
Standard::Standard(VtolAttitudeControl *attc) :
|
||||
VtolType(attc),
|
||||
_flag_enable_mc_motors(true),
|
||||
_pusher_throttle(0.0f),
|
||||
_pusher_throttle(0.0f),
|
||||
_airspeed_trans_blend_margin(0.0f)
|
||||
{
|
||||
_vtol_schedule.flight_mode = MC_MODE;
|
||||
_vtol_schedule.transition_start = 0;
|
||||
_pusher_active = false;
|
||||
|
||||
_mc_roll_weight = 1.0f;
|
||||
_mc_pitch_weight = 1.0f;
|
||||
@@ -302,12 +303,21 @@ void Standard::fill_actuator_outputs()
|
||||
_actuators_out_0->control[actuator_controls_s::INDEX_ROLL] = _actuators_mc_in->control[actuator_controls_s::INDEX_ROLL]
|
||||
* _mc_roll_weight; // roll
|
||||
|
||||
if(_actuators_mc_in->control[actuator_controls_s::INDEX_PITCH] < -0.01f){
|
||||
_actuators_out_0->control[actuator_controls_s::INDEX_PITCH] = -0.01f;
|
||||
_pusher_throttle = _actuators_mc_in->control[actuator_controls_s::INDEX_PITCH] * -1;
|
||||
if(_actuators_mc_in->control[actuator_controls_s::INDEX_PITCH] < -0.05f){
|
||||
_actuators_out_0->control[actuator_controls_s::INDEX_PITCH] = -0.02f;
|
||||
_pusher_throttle = _actuators_mc_in->control[actuator_controls_s::INDEX_PITCH] * -0.15f;
|
||||
if(!_pusher_active){
|
||||
_pusher_active = true;
|
||||
warnx("Activating pusher");
|
||||
}
|
||||
} else {
|
||||
_actuators_out_0->control[actuator_controls_s::INDEX_PITCH] =
|
||||
_actuators_mc_in->control[actuator_controls_s::INDEX_PITCH] * _mc_pitch_weight; // pitch
|
||||
if(_pusher_active){
|
||||
_pusher_active = false;
|
||||
warnx("Deactivating pusher");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ private:
|
||||
} _vtol_schedule;
|
||||
|
||||
bool _flag_enable_mc_motors;
|
||||
float _pusher_throttle;
|
||||
float _pusher_throttle;
|
||||
float _airspeed_trans_blend_margin;
|
||||
|
||||
void set_max_mc(unsigned pwm_value);
|
||||
|
||||
@@ -154,6 +154,7 @@ protected:
|
||||
|
||||
bool flag_idle_mc = true; //false = "idle is set for fixed wing mode"; true = "idle is set for multicopter mode"
|
||||
|
||||
bool _pusher_active = false;
|
||||
float _mc_roll_weight = 1.0f; // weight for multicopter attitude controller roll output
|
||||
float _mc_pitch_weight = 1.0f; // weight for multicopter attitude controller pitch output
|
||||
float _mc_yaw_weight = 1.0f; // weight for multicopter attitude controller yaw output
|
||||
|
||||
Reference in New Issue
Block a user