testing tweaks

This commit is contained in:
sander
2016-04-11 14:56:49 +02:00
committed by tumbili
parent 3a6882a4d6
commit 0b10720034
3 changed files with 16 additions and 5 deletions
+14 -4
View File
@@ -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");
}
}
+1 -1
View File
@@ -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);
+1
View File
@@ -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