mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-17 15:20:35 +08:00
flight tasks: refactor BlockParam -> Param and handle param updates
This commit is contained in:
@@ -45,31 +45,31 @@ int FlightTasks::switchTask(FlightTaskIndex new_task_index)
|
||||
return 0;
|
||||
|
||||
case FlightTaskIndex::Stabilized:
|
||||
_current_task = new (&_task_union.stabilized) FlightTaskManualStabilized(this, "MANSTAB");
|
||||
_current_task = new (&_task_union.stabilized) FlightTaskManualStabilized();
|
||||
break;
|
||||
|
||||
case FlightTaskIndex::Altitude:
|
||||
_current_task = new (&_task_union.altitude) FlightTaskManualAltitude(this, "MANALT");
|
||||
_current_task = new (&_task_union.altitude) FlightTaskManualAltitude();
|
||||
break;
|
||||
|
||||
case FlightTaskIndex::AltitudeSmooth:
|
||||
_current_task = new (&_task_union.altitude_smooth) FlightTaskManualAltitudeSmooth(this, "MANALTSM");
|
||||
_current_task = new (&_task_union.altitude_smooth) FlightTaskManualAltitudeSmooth();
|
||||
break;
|
||||
|
||||
case FlightTaskIndex::Position:
|
||||
_current_task = new (&_task_union.position) FlightTaskManualPosition(this, "MANPOS");
|
||||
_current_task = new (&_task_union.position) FlightTaskManualPosition();
|
||||
break;
|
||||
|
||||
case FlightTaskIndex::PositionSmooth:
|
||||
_current_task = new (&_task_union.position_smooth) FlightTaskManualPositionSmooth(this, "MANPOSSM");
|
||||
_current_task = new (&_task_union.position_smooth) FlightTaskManualPositionSmooth();
|
||||
break;
|
||||
|
||||
case FlightTaskIndex::Orbit:
|
||||
_current_task = new (&_task_union.orbit) FlightTaskOrbit(this, "ORB");
|
||||
_current_task = new (&_task_union.orbit) FlightTaskOrbit();
|
||||
break;
|
||||
|
||||
case FlightTaskIndex::Sport:
|
||||
_current_task = new (&_task_union.sport) FlightTaskSport(this, "SPO");
|
||||
_current_task = new (&_task_union.sport) FlightTaskSport();
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -111,6 +111,13 @@ int FlightTasks::switchTask(int new_task_index)
|
||||
return -1;
|
||||
}
|
||||
|
||||
void FlightTasks::handleParameterUpdate()
|
||||
{
|
||||
if (_current_task) {
|
||||
_current_task->handleParameterUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
void FlightTasks::_updateCommand()
|
||||
{
|
||||
// TODO: port flight task mavlink command to have support for this functionality
|
||||
|
||||
Reference in New Issue
Block a user