Niknu
January 24, 2021, 6:23pm
1
Hi there,
I’m trying to simulate GPS spoofing for the SITL and it doesn’t work as intended. It looks possible if you are looking at the data from this site https://ieee-dataport.org/open-access/uav-attack-dataset .
What I’m have done is disable GPS(SIM_GPS_BLOCK=1) and sent the GPS msg to the hil_gps.
But the drone gets some errors in the compas or other sensors.
Note:
I use the newest stable release for the PX4
So my question is:
(1) Can I do it in a different way?
(2) Is the way I’m doing it the only way?
dagar
January 24, 2021, 6:41pm
2
You can hack it in place in the simulator module. https://github.com/PX4/PX4-Autopilot/blob/f571b29ae8152cc0b3d0f6bb7f160e3a44a8d9ed/src/modules/simulator/simulator_mavlink.cpp#L324-L341
If there are specific ways you want to spoof GPS or simulate failures we can extend it as needed.
Niknu
January 25, 2021, 10:01am
3
In general, I should overwrite the GPS msg when I want to spoof the drone. So when I spoof the drone should it get false GPS messages. The behavior of the drone should be something like this when I spoof the drone( See the image below)
Niknu
February 10, 2021, 12:07pm
4
@dagar , how can I be sure that the drone will accept the new GPS msgs from the topic ‘/mavros/hil/gps’.
I can’t see my way out of that?
Niknu
April 14, 2022, 12:58pm
6
I have linket to my master thesis where I did it in this link:
I hope you can figure out how i did it
1 Like