Faking GPS for indoor light show

hello I am trying to make indoor lightshow drone possible using UWB indoor navigation system, I am able to get local position using the UWB module (DM1000 BU-01) of accuracy ~10cm, and i am sending this local position converted to latitude and longitude to arducopter using gps_input message, by making gps_type = 14, and it works and the drone is showing on the map, this is the message that are being send

gpsData.time_usec = time_to_boot;
gpsData.time_week_ms =  time_week_ms; /*< [ms] GPS time (from start of GPS week)*/
gpsData.lat = (lat) * 1e7 ; /*< [degE7] Latitude (WGS84)*/
gpsData.lon = (lon) * 1e7; /*< [degE7] Longitude (WGS84)*/
gpsData.alt = 0; /*< [m] Altitude (MSL). Positive for up.*/
gpsData.hdop = 0.1; 
gpsData.vdop = 0.1;
gpsData.vn = 0; /*< [m/s] GPS velocity in north direction in earth-fixed NED frame*/
gpsData.ve= 0; /*< [m/s] GPS velocity in east direction in earth-fixed NED frame*/
gpsData.vd = 0; /*< [m/s] GPS velocity in down direction in earth-fixed NED frame*/
gpsData.speed_accuracy = 0.1; /*< [m/s] GPS speed accuracy*/
gpsData.horiz_accuracy = 1; /*< [m] GPS horizontal accuracy*/
gpsData.vert_accuracy = 1; /*< [m] GPS vertical accuracy*/
gpsData.ignore_flags = 249;
gpsData.time_week = time_week; /*<  GPS week number*/
gpsData.gps_id = 1; /*<  ID of the GPS for multiple GPS inputs*/
gpsData.fix_type = 3; /*<  0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK*/
gpsData.satellites_visible = 25;
gpsData.yaw = 0; 

time_week_ms and time_week variables are being populated by external rtc on the positioning module, now i have a problem when i try to arm the drone in poshold it says “need position estimate”, i have tried to set global origin manually, using set_gps_global_origin but still same, i tried to switch between ek3 and ek2, still same.



in mission planner it shows unhealthy gps, i try to change hdop from 0.1 to max but still same, i calibrated all sensors too, and working good

here is the log

my end goal is to test this system with opensource lightshow software called skybrush, just to prove it is possible

is there any other better way to inject local pos data to arducopter?

1 Like

Hdop should be 0 the best, usually 14-16 sats count gives 0.7 - 0.85 hdop. Indoor, default is 999 or 99 hdop, can’t remember.

MP sees greater than 0.85 hdop and 7 sats count, unhealthy gps in fake gps system.


still same,

i have made this repo, just to replicate this issue at your end

Here my companion computer “speaking” to Arducopter both indoor and outdoor.

I think there are still some healthy value missing in your fake gps system that make ArduPilot feels unhealthy.

Is this helpful?

Thankyou, I have tested this same module with another fc with build-in compass (pixhawk 6c) and changed the following messages to be sent, hdop and vdop - 0.6 and sat count to 16, and increased my publish rate to 5hz, now GPS is fine and ready to arm and arms in poshold, for some reason this same module fitted to a fc (matek h743 wlite) which has no build-in compass, it shows unhealthy GPS error

The Publish rate of 5Hz fixed it.

Have you try connecting a real Gps and go OUTDOOR to confirm that?

yes i had put together a small rig with fLYWOO GOKU GN405 NANO (no compass) and hlgrc m100 mini gps (no compass) and the results are same as with uwb module gps ie need position estimate, also i had changed some parameters compass_enable - 0, compass_use - 0, ek3_mag_cal- never, compass_use2-0, compass_use3 - 0


is compass absolutely needed to fly in poshold and guided?

I think so, else no heading of the craft with respect to the earth. Yaw operation by companion computer becomes problematic.

Oh Thanks, I haven’t tried sending any yaw data through gps_input message for fc without compass, if that’s the case i need to find whether the yaw data form cc can inject fake heading angle (ie this data is sufficient for arducopter to take as a heading value) , or else need to find other way to inject heading angle…
for now i added external compass to fc to test out the positioning and it is flying

1 Like