PX4 Firmware
PX4 Autopilot Software http://px4.io
gpssim.cpp File Reference

Simulated GPS driver. More...

#include <sys/types.h>
#include <px4_platform_common/defines.h>
#include <px4_platform_common/getopt.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <semaphore.h>
#include <string.h>
#include <fcntl.h>
#include <poll.h>
#include <errno.h>
#include <random>
#include <math.h>
#include <unistd.h>
#include <px4_platform_common/px4_config.h>
#include <px4_platform_common/tasks.h>
#include <drivers/drv_hrt.h>
#include <drivers/device/device.h>
#include <uORB/uORB.h>
#include <uORB/topics/vehicle_gps_position.h>
#include <uORB/topics/satellite_info.h>
#include <simulator/simulator.h>
#include "DevMgr.hpp"
#include "VirtDevObj.hpp"
Include dependency graph for gpssim.cpp:

Go to the source code of this file.

Classes

class  GPS_Sat_Info
 
class  GPSSIM
 

Namespaces

 gpssim
 Local functions in support of the shell command.
 

Macros

#define GPS_DRIVER_MODE_UBX_SIM
 
#define GPSSIM_DEVICE_PATH   "/dev/gpssim"
 
#define TIMEOUT_100MS   100000
 
#define RATE_MEASUREMENT_PERIOD   5000000
 

Functions

__EXPORT int gpssim_main (int argc, char *argv[])
 
void gpssim::start (bool fake_gps, bool enable_sat_info, int fix_type, int num_sat, int noise_multiplier)
 Start the driver. More...
 
void gpssim::stop ()
 Stop the driver. More...
 
void gpssim::test ()
 Perform some basic functional tests on the driver; make sure we can collect data from the sensor in polled and automatic modes. More...
 
void gpssim::reset ()
 Reset the driver. More...
 
void gpssim::info ()
 Print the status of the driver. More...
 
void gpssim::usage (const char *reason)
 Print the correct usage. More...
 

Variables

GPSSIMgpssim::g_dev = nullptr
 

Detailed Description

Simulated GPS driver.

Definition in file gpssim.cpp.

Macro Definition Documentation

◆ GPS_DRIVER_MODE_UBX_SIM

#define GPS_DRIVER_MODE_UBX_SIM

Definition at line 71 of file gpssim.cpp.

◆ GPSSIM_DEVICE_PATH

#define GPSSIM_DEVICE_PATH   "/dev/gpssim"

Definition at line 72 of file gpssim.cpp.

Referenced by gpssim::reset(), and gpssim::start().

◆ RATE_MEASUREMENT_PERIOD

#define RATE_MEASUREMENT_PERIOD   5000000

Definition at line 75 of file gpssim.cpp.

◆ TIMEOUT_100MS

#define TIMEOUT_100MS   100000

Definition at line 74 of file gpssim.cpp.

Referenced by GPSSIM::task_main().

Function Documentation

◆ gpssim_main()

int gpssim_main ( int  argc,
char *  argv[] 
)

Definition at line 513 of file gpssim.cpp.

References gpssim::g_dev, gpssim::info(), gpssim::reset(), GPSSIM::set(), gpssim::start(), gpssim::stop(), gpssim::test(), and gpssim::usage().

Here is the call graph for this function: