FlightTasks: added possibility to apply task parameters from the vehicle command

This commit is contained in:
Matthias Grob
2017-12-14 07:51:39 +01:00
committed by Beat Küng
parent b1f24da05e
commit efd240904f
7 changed files with 45 additions and 3 deletions
@@ -51,6 +51,21 @@ FlightTaskOrbit::FlightTaskOrbit(control::SuperBlock *parent, const char *name)
_sticks_data_required = false;
}
bool FlightTaskOrbit::applyCommandParameters(vehicle_command_s command)
{
float &r = command.param3;
float &v = command.param4;
if (math::isInRange(r, 5.f, 50.f) &&
fabs(v) < 10.f) {
_r = r;
_v = v;
return true;
}
return false;
}
bool FlightTaskOrbit::activate()
{
bool ret = FlightTaskManual::activate();