Switching from Mission to Offboard Control Mode

Hello All,

I’m currently working on implementing an offboard control mode using a companion computer for a PX4-based autopilot. My workflow involves the following steps:

  1. Uploading the Plan File:
    The plan file is uploaded to the UAV.
  2. Automatic Mode Switch:
    During the execution of the plan file in mission mode, at a specified waypoint, the UAV needs to automatically switch to offboard control mode to execute tasks that only the companion computer can perform.
  3. Completion and Mode Reversion:
    Upon completing these tasks, the UAV must switch back to mission mode to complete the rest of the mission.

I am seeking information on whether there is existing functionality in PX4 that allows for the automatic switching from mission mode to offboard control mode at a designated waypoint. If one does not exist, any suggestions to implement this are appreciated.

Thank you for your assistance.

I don’t think that’s possible out of the box.

However, one way to do so, would be to have a program running on the companion computer (e.g. MAVSDK) which subscribes to mission progress updates.

Then, as soon as you reach the index of that item, you start offboard control (again using MAVSDK), do whatever you need to do, and then you start the mission again.

Hi Julian,

Thank you for your response.

When you start the mission again, will it resume from where it left off when switching to offboard mode, or does it start anew from mission item 0? Is there a way to specify it to continue from where it left off when switching back to mission mode?"

Yes exactly.

And if you want to specify to where, you can set it using explicitly.