PX4 Firmware
PX4 Autopilot Software http://px4.io
|
Public Member Functions | |
GPSSIM (bool fake_gps, bool enable_sat_info, int fix_type, int num_sat, int noise_multiplier) | |
~GPSSIM () override | |
int | init () override |
int | devIOCTL (unsigned long cmd, unsigned long arg) override |
void | set (int fix_type, int num_sat, int noise_multiplier) |
void | print_info () |
Diagnostics - print some basic information about the driver. More... | |
Protected Member Functions | |
void | _measure () override |
Private Member Functions | |
void | config () |
Try to configure the GPS, handle outgoing communication to the GPS. More... | |
void | task_main () |
Worker task: main GPS thread that configures the GPS and parses incoming data, always running. More... | |
int | set_baudrate (unsigned baud) |
Set the baudrate of the UART to the GPS. More... | |
void | cmd_reset () |
Send a reset command to the GPS. More... | |
int | receive (int timeout) |
Static Private Member Functions | |
static int | task_main_trampoline (int argc, char *argv[]) |
Trampoline to the worker task. More... | |
Private Attributes | |
bool | _task_should_exit |
flag to make the main worker task exit More... | |
volatile int | _task |
worker task More... | |
GPS_Sat_Info * | _Sat_Info |
instance of GPS sat info data object More... | |
struct vehicle_gps_position_s | _report_gps_pos |
uORB topic for gps position More... | |
orb_advert_t | _report_gps_pos_pub |
uORB pub for gps position More... | |
struct satellite_info_s * | _p_report_sat_info |
pointer to uORB topic for satellite info More... | |
orb_advert_t | _report_sat_info_pub |
uORB pub for satellite info More... | |
SyncObj | _sync |
int | _fix_type |
int | _num_sat |
int | _noise_multiplier |
std::default_random_engine | _gen |
Definition at line 85 of file gpssim.cpp.
GPSSIM::GPSSIM | ( | bool | fake_gps, |
bool | enable_sat_info, | ||
int | fix_type, | ||
int | num_sat, | ||
int | noise_multiplier | ||
) |
Definition at line 165 of file gpssim.cpp.
References GPS_Sat_Info::_data, _fix_type, _noise_multiplier, _num_sat, _p_report_sat_info, _report_gps_pos, _report_gps_pos_pub, _report_sat_info_pub, _Sat_Info, gpssim::g_dev, vehicle_gps_position_s::heading, and vehicle_gps_position_s::heading_offset.
Referenced by gpssim::start().
|
override |
Definition at line 191 of file gpssim.cpp.
References _Sat_Info, _task, _task_should_exit, and gpssim::g_dev.
|
inlineoverrideprotected |
Definition at line 104 of file gpssim.cpp.
|
private |
Send a reset command to the GPS.
Definition at line 356 of file gpssim.cpp.
Referenced by devIOCTL().
|
override |
Definition at line 237 of file gpssim.cpp.
References _sync, cmd_reset(), OK, and SENSORIOCRESET.
|
override |
Definition at line 213 of file gpssim.cpp.
References _task, ToneAlarmInterface::init(), OK, and task_main_trampoline().
Referenced by gpssim::start().
void GPSSIM::print_info | ( | void | ) |
Diagnostics - print some basic information about the driver.
Definition at line 361 of file gpssim.cpp.
References _p_report_sat_info, _report_gps_pos, vehicle_gps_position_s::jamming_indicator, vehicle_gps_position_s::noise_per_ms, and vehicle_gps_position_s::timestamp.
Referenced by gpssim::info().
|
private |
Definition at line 267 of file gpssim.cpp.
References _fix_type, _gen, _noise_multiplier, _num_sat, _report_gps_pos, vehicle_gps_position_s::alt, vehicle_gps_position_s::cog_rad, vehicle_gps_position_s::eph, vehicle_gps_position_s::epv, f(), vehicle_gps_position_s::fix_type, Simulator::getGPSSample(), Simulator::getInstance(), gps, hrt_absolute_time(), vehicle_gps_position_s::lat, vehicle_gps_position_s::lon, vehicle_gps_position_s::s_variance_m_s, vehicle_gps_position_s::satellites_used, vehicle_gps_position_s::timestamp, vehicle_gps_position_s::vel_d_m_s, vehicle_gps_position_s::vel_e_m_s, vehicle_gps_position_s::vel_m_s, and vehicle_gps_position_s::vel_n_m_s.
Referenced by task_main().
void GPSSIM::set | ( | int | fix_type, |
int | num_sat, | ||
int | noise_multiplier | ||
) |
Definition at line 379 of file gpssim.cpp.
References _fix_type, _noise_multiplier, and _num_sat.
Referenced by gpssim_main().
|
private |
Set the baudrate of the UART to the GPS.
|
private |
Worker task: main GPS thread that configures the GPS and parses incoming data, always running.
Definition at line 311 of file gpssim.cpp.
References _p_report_sat_info, _report_gps_pos, _report_gps_pos_pub, _report_sat_info_pub, _task, _task_should_exit, orb_advertise(), ORB_ID, orb_publish(), orb_unadvertise(), receive(), and TIMEOUT_100MS.
Referenced by task_main_trampoline().
|
staticprivate |
Trampoline to the worker task.
Definition at line 260 of file gpssim.cpp.
References gpssim::g_dev, and task_main().
Referenced by init().
|
private |
Definition at line 116 of file gpssim.cpp.
|
private |
Definition at line 120 of file gpssim.cpp.
Referenced by receive().
|
private |
Definition at line 118 of file gpssim.cpp.
|
private |
Definition at line 117 of file gpssim.cpp.
|
private |
pointer to uORB topic for satellite info
Definition at line 113 of file gpssim.cpp.
Referenced by GPSSIM(), print_info(), and task_main().
|
private |
uORB topic for gps position
Definition at line 111 of file gpssim.cpp.
Referenced by GPSSIM(), print_info(), receive(), and task_main().
|
private |
uORB pub for gps position
Definition at line 112 of file gpssim.cpp.
Referenced by GPSSIM(), and task_main().
|
private |
uORB pub for satellite info
Definition at line 114 of file gpssim.cpp.
Referenced by GPSSIM(), and task_main().
|
private |
instance of GPS sat info data object
Definition at line 110 of file gpssim.cpp.
|
private |
Definition at line 115 of file gpssim.cpp.
Referenced by devIOCTL().
|
private |
worker task
Definition at line 109 of file gpssim.cpp.
Referenced by init(), task_main(), and ~GPSSIM().
|
private |
flag to make the main worker task exit
Definition at line 108 of file gpssim.cpp.
Referenced by task_main(), and ~GPSSIM().