How to use only imu, barometer and magnetic compass only for offboard control

Hello community. I am trying to use only imu, barometer, and magnetic compass for offboard control. I want the odometry information to from these sensors only. How to achieve that?

It seems that I have to use either gps, vision-inertial sensors, or optical flow to switch to the offboard mode. However, if I use these sensors, many times it outputs no reliable position estimates and refuse offboard switch. My application does not require precise localization.

Thank you in advance!

Have you seen this?

I expect you will have to tune some of the estimator thresholds.

Hi Julian,

Thank you very much for your reply. We also check the offboard documentation page. It says it needs position or pose/attitude information - e.g. GPS, optical flow, visual-inertial odometry, mocap, etc.
(Offboard Mode (Generic/All Frames) | PX4 User Guide (main))

Does this mean if we only use IMU, barometer and magenetic compass, it will not be able to switch to offboard. Indeed, we will use thrust and altitude control and will not send “set position” command.

You should be fine without GPS if you aren’t setting position commands - that’s what “OR” means above.

FYI, the conditions for switching to offboard (and other modes) are listed here in the source: PX4-Autopilot/src/modules/commander/ModeUtil/mode_requirements.cpp at 749f88b62b57f5e855ac3434351d1abee7317eba · PX4/PX4-Autopilot · GitHub - as you can see you need your attitude, angular velocity and a steady stream of offboard points. That means IMU and maybe compass are probably the only absolute requirement from a mode switching point of view.