Ardupilot sitl gps json

Hello everyone,
We are trying to send GPS JSON string to Ardupilot SITL, but there is no information on whether and how this is possible. Here: ardupilot/libraries/SITL/examples/JSON/pybullet/robot.py at master · ArduPilot/ardupilot · GitHub there is only how to send the imu data
Is it possible to send GPS data? And what data can be sent, and how, using JSON?

Thank you in advance

1 Like

That’s not exactly how the JSON SITL works. The IMU_FTM in the code is not the simulated IMU sensor (so I understand your confusion). The python model only sends ground truth states to the Ardupilot SITL (it sends the real acceleration, angular velocity, position, attitude, velocity), and then the Ardupilot SITL simulates sensor noise on those values before inputting the “faked sensor data” to the simulated EKF.

Then in the generated SITL log, there is a structure called SIM. The fields in that log structure are the ground truths from the Python model. You can compare those ground truths to what the EKF estimates to get a good idea if the Ardupilot EKF is capable of correctly estimating the drone’s states.

If you want to simulate sensor noise and inaccuracies in your python model, then you’d have to do a major rework of the SITL code. But Ardudpilot already has parameters to simulate sensor noise in the SITL, which are applied to the incoming JSON ground truths.

1 Like

hello bobzwik I am trying to simuate a gps with less accuracy just like real world scenario how can I do that here

The json simulator isn’t meant to simulate less accuracy.It is your ground truth, it is the real movement your drone makes. If you want Ardupilot to add inaccuracies to the ground truth, you can use the SIM_GPS_* parameters.