GPS

In order to guarantee full compatibility with the PX4 navigation system, the projection from local to global coordinate system, i.e., latitude and longitude is performed by transforming the vehicle position, to the geographic coordinate system using the azymuthal equidistant projection in accordance with the World Geodetic System (WGS84) [Mat23], [Sny87].

File: gps.py
Author: Marcelo Jacinto (marcelo.jacinto@tecnico.ulisboa.pt)
License: BSD-3-Clause. Copyright (c) 2023, Marcelo Jacinto. All rights reserved.
Description: Simulates a gps. Based on the implementation provided in PX4 stil_gazebo (https://github.com/PX4/PX4-SITL_gazebo) by Amy Wagoner and Nuno Marques

Classes:

GPS

The class that implements a GPS sensor.

class pegasus.simulator.logic.sensors.gps.GPS

Bases: Sensor

The class that implements a GPS sensor. This class inherits the base class Sensor.

Methods:

__init__([config])

Initialize the GPS class.

update(state, dt)

Method that should be implemented by the class that inherits Sensor.

Attributes:

state

(dict) The 'state' of the sensor, i.e. the data produced by the sensor at any given point in time.

__init__(config={})

Initialize the GPS class.

Parameters:

config (dict) – A Dictionary that contains all the parameters for configuring the GPS - it can be empty or only have some of the parameters used by the GPS.

Examples

The dictionary default parameters are

>>> {"fix_type": 3,
>>>  "eph": 1.0,
>>>  "epv": 1.0,
>>>  "sattelites_visible": 10,
>>>  "gps_xy_random_walk": 2.0,         # (m/s) / sqrt(hz)
>>>  "gps_z_random_walk": 4.0,          # (m/s) / sqrt(hz)
>>>  "gps_xy_noise_density": 2.0e-4,    # (m) / sqrt(hz)
>>>  "gps_z_noise_density": 4.0e-4,     # (m) / sqrt(hz)
>>>  "gps_vxy_noise_density": 0.2,      # (m/s) / sqrt(hz)
>>>  "gps_vz_noise_density": 0.4,       # (m/s) / sqrt(hz)
>>>  "gps_correlation_time": 60,        # s
>>>  "update_rate": 1.0                 # Hz
>>> }
update(state, dt)

Method that should be implemented by the class that inherits Sensor. This is where the actual implementation of the sensor should be performed.

Parameters:
  • state (State) – The current state of the vehicle.

  • dt (float) – The time elapsed between the previous and current function calls (s).

Returns:

(dict) A dictionary containing the current state of the sensor (the data produced by the sensor)

property state

(dict) The ‘state’ of the sensor, i.e. the data produced by the sensor at any given point in time