Modifying GPS Messages Realtime with MAVProxy Modules

Hello, I am looking to create a scenario where I utilize MAVProxy to take an incoming GPS message from my simulated drone and add a bit of noise to it.

I experimented with the GPSInput Module and send those messages to a second GPS input, leaving GPS_TYPE1 as type Auto and GPS_TYPE2 as 14 (MAVLink) and cycle the number of satellites so the GCS used a different GPS every N seconds.

However, I would like to take a simulated drone that is in flight and modify the GPS message it sends me, before it gets forwarded onto the GCS.

Is this possible? Let me know if you need further clarification and thank you in advance!

you could do that, but it would add quite a bit of lag.
we already have a bunch of SIM_GPS* parameters for adding errors to GPS, including SIM_GPS_NOISE. Maybe try those first?

1 Like

I didn’t even know those functions existed. I will give them a go and report back here.

Thanks!

Update: Worked like a charm. I was able to get the copter to look like it was very glitchy with the following parameter changes:
SIM_GPS_NOISE = 20
SIM_GPS_VERR_X = 500 (kind of a lot, could pair this down to be more realistic if you want)

Then if you want to fly the thing:
FS_EKF_THRESH = 0
ARMING_CHECK = 0

My full parameter file is attached.

@tridge thanks again!!
glitchy_copter.param (24.0 KB)

1 Like

Continuing on this thread, I have a decently odd question: I am looking for a way to inject GPS noise during a live flight (i.e., no SITL). Is this feasible without messing with the drone itself?

I don’t think so, at least without unacceptable delays and involved setup. Adding noise in the GPS driver likely would be the easiest way.

1 Like

Thanks for responding. Do you have any idea how I would even begin to do something like that? I have a here3 GPS puck.