vtol_attitude_control: hotfix, do not update parameters on every iteration

Signed-off-by: Roman <bapstroman@gmail.com>
This commit is contained in:
Roman
2016-11-21 16:38:52 +01:00
committed by Julian Oes
parent 92a5db92a2
commit d77547e7e1
8 changed files with 13 additions and 16 deletions
+1 -4
View File
@@ -75,7 +75,7 @@ Standard::~Standard()
{
}
int
void
Standard::parameters_update()
{
float v;
@@ -122,13 +122,10 @@ Standard::parameters_update()
return OK;
}
void Standard::update_vtol_state()
{
parameters_update();
/* After flipping the switch the vehicle will start the pusher (or tractor) motor, picking up
* forward speed. After the vehicle has picked up enough speed the rotors shutdown.
* For the back transition the pusher motor is immediately stopped and rotors reactivated.
+1 -2
View File
@@ -110,7 +110,6 @@ private:
void set_max_mc(unsigned pwm_value);
int parameters_update();
virtual void parameters_update();
};
#endif
+1 -4
View File
@@ -81,7 +81,7 @@ Tailsitter::~Tailsitter()
}
int
void
Tailsitter::parameters_update()
{
float v;
@@ -117,13 +117,10 @@ Tailsitter::parameters_update()
if (_params_tailsitter.airspeed_trans < _params_tailsitter.airspeed_blend_start + 1.0f) {
_params_tailsitter.airspeed_trans = _params_tailsitter.airspeed_blend_start + 1.0f;
}
return OK;
}
void Tailsitter::update_vtol_state()
{
parameters_update();
/* simple logic using a two way switch to perform transitions.
* after flipping the switch the vehicle will start tilting in MC control mode, picking up
+1 -1
View File
@@ -122,7 +122,7 @@ private:
/**
* Update parameters.
*/
int parameters_update();
virtual void parameters_update();
};
#endif
+1 -4
View File
@@ -75,7 +75,7 @@ Tiltrotor::~Tiltrotor()
}
int
void
Tiltrotor::parameters_update()
{
float v;
@@ -128,8 +128,6 @@ Tiltrotor::parameters_update()
if (_params_tiltrotor.airspeed_trans < _params_tiltrotor.airspeed_blend_start + 1.0f) {
_params_tiltrotor.airspeed_trans = _params_tiltrotor.airspeed_blend_start + 1.0f;
}
return OK;
}
int Tiltrotor::get_motor_off_channels(int channels)
@@ -154,7 +152,6 @@ int Tiltrotor::get_motor_off_channels(int channels)
void Tiltrotor::update_vtol_state()
{
parameters_update();
/* simple logic using a two way switch to perform transitions.
* after flipping the switch the vehicle will start tilting rotors, picking up
+1 -1
View File
@@ -133,7 +133,7 @@ private:
/**
* Update parameters.
*/
int parameters_update();
virtual void parameters_update();
};
#endif
@@ -564,6 +564,11 @@ VtolAttitudeControl::parameters_update()
_params.fw_min_alt = v;
// update the parameters of the instances of base VtolType
if (_vtol_type != nullptr) {
_vtol_type->parameters_update();
}
return OK;
}
+2
View File
@@ -139,6 +139,8 @@ public:
mode get_mode() {return _vtol_mode;};
virtual void parameters_update() = 0;
protected:
VtolAttitudeControl *_attc;
mode _vtol_mode;