Commit Graph

38 Commits

Author SHA1 Message Date
Andrew Tridgell 4e1b2b95d4 SITL: use NEW_NOTHROW for new(std::nothrow) 2024-06-04 09:20:21 +10:00
Ryan Friedman fbb785859a SITL: fix GPS headings
* Rename NMEA heading to ground_course_deg
* Rename heading() utility to ground course (it was wrong)
* Add _rad prefix to be pedantic about units
* Add missing degrees conversion in NMEA because NMEA is not SI

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2024-05-12 21:06:52 +10:00
Peter Barker 5199be9914 SITL: add diagnostics when bad GPS backend specified 2024-02-20 19:35:01 +11:00
Andrew Tridgell 5fce4f5f6d SITL: added simple simulated jammer 2023-12-05 19:28:50 +11:00
Andrew Tridgell c316de75d0 SITL: fixed whitespace in SIM_GPS.cpp
this one has been really bad for a while
2023-12-05 19:28:50 +11:00
Peter Barker 97417a1038 SITL: rename SITL::GPS_GSOF to SITL::GPS_Trimble 2023-11-29 18:04:56 +11:00
Peter Barker 568d633dcc SITL: break up GPS backends into separate files 2023-11-29 18:04:56 +11:00
Ryan Friedman 35b52a4604 SITL: Implement DCOL parser and bidirectional comms
* Implement DCOL command support for GSOF simulator
* Only send GSOF when enabled
* Publish only at the configured rate
* Only build GSOF packets when needed
  * This saves CPU
* Make physics and read loop run at full rate
  * The logic to rate-limit writes is now pushed to the backend
* Indent errors were fixed too

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2023-11-28 15:50:02 +11:00
Ryan Friedman da0efa3323 SITL: Bump up read rate on SITL
* This is needed to do active configuration quickly
* Read/Write split and exposed to ensure physics/write rate is still
  coupled to avoid impacting the jamming and delayed data
* Created a utility to allocate the SITL instance

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2023-11-21 15:29:46 +11:00
Peter Barker afa263c691 SITL: set sitl point for GPS backends in constructor
_sitl is guaranteed non-nullptr by the SITL::GPS::update()
2023-11-18 13:59:28 +11:00
Ryan Friedman 6273fee892 AP_GPS: Rename GSOF packing functions
* Added docs for why they exist

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2023-11-03 13:25:39 +11:00
Anthony Luo 51cbaed9d9 SITL: fix typos 2023-10-05 12:54:43 +11:00
Andrew Tridgell 791d0acefe SITL: removed GPS FIFO 2023-08-24 13:06:40 +10:00
Andrew Tridgell 3e3c086ab7 SITL: build the whole simulator as double precision 2023-08-15 22:39:23 +10:00
Peter Barker 7f8df080f8 SITL: correct compilation for CubeOrange-SimOnHardware
../../libraries/SITL/SIM_GPS.cpp: In member function 'void SITL::GPS::send_gsof(const uint8_t*, uint16_t)':
../../libraries/SITL/SIM_GPS.cpp:1292:24: error: 'AP_InternalError' has not been declared
 1292 |         INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control);
2023-08-11 12:40:59 +10:00
Peter Barker cbd2b199eb SITL: factor simulated GPS 2023-08-11 10:01:56 +10:00
Ryan Friedman 6a2a852450 SITL: Implement GSOF SIM
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2023-08-09 12:26:10 +10:00
Ryan Friedman 843a14ee57 SITL: Add heading and speed_2d utils
* These are also needed by the upcoming GSOF PR

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2023-08-07 08:40:58 -07:00
Andrew Tridgell 217f073165 SITL: added simulated MSP GPS 2023-07-31 14:24:04 +10:00
Ryan Friedman 35dda812ae SITL: Value Semantics for TOW calc
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2023-05-31 15:01:31 +10:00
Andrew Tridgell 7a4483b091 SITL: new XPlane backend
this makes use of DRefs to greatly improve XPlane support. It only
supports XPlane 11 and later

The key change is the use of a JSON file to map ArduPilot output
channels to DataRefs, and map raw joystick inputs to RC inputs

this gets rid of the awful throttle hack handling, and allows for
control of a much wider range of aircraft
2023-01-31 11:22:08 +11:00
Andrew Tridgell 01cad1c4aa SITL: added SIM_GPS_LOG_NUM
for replaying GPS logs recorded with --enable-gps-logging
2022-12-20 10:23:58 +11:00
Andrew Tridgell 78dac16520 SITL: make serial buffer size configurable
we need a larger buffer size for NMEA GPS modules
2022-12-20 10:23:58 +11:00
Tatsuya Yamaguchi ccc5ba3cbd SITL: change HDOP from 2.0 to 1.2 2022-12-19 08:28:45 +09:00
Andrew Tridgell 4b8b2d8236 SITL: support playback of new GPS log format 2022-10-15 17:20:42 +11:00
Peter Barker a56ed66aa3 SITL: make NOVA run at specific baudrate 2022-09-29 20:00:53 +10:00
Peter Barker b360521d0b SITL: permit double-precision maths in SITL even on embedded hardware 2022-03-17 14:39:55 +11:00
Peter Barker 0957131543 SITL: use AP_HAL::micros() for get_wall_time_us 2022-03-17 14:39:55 +11:00
Peter Barker bff0b6f970 SITL: add and use AP_SIM_GPS_FILE_ENABLED 2022-01-15 17:36:22 +11:00
Jaaaky 22e1ea559c SITL: Fix typo (NFC) 2022-01-13 14:01:21 -08:00
Andrew Tridgell df30d4e723 SITL: support interpolated GPS lag
use SIM_GPS_LAG_MS and SIM_GPS2_LAG_MS for the lag in milliseconds
2022-01-12 07:54:46 +11:00
Andrew Tridgell c565b8a84e SITL: support KSXT message for Unicore NMEA 2022-01-11 10:34:11 +11:00
Peter Barker 60453b2250 SITL: quieten MKFIFO warning in case of EEXIST 2021-11-12 09:56:28 +11:00
Peter Barker 306bd0a4ab SIM_GPS: make writing of data w/out byteloss more efficient 2021-11-06 16:56:14 +11:00
Peter Barker a88464c928 SITL: send sv_info from both GPS instances
Without sv_info we don't get the correct ublox type, meaning we get the wrong lag time, meaning EKF2 gets rather more annoyed than it should when we do loops in SITL.
2021-11-05 23:18:11 +11:00
Peter Barker 06c3290e15 SITL: correct buffer over-read in GPS lag simulation 2021-10-21 12:09:21 +11:00
Peter Barker 6c16da21c5 SITL: make simulated GPS work as a SerialDevice 2021-10-21 12:09:21 +11:00
Peter Barker 99e80549b1 SITL: move sitl_gps.cpp to SIM_GPS.cpp 2021-10-21 12:09:21 +11:00