Simulate GPS failure
This page describes how to prepare and deploy a local SITL simulation environment. The below video shows what the local SITL simulation should look like.
Note on Docker commands seen on video
Unlike in the video, the simulation environment is no longer provided in a single container and is managed by gnc
instead. The gisnav-docker
repository seen in the beginning of the video is no longer maintained, and all the Docker source files have been moved over to the main gisnav
repository.
Example walkthrough
The below steps demonstrate how GISNav enables GNSS-free flight with PX4 Autopilot's Mission mode in a SITL simulation.
Prerequisites
- Install the GISNav CLI via the Debian package.
Build and start SITL simulation
Prepare the containers for the SITL simulation environment:
gnc create --build px4 gisnav
Start your simulation:
Slow Gazebo startup on first run
Gazebo in the px4
container will download some models on first startup which may take several minutes with slower internet. You may not see the Gazebo GUI pop up until after the models are downloaded.
gnc start px4 gisnav
Upload flight plan via QGroundControl
Once both the Gazebo and QGroundControl windows have appeared (QGroundControl should show the vehicle location near San Carlos airport), use QGroundControl to upload the sample ~/ksql_airport_px4.plan
flight plan that is included inside the Docker container, and then start the mission.
Simulate GPS failure
After a while and once the vehicle has gained some altitude you should see a visualization of the GISNav-estimated field of view projected on the ground appear. You can then try disabling GPS through your MAVLink or NSH shell (accessible e.g. through QGroundControl > Analyze Tools > MAVLink Console):
failure gps off
The vehicle should now continue to complete its mission GNSS-free with GISNav substituting for GPS.
You can check if PX4 is receiving the mock GPS position estimates by typing the following in the MAVLink shell:
listener sensor_gps