# GPS Denied Environment with VIO

Source: https://forum.modalai.com/topic/690/gps-denied-environment-with-vio
Category: General Questions (https://forum.modalai.com/category/2/general-questions)
Posted: 2022-01-27 22:06:12 UTC by Karl_Wright
Replies: 7 · Views: 2284

## Karl_Wright · 2022-01-27 22:06:12 UTC

Hello, 

I have a Flight Deck controlling motors through the ModalAI ESC (v2).  The drone is updated with firmware v1.11.3-0.0.5 and has parameters loaded from [this repository](https://gitlab.com/voxl-public/flight-core-px4/px4-parameters) as follows:

platforms --> v1.11 --> m500_4s_config

helpers --> m500 --> collision_prevention, ekf2_indoor_vio, and enable_uart_esc

I am able to actuate the motors through voxl-px4-shell, but cannot arm the drone because of a GPS error.

My goal is to get the drone flying indoors with VIO position mode.  

Is there a way to diagnose the GPS error to determine the source of the problem?  

Here's the output from nsh> gps status.

INFO  [gps] Main GPS
INFO  [gps] protocol: UBX
INFO  [gps] status: OK, port: /dev/ttyS0, baudrate: 115200
INFO  [gps] sat info: disabled
INFO  [gps] rate position:                5.00 Hz
INFO  [gps] rate velocity:                5.00 Hz
INFO  [gps] rate publication:             5.00 Hz
INFO  [gps] rate RTCM injection:          0.00 Hz
 vehicle_gps_position_s
        timestamp: 37432344  (0.001194 seconds ago)
        time_utc_usec: 0
        lat: 0
        lon: 0
        alt: -17000
        alt_ellipsoid: 0
        s_variance_m_s: 33.4660
        c_variance_rad: 3.1416
        eph: 4294967.5000
        epv: 3750018.5000
        hdop: 99.9900
        vdop: 99.9900
        noise_per_ms: 104
        jamming_indicator: 33
        vel_m_s: 0.0000
        vel_n_m_s: 0.0000
        vel_e_m_s: 0.0000
        vel_d_m_s: 0.0000
        cog_rad: 0.0000
        timestamp_time_relative: 0
        heading: nan
        heading_offset: 0.0000
        fix_type: 0
        vel_ned_valid: False
        satellites_used: 0

Thanks in advance!

Karl

## Reply by mohammednaveed · 2022-01-28 01:56:36 UTC

Dear @Karl_Wright 
After powering on your drone go to mavlink inspector and check at odometry tab whether X and Y data is non zero. if it's non zero then VIO is working. 
Please refer to this [document](https://docs.modalai.com/flying-with-vio/)

Regards,
Mohammed Naveed

## Reply by Karl_Wright · 2022-01-28 14:58:23 UTC

Hi @mohammednaveed, thanks for your response!  The VIO is working properly and sends data to the mavlink inspector.

The main issue I'm having is that the drone won't arm because of a gps error.  Other than that, everything else seems to be working correctly.  Any advice on troubleshooting the gps error would be greatly appreciated.

Thanks,

Karl

## Reply by Gordon8 · 2022-01-29 22:38:21 UTC (in reply to Karl_Wright)

@Karl_Wright 

You have:
helpers --> m500 --> collision_prevention, ekf2_indoor_vio, and enable_uart_esc

Try adding in:
sensors_disable_gps_mag.params

"Turns off GPS and barometer. Use this is you have no gps/mag attached or have a gps/mag attached and just want them disabled in software. Use this with ekf2_indoor_vio.params
This is not included with ekf2_indoo_vio.params since you may still want these sensors enabled for logging even when not using in EKF2."

## Reply by Karl_Wright · 2022-01-31 19:52:00 UTC

Hello @Gordon8, 

Thanks so much for your advice.  I reset all the parameters in QGC and reloaded ekf2_indoor_vio and sensors_disable_gps_mag.  

I am unfortunately still running into the same issue as before.  Arming is denied because of a generic gps error.  I have disabled gps and edited other parameters that are supposed to allow arming without gps.    

Thanks again @Gordon8 for your response, I'm open to trying any other suggestions that you or others may have.

Karl

## Reply by Karl_Wright · 2022-03-02 15:25:06 UTC

After much more time trying to troubleshoot this issue, I am still unable to arm my drone.  QGC shows that everything is operating correctly except that there are failures for GPS and Pre-Arm Check.  Does anyone else have any suggestions on other procedures I could try?  My current software setup is the same that I have described above.  

Thanks!

## Reply by Chad Sweet (ModalAI staff) · 2022-03-02 17:00:51 UTC

How did you update your firmware? Did you use a ModalAI image or QGC?

Check out https://docs.modalai.com/flight-core-firmware/ and try starting with the latest on that page.

## Reply by Karl_Wright · 2022-03-02 17:41:07 UTC (in reply to Chad Sweet)

@Chad-Sweet Thanks for your reply.

I am currently running firmware FCv1 - v1.11.3-0.2.3 from that link.  I downloaded the image and then uploaded it through QGC as a custom firmware.

Thanks,

Karl
