Commit Graph

639 Commits

Author SHA1 Message Date
Peter Barker d626197c0b AP_HAL_SITL: add and use a "bool read(c)" method to AP_HAL
this is much less likely to not work vs the int16_t equivalent
2023-03-22 17:59:11 +11:00
Samuel Tabor 49fb4f37c5 SITL: Send VCAS in Flightgear packet. 2023-02-20 05:37:21 -08:00
Peter Barker ffa43c1b71 AP_HAL_SITL: avoid using struct Location
clang reports this could be a problem when compiling under some EABIs.  Remove it from most places as it is just noise, replace with class where we want to avoid including Location.h
2023-02-04 22:51:54 +11:00
Andrew Tridgell b43701fffa HAL_SITL: exit on close of port 0 on cygwin
this fixes a long standing problem with SITL not exiting when you
close connection in MissionPlanner
2023-01-24 15:48:04 +11:00
Ian 636f9bffa9 AP_HAL_SITL: Add new SITL driver for Webots 2023a
The new SITL driver is based on the existing SITL driver for Gazebo and
does not require a JSON parser and implements set_interface_ports.
2023-01-22 18:19:38 +11:00
Peter Barker ccf290246c AP_HAL_SITL: use parameter to enable/disable SITL ESC telem
this is the perfect telemetry stream; we don't want to override other telemetry streams
2023-01-18 18:07:23 +11:00
Peter Barker 6c03134169 AP_HAL_SITL: use AP_CSVReader to read from Log serial-async dump 2023-01-17 11:21:48 +11:00
Andrew Tridgell 12c24df476 AP_HAL_SITL: added old_size to heap_realloc 2023-01-16 09:19:16 +11:00
Andrew Tridgell a2b0bbffdb HAL_SITL: implement SIM_UART_LOSS 2023-01-15 21:57:15 +11:00
Peter Barker c728483a7e AP_HAL_SITL: add option to create uart connection to file 2023-01-04 12:29:49 +11:00
Andy Piper 5ea3415a41 AP_HAL_SITL: allow SITL sketches to run
allow sketchname to be set
2022-12-28 18:14:56 +11:00
Andrew Tridgell 21b4a19c6f HAL_SITL: implement CAN get_statistics() 2022-12-13 16:56:57 +11:00
Andrew Tridgell 1c554ccc24 HAL_SITL: only do the cygwin speedup hack for scripting while armed
this stops us chewing lots of CPU while disarmed, and also stops the
logging thread from chewing a lot of CPU
2022-11-10 12:12:03 +11:00
Andrew Tridgell 1488edb1d8 HAL_SITL: fixed sleep time with speedup
and removed sleep in threads for cygwin, as granulatity of sleep is
too high, resuling in very poor lua performance
2022-11-07 21:22:43 +11:00
Peter Barker e7d30aefec AP_HAL_SITL: include required AP_Vehicle_Type header 2022-11-02 18:35:48 +11:00
Andrew Tridgell 1871c6bef7 HAL_SITL: use motor mask for noise checking for motors 2022-10-16 20:38:19 +11:00
Peter Barker 0d5d9c04f0 AP_HAL_SITL: SITL SerialDevice optionally checks baudrates match 2022-09-28 20:53:34 +10:00
Yuri 20f0fd0589 AP_HAL_SITL: increase short board names to 23 chars 2022-09-21 17:56:42 +10:00
murata 64c60c8149 AP_HAL_SITL: Accurate 10 counts 2022-09-16 08:53:16 +10:00
Peter Barker fb3a7d0d10 AP_HAL_SITL: do not return from reboot command
This structure was set up to mimic the should_exit code originally from the Linux HAL.  It runs contrary to the intent of the HAL reboot call, which is not expected to return.  This oddity leads us to emit wo acks sequentially, one success, one failure, which is just weird.
2022-09-14 21:23:18 +10:00
Andrew Tridgell 53997a284b AP_HAL_SITL: fixes from --ubsan autotest 2022-09-06 10:49:50 +10:00
Jeffrey Laut 3133aff352 SITL: fix simulated RC failure while receiving RC overrides 2022-09-02 12:08:34 +10:00
Peter Barker 1c7e2f5094 AP_HAL_SITL: correct bind-value SIM_RC_FAIL handling
If SITL is not receiving any sitl rc input (so _sitl_rc_in.recv(...) is allways returns -1 then the bind-values code would never be crossed so the RC input values would remain at their initialisation values rather than honouring the SIM_RC_FAIL setting which says they should go to bind values (notably throttle-to-950)
2022-08-10 17:14:21 +10:00
Henry Wurzburg e682296b58 AP_HAL_SITL: add TeraRange Neo Rangefinder 2022-08-09 09:01:34 +10:00
bugobliterator 8e81ee0292 AP_HAL_SITL: add support for starting node in maintenance mode 2022-07-27 18:18:03 +10:00
Andrew Tridgell 9b0c8674d6 HAL_SITL: catch ubsan errors into a log file 2022-07-12 11:00:08 +10:00
Andrew Tridgell f55aadfedf HAL_SITL: fixed undefined behaviour in GPIO 2022-07-12 11:00:08 +10:00
Andy Piper 061ddf7a3f AP_HAL_SITL: save a sliding window of frequency bins 2022-06-01 15:49:32 +01:00
Iampete1 031115577a AP_HAL_SITL: enable 32 servo outs 2022-05-22 12:07:37 +10:00
Clyde McQueen 25fd69b947 AP_HAL_SITL: init ArduSub pwm_output to [1500, ...]
Signed-off-by: Clyde McQueen <clyde@mcqueen.net>
2022-05-19 07:53:52 +10:00
Andrew Tridgell 7dc5da1247 HAL_SITL: cleanup SITL airspeed handling
fixed handling of EAS2TAS, and fixed ratio per sensor.

Removed the wind delay code (which was never being used). We should
add a generic delay filter if we need this again
2022-05-17 19:34:32 +10:00
Andrew Tridgell a6cd7ffd20 HAL_SITL: fixed warning 2022-05-06 06:55:16 +10:00
Andy Piper 3199412bff AP_HAL_SITL: add vector addition function 2022-05-04 17:05:51 +10:00
Andy Piper 63229d7eca AP_HAL_SITL: correct disable channel maths
unilaterally write rcoutput to appease the sitl gods
2022-03-29 10:29:31 +11:00
Andrew Tridgell f8aa4623ef HAL_SITL: don't use terrain adjustment 2022-03-28 16:01:21 +11:00
bugobliterator bd2bf7fedc AP_HAL_SITL: add support for CANFD in SITL 2022-03-27 06:07:34 -07:00
Andrew Tridgell 535d7f0d85 AP_HAL_SITL: removed terrain home correction 2022-03-10 07:34:20 +11:00
Andrew Tridgell 5eb8b8d72e HAL_SITL: support mavcan message forwarding 2022-02-12 16:36:05 +11:00
Andrew Tridgell 9fd25907e2 HAL_SITL: fixed mapping of --serial ports in SITL
uart paths are still in uartABCD order
2022-01-21 10:07:55 +11:00
Peter Barker ee341bc4eb SITL: add compilation option AP_SIM_CRSF_ENABLED 2022-01-15 21:56:33 +11:00
Peter Barker 08b8d3ad34 AP_HAL_SITL: correct compilation when SIM options disabled
AP_HAL_SITL: use AP_ASIM_GIMBAL_ENABLED

AP_HAL_SITL: use AP_SIM_ADSB_ENABLED

AP_HAL_SITL: use AP_SIM_RPLIDARA2_ENABLED

AP_HAL_SITL: use AP_SIM_PS_LIGHTWARE_SF45B_ENABLED

AP_HAL_SITL: use AP_SIM_PS_TERRARANGERTOWER_ENABLED

AP_HAL_SITL: use AP_SIM_AIS_ENABLED

AP_HAL_SITL: use AP_SIM_JSON_MASTER_ENABLED
2022-01-15 17:37:24 +11:00
Pierre Kancir 6584fef711 AP_HAL_SITL: catch more signal for correct exit
SIGINT is for ctrl-c
SIGHUP and SIGQUIT are use within term. If the term close before SITL, it will trigger one of those and then exit cleanly anyway
2022-01-12 12:31:56 +11:00
Shiv Tyagi af950e266b AP_HAL_SITL: add dataflash to spi device table
We simulate jedec flash for logging. Hence, we need to add dataflash to device table. Also, we need to remove HAL_LOGGING_SITL_ENABLED since we no longer need it

Co-Authored-By: Divyateja Pasupuleti <divyateja2004@gmail.com>
2021-12-25 09:14:31 +11:00
Andy Piper fa91e74fde AP_HAL_SITL: remove redundant harmonics from DSP 2021-12-22 18:13:38 +11:00
Peter Barker fbe46f400f AP_HAL_SITL: stop passing home_str to _sitl_setup
This is poked into the model now
2021-12-13 09:30:33 +11:00
Peter Barker 2f77fef10e AP_HAL_SITL: permit float-equal while we do comparison vs INFINITY 2021-12-13 08:38:17 +11:00
Peter Barker acbe567202 AP_HAL_SITL: consolidate rangefinder range calculations 2021-12-11 20:10:10 +11:00
Peter Barker 6e8c7c6b03 AP_HAL_SITL: remove unused mag-data delay buffer state variables
This delay buffer code is now in AP_Compass_SITL
2021-12-07 16:41:11 +11:00
Peter Barker cce14d8461 AP_HAL_SITL: remove unused _home_str member 2021-12-07 09:36:22 +11:00
Peter Barker 8cc7f51de1 AP_HAL_SITL: tidy set/get of hw RTC 2021-12-06 12:58:43 +11:00
Peter Barker 11cbd68296 AP_HAL_SITL: remove incorrect use of ARRAY_SIZE
This was converted to a linked list....
2021-11-24 18:26:17 +11:00
Peter Barker cdccc67fb8 AP_HAL_SITL: make SITL::ADSB a SITL::SerialDevice 2021-11-23 11:09:29 +11:00
Andrew Tridgell 3b3abdeef0 AP_HAL_SITL: support up to 9 UARTs 2021-11-22 22:48:59 +11:00
Peter Barker eb6da9512f AP_HAL_SITL: quieten i2c-device-creation diagnostics 2021-11-12 10:17:28 +11:00
bugobliterator 09096cb355 AP_HAL_SITL: add get_storage_ptr method 2021-11-10 17:21:35 +11:00
Peter Barker 9ebd0cdeed AP_HAL_SITL: use SITL::SerialDevice in place of pipe for communication 2021-11-06 16:54:07 +11:00
Peter Barker 02dc42275c AP_HAL_SITL: remove unused/unimplemented methods/vars, tidy namespacing 2021-10-28 09:09:44 +11:00
Andrew Tridgell 8192661042 AP_HAL_SITL: rename uLanding simulation to USD1 2021-10-26 15:31:12 +11:00
Peter Barker cf9bbb570c AP_HAL_SITL: correct nullptr check on simulated mavlink rangefinder
Obvious copy/paste error
2021-10-22 21:46:01 +11:00
Peter Barker 1ab8a3e3aa AP_HAL_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
Stephen Dade 1356beb14d AP_HAL_SITL: Add instance to ADSB simulation 2021-10-20 20:21:33 +11:00
Peter Barker 21030c4e83 AP_HAL_SITL: remove written-only AP::sitl().update_rate_hz 2021-10-20 19:07:17 +11:00
Peter Barker 8c9ade3f7f AP_HAL_SITL: move simulated megasquirt to SerialDevice framework 2021-10-17 10:00:08 +11:00
Asa Davis 85fbbe0704 SITL: add simulator for LORD Microstrain serial EAHRS 2021-10-17 08:55:03 +11:00
Peter Barker f5d5387358 AP_HAL_SITL: remove unused ext_fifo_fd member variable 2021-10-12 20:07:19 +11:00
Peter Barker 67226433e3 AP_HAL_SITL: add simulated RAMTRON device 2021-10-12 20:01:49 +11:00
Peter Barker 58a7f022fd AP_HAL_SITL: add simulated SPI devices 2021-10-12 20:01:49 +11:00
Peter Barker d98cda12c6 AP_HAL_SITL: remove HIL_MODE vestiges 2021-10-12 08:57:05 +11:00
Peter Barker 521918d74c SITL: remove set-but-not-used _framerate member variable 2021-10-08 14:23:18 +11:00
Iampete1 9f04cded3b AP_HAL_SITL: AnalogSource: return bool for set_pin 2021-10-06 18:42:51 +11:00
Peter Barker 402669f269 AP_HAL_SITL: add and use HAL_SITL &hal_sitl
analogous to our normal "extern hal" stuff but removes need for casting
2021-10-05 22:24:38 +11:00
Peter Barker 3292128531 AP_HAL_SITL: allow for selection of Storage backend type at runtime 2021-10-05 10:16:54 +11:00
Andrew Tridgell 9a29f2558c HAL_SITL: fixed cygwin build
cygwin does not handle panic being weak, it gets a link error
2021-10-03 14:00:34 +11:00
Peter Barker 6bd2bc2179 AP_HAL_SITL: remove mtk GPSs
These are ancient and of very poor quality.
2021-09-29 17:28:59 +10:00
Josh Henderson 328cf01436 AP_HAL_SITL: make panic() WEAK 2021-09-28 09:11:48 +10:00
Peter Barker 9c24916115 AP_HAL_SITL: move from HAL_NO_GCS to HAL_GCS_ENABLED 2021-09-22 21:37:00 +10:00
Andrew Tridgell f77e64ac83 HAL_SITL: Fixed default PWMs for blimp 2021-09-18 08:26:23 +10:00
Peter Barker ae40531cd7 AP_HAL_SITL: make heli-blade simulation work 2021-09-08 14:33:19 +10:00
Peter Barker 129eb4c184 AP_HAL_SITL: do not overwrite FETTecESC telemetry data w/SITL ESC data 2021-09-01 18:25:51 +10:00
Pierre Kancir aebe2beba5 AP_HAL_SITL: check that _sitl is not nullptr before using it 2021-08-14 10:20:33 +10:00
Pierre Kancir c91c570814 AP_HAL_SITL: don't use timer_event() that is static from the _scheduler instance 2021-08-14 10:20:33 +10:00
Peter Barker 26f2393014 AP_HAL_SITL: add simulated FETtec ESC 2021-08-13 16:22:37 +10:00
Iampete1 6deacda180 AP_HAL_SITL: load SIM_AIS 2021-08-10 08:11:18 +09:00
bugobliterator 26e2a4a3cb AP_HAL_SITL: change class name from SITL::SITL to SITL::SIM 2021-08-05 07:25:31 +10:00
Iampete1 5ff0f42372 AP_HAL_SITL: add slave JSON instances 2021-08-03 09:22:19 +10:00
Andrew Tridgell 9b78fa7fb8 HAL_SITL: implement valid_pin() 2021-07-22 07:48:12 +10:00
Andrew Tridgell 7550368fc7 HAL_SITL: update for changed SITL API 2021-07-14 17:34:40 +10:00
Peter Barker a52e823967 AP_HAL_SITL: implement read(buf, length) 2021-07-12 12:11:30 +10:00
Peter Barker 7a9dd8127a AP_HAL_SITL: generate a core file for a given PID
Similarly to dumpstack.sh, uses gdb to dump a core file
2021-07-08 15:46:07 +10:00
Siddharth Purohit 1082046134 AP_HAL_SITL: add support for hw random number generation 2021-07-07 18:57:25 +10:00
Siddharth Purohit f0cfaa17dc AP_HAL_SITL: add empty qspi mgr instance 2021-06-30 19:33:17 +10:00
Peter Barker 67ebdc300b AP_HAL_SITL: reduce scope of loop variable 2021-06-27 10:57:07 +10:00
Andrew Tridgell 3fc88b19b8 HAL_SITL: implement initial GPS position offsets 2021-06-24 21:34:30 +10:00
Siddharth Purohit 81f6e3c585 AP_HAL_SITL: Use HAL_CANMANAGER_ENABLED instead of HAL_ENABLE_LIBUAVCAN_DRIVERS 2021-06-24 09:02:42 +10:00
Peter Barker d9e3526bd2 AP_HAL_SITL: correct compilation for mission pread/pwrite ret check 2021-06-12 16:02:51 +10:00
Tom Pittenger aec9d45573 AP_HAL_SITL: use HAL_ENABLE_LIBUAVCAN_DRIVERS instead of HAL_MAX_CAN_PROTOCOL_DRIVERS 2021-06-09 18:36:18 +10:00
Patrick José Pereira b608ceb6ed AP_HAL_SITL: Return zero when using the help command
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2021-05-29 11:27:37 +10:00
Peter Barker c326cdb1ca AP_HAL_SITL: move from HAL_NO_LOGGING to HAL_LOGGING_ENABLED 2021-05-19 17:38:47 +10:00
Andrew Tridgell 7c7d58d2a0 HAL_SITL: fixed constructoring ordering bug in AP_ESC_Telem
on cygwin RCOutput was being constructed before AP_ESC_Telem, leading
to a panic
2021-05-13 10:21:03 +09:00