Suggestions for performing VIO

  • Hi all,
    I have a silly question
    I have been performing VIO flights indoor without any issue. So the drone I am working with is using a pixhawk 4 gps and i am flying indoor. The GPS is disabled but the compass is still enabled. So here is the silly question, I have been always facing north while powering up my drone. Is this method correct to do for performing VIO? My thought process is that the onboard compass is able to determine the true heading, but the VIO tracking camera considers the heading where it was powered on as north.(like if i face east and power on the drone, that heading would show as north on QGC) Wouldnt this create a compass variance error while navigation?

    Moving to more advance thing!
    How to perform an outdoor (open field) to indoor (basement) transition while in position mode? What should be the steps i need to follow and things i should keep in mind!

    Thanks & Regards,
    Mohammed Naveed

  • Dev Team

    Hi Mohammed--
    Please check your PX4 parameters that:

    EKF2_MAG_TYPE = Magnetic Heading
    SYS_HAS_MAG = 1

    If VIO is the sole source of data input for the estimator, then yes, North will always be the origin's reference orientation at power up (aka it's in FRD frame, north always being F). The above params should use the mag for correction in NED frame. If you still don't see that, you'll need to pull the ulog (and convert it to csv's), and check the estimator_status_0.csv control_mode_flags column and dissect the bit flags for mag_* and see if they are all true (magnetic yaw heading is being fused). If not, the bit flags should reveal the additional param changes needed. Just realize once you start using fusing magnetometer data, your command trajectories/waypoints (e.g. offboard mode commands) will need to be in NED frame.

    For outdoor->indoor type transitions (while under VIO/GPS), we offer a forked PX4 version (unsupported) here under the tag: v1.11.3-0.2.3 with some notes on how it works.

    Here's an overview and an example. Just let us know if you are interested in more details on this forked version.

  • Cliff,

    Apologies for hijacking this thread slightly, but in another one I was interested in this transition mechanism.

    It looks like the responsible code to monitor GNSS signals and perform the transition is here:

    Are these changes merged into the official build of v1.11.3-0.2.3 on the ModalAI site at?:

    I haven't seen the firmware ever "flip" the EKF2 mask, but perhaps there is another parameter I need to set to enable the GNSS quality monitoring. I'll poke around a bit more, just wanted to make sure I was on the right track with the above changeset.

    Thanks much for any insight!

Log in to reply