mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-02 11:30:34 +08:00
FlightTasks: added possibility to apply task parameters from the vehicle command
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user