Hi, I’m trying to give a desired position command a multicopter vehicle.
I think that Flight Tasks seems a tool that I need.
However, I encountered some errors when following the instruction.
My code can be found in this commit.
Note that I slightly changed the instruction from
...
// manual position control
...
switch (_param_mpc_pos_mode.get()) {
...
case 3:
error = switchTask(FlightTaskIndex::ManualPositionSmoothVel);
break;
case 5: // Add case for new task: MyTask
error = _flight_tasks.switchTask(FlightTaskIndex::MyTask);
break;
to
...
// manual position control
...
switch (_param_mpc_pos_mode.get()) {
...
case 3:
error = switchTask(FlightTaskIndex::ManualPositionSmoothVel);
break;
case 5: // Add case for new task: MyTask
error = switchTask(FlightTaskIndex::MyTask);
break;
due to another error.
With this, cmake ..
at ./build
and make px4_sitl gazebo
at ./
yields
...
// manual position control
...
switch (_param_mpc_pos_mode.get()) {
...
case 3:
error = switchTask(FlightTaskIndex::ManualPositionSmoothVel);
break;
case 5: // Add case for new task: MyTask
error = _flight_tasks.switchTask(FlightTaskIndex::MyTask);
break;
Notes
environment
- Ubuntu 20.04 and provided docker container