Commit Graph

486 Commits

Author SHA1 Message Date
Andrew Tridgell 4aa78dc891 AP_HAL_SITL: make all semaphores recursive
the cost is very similar and this prevents an easy coding error which
can occur on less used code paths
2020-01-19 20:19:30 +11:00
Andrew Tridgell 28dcca4e1e HAL_SITL: added betaflight-x-rev frame type 2020-01-16 19:13:13 +11:00
Peter Barker f504009287 AP_HAL_SITL: disable SITL stack checking due to memory corruption
There appears to be issues with pthread_attr_setstack.
2020-01-15 19:41:58 +11:00
Peter Barker 3074855ea3 AP_HAL_SITL: correct port numbers in diagnostic output 2020-01-09 09:43:56 +11:00
Peter Barker 0c8e6f212d AP_HAL_SITL: add simulated frsky support 2020-01-08 23:53:48 +11:00
Andy Piper a469a31528 AP_HAL_SITL: prevent dump_stack_trace() blowing up on macOS 2020-01-06 14:57:46 +11:00
Andy Piper 8b0fc1207d AP_HAL_SITL: record throttle value instead of motors on/off 2019-12-31 10:34:02 +11:00
Peter Barker f480df228b AP_HAL_SITL: set cloexec on eeprom.bin 2019-12-02 19:06:34 +11:00
Peter Barker 907977b2f2 AP_HAL_SITL: support for virtual hardware safety switch 2019-11-26 10:14:11 +11:00
Andrew Tridgell b6d1170c2e HAL_SITL: update EFI simulation 2019-11-17 20:10:54 +11:00
Willian Galvani e190d99bc6 SITL: Add 6dof frame for Sub 2019-11-11 07:39:57 -08:00
Peter Barker fdb9fb2f62 AP_HAL_SITL: add support for simulated serial rangefinders
AP_HAL_SITL: add Benewake rangefinder simulator

AP_HAL_SITL: add support for simulated LightWareSerial rangefinder

AP_HAL_SITL: add support for simulated Lanbao rangefinder

AP_HAL_SITL: add support for simulated BLping rangefinder

AP_HAL_SITL: add support for simulated LeddarOne rangefinder

AP_HAL_SITL: add support for simulated uLanding rangefinders

AP_HAL_SITL: add support for simulated MaxsonarSerialLV rangefinders

AP_HAL_SITL: add support for simulated Wasp rangefinders

AP_HAL_SITL: add support for simulated NMEA rangefinders
2019-11-08 20:12:28 +11:00
Peter Barker 9da0e480f2 AP_HAL_SITL: add support for bi-directional simulated serial devices 2019-11-08 20:12:28 +11:00
Mark Whitehorn 3873baf676 AP_HAL_SITL: change in_sensor_config_error to in_config_error 2019-11-08 10:14:34 +11:00
Peter Hall 58d2c9669e AP_HAL_SITL: pass ADSB home location not string 2019-11-05 11:46:59 +11:00
Peter Barker b0f3c89939 AP_HAL_SITL: correct format string 2019-11-05 11:29:08 +11:00
Andrew Tridgell fc4577dce8 HAL_SITL: support simulated serial LEDs 2019-11-04 13:01:59 +11:00
Peter Barker 49687d4e5d AP_HAL_SITL: ToneAlarm doesn't play tones if disabled via param 2019-10-16 16:00:35 +11:00
Peter Barker 111c17d0b4 AP_HAL_SITL: add a simulated buzzer 2019-10-16 16:00:35 +11:00
Andrew Tridgell b9291d95f0 HAL_SITL: pre-fill stack on each loop with NaN
this allows us to catch use of uninitialised stack variables in SITL
without having valgrind running
2019-10-01 17:35:26 +10:00
Peter Barker 045960fe57 AP_HAL_SITL: catch SIGTERM and exit with zero exit status 2019-09-23 19:36:38 +10:00
Andrew Tridgell 85332d49a2 HAL_SITL: added MotorBoat 2019-09-23 17:22:01 +10:00
Andrew Tridgell f86a7d347d Revert "AP_HAL_SITL: set initial PWM values to a flag value"
This reverts commit 1735563bb7.

This commit broke RC input on high channels with sim_vehicle.py, plane
getc RC failsafe immediately
2019-09-15 18:26:50 +10:00
Peter Barker 1735563bb7 AP_HAL_SITL: set initial PWM values to a flag value
These should never be used.  Setting them to a flag value may give a
hint to someone trying to debug a problem in the future.
2019-09-13 08:58:43 +10:00
Peter Barker 15308af230 AP_HAL_SITL: avoid lockstep scheduling issue with semaphores
If there is another thread holding a lock that the main thread wants to
take while pretending to be the IO thread, we will wait forever as we do
not move SITL time forward while pretending to be the IO thread.

This patch simply allows time to move forward if we've failed to take a
semaphore immediately and need to wait.
2019-09-10 21:01:37 +10:00
Randy Mackay 0dd8525c99 AP_HAL_SITL: resolve compiler warning in sitl_airspeed by using fabsf 2019-09-10 09:15:56 +10:00
Andrew Tridgell 5e5c30efe8 HAL_SITL: allow SITL to use SERIALn_PROTOCOL=23
this allows for testing of RC input protocol parsing in SITL
2019-09-06 08:51:45 +10:00
Michael du Breuil 69d3e97533 AP_HAL_SITL: Remove set_stop_pin from AnalogSource 2019-09-04 09:54:50 +10:00
Jaaaky d7abd636ac AP_HAL_SITL: Fix build with --sitl-flash-storage option 2019-08-28 06:23:04 +10:00
Michael du Breuil 2d40250f9b AP_HAL_SITL: Fix bad check order on heap_realloc 2019-08-27 13:54:54 +10:00
Peter Hall 4492c09b3b AP_HAL_SITL: Scheduler skip set stack on Cygwin 2019-08-20 15:59:32 -07:00
mhefny c1c32ab615 AP_HAL_SITL: add Webots support 2019-08-19 19:36:25 +10:00
Peter Barker 94d2ce13d2 AP_HAL_SITL: allow starting location to come from parameters 2019-08-15 18:00:35 +10:00
Peter Barker cdab58d598 AP_HAL_SITL: remove home_str from constructor
No Aircraft was actually using this in the constructor, so it's really
adding overhead for no good reason.
2019-08-15 15:16:11 +10:00
Anthony Velte 5d2f114947 AP_HAL_SITL: Add scrimmage simulator support 2019-08-13 10:07:26 +10:00
Pierre Kancir 1a71519e17 AP_HAL_SITL: add missing header 2019-08-06 09:37:30 +10:00
Rajat Singhal 4d1f4f3386 HAL_SITL: enable airsim SITL backend 2019-07-17 07:26:50 +10:00
Grant Morphett fdcdbddecc AP_HAL_SITL: Send NMEA GPHDT sentence if enabled.
and add VTG message
2019-07-13 11:05:57 +10:00
Andrew Tridgell ac7a67fda0 HAL_SITL: added uartH 2019-07-12 17:01:21 +10:00
Peter Barker 848a70acd4 AP_HAL_SITL: fix rebooting while in sensor config error loop 2019-07-09 10:01:23 +10:00
Peter Barker fe8d631964 AP_HAL_SITL: ensure termination of readlink-derived progname 2019-07-08 13:18:22 +10:00
U-REDMOND\akolobov 6dd906f07f HAL_SITL: Integrating Silent Wings SITL with the sim_vehicle 2019-07-08 09:32:59 +10:00
Peter Barker 39b17e42d0 AP_HAL_SITL: add missing include for AP_BoardConfig.h 2019-07-04 13:57:40 +10:00
Michael du Breuil a6623bfad3 AP_HAL_SITL: Fix missing include for logger.h 2019-06-27 14:56:21 +10:00
Michael du Breuil 75c62154b5 AP_HAL_SITL: Add missing override declarations 2019-06-18 00:06:32 -07:00
Peter Barker ccbf3234f7 AP_HAL_SITL: return RC protocol being decoded 2019-06-18 11:35:38 +10:00
Peter Barker c59dde78c6 AP_HAL_SITL: dump stack trace as part of panic() 2019-06-13 09:25:42 +10:00
Peter Barker dd68b14f46 AP_HAL_SITL: move dump_strack_trace into HAL 2019-06-13 09:25:42 +10:00
Peter Barker e061df0f6d AP_HAL_SITL: attempt to dump stack trace as part of segv handler 2019-06-07 22:03:41 +10:00
Andrew Tridgell 02403d9b93 HAL_SITL: added support for exit on panic()
used by autotest server
2019-06-07 20:33:13 +10:00
Francisco Ferreira 0e33907cf7 AP_HAL_SITL: change NMEA output to use new macro 2019-05-21 09:41:15 +10:00
Peter Barker 0a3fe32209 AP_HAL_SITL: log watchdog reset 2019-05-16 17:21:24 +10:00
Andrew Tridgell f8bcdf9d3a HAL_SITL: fixed cygwin build error 2019-05-15 15:33:48 +10:00
Andrew Tridgell c1b201d051 HAL_SITL: fixed comment typo 2019-05-15 15:33:48 +10:00
Andrew Tridgell 916b3003e1 AP_HAL_SITL: removed unusued AP_Common/Semaphore.h 2019-05-15 15:33:48 +10:00
Andrew Tridgell 0873e54cc0 HAL_SITL: fixed build error 2019-05-15 15:33:48 +10:00
Andrew Tridgell 6897cecea2 HAL_SITL: support watchdog reset in SITL
this only works for speedup 1, and does not initialise the physics
models correctly for internal models
2019-05-15 15:33:48 +10:00
Peter Barker 900d9f71f6 AP_HAL_SITL: stop taking address of packed members 2019-05-01 19:36:49 -07:00
Peter Barker 0dd71e7b3a AP_HAL_SITL: Bitmask is now a template 2019-04-16 15:12:07 +10:00
Andrew Tridgell 7a70a888b5 HAL_SITL: added empty flash driver 2019-04-11 13:22:53 +10:00
Michael du Breuil a8a71db258 AP_HAL_SITL: Correct range check on UART ports
Coverity CID 308362
2019-04-09 13:01:33 +10:00
Pierre Kancir a700b647db AP_HAL_SITL: fix ‘heap’ shadowing 2019-04-08 08:02:40 -07:00
Tom Pittenger c39cc7dbb8 AP_HAL_SITL: rename dataflash to logger and refactor the filename logger.bin 2019-03-28 16:40:58 +11:00
Peter Barker 26c01accb9 AP_HAL_SITL: remove unused from method 2019-03-23 11:23:07 +11:00
Peter Barker a1088f6cd6 AP_HAL_SITL: add support for ToneAlarm via sfml 2019-03-23 07:10:50 +11:00
Peter Barker fa082df040 AP_HAL_SITL: add missing CLOEXECs on tcp ports 2019-03-13 18:02:48 +11:00
Peter Barker be5478902c AP_HAL_SITL: add precland object 2019-03-01 20:28:22 +11:00
Peter Barker a7589a4aed AP_HAL_SITL: correct comparison between signed and unsigned
Closes #10637
2019-02-26 19:51:04 +11:00
Peter Barker 80e8f9cdd8 AP_HAL_SITL: read all available SITL RC input packets
MAVProxy runs on its own clock.  While our clock is stopped for whatever
reason MAVProxy will continue to send RC input.  This patch always gives
us the most recent RC input from MAVProxy.

Also add sanity check on packet received
2019-02-26 14:17:21 +11:00
Peter Barker 03e9becfcf AP_HAL_SITL: add missing override keywords 2019-02-22 15:01:09 +00:00
Peter Barker 556e836a66 AP_HAL_SITL: cast PTHREAD_STACK_MIN to unsigned
Sometimes this comes in as signed...
2019-02-20 15:06:24 +11:00
Peter Barker 17589ae3b9 AP_HAL_SITL: allow testing of throttle-goes-to-low-fixed-value rc failsafes 2019-02-14 11:49:59 +11:00
Tom Pittenger 81df9aaeb4 AP_HAL_SITL: unify singleton naming to _singleton and get_singleton() 2019-02-10 19:09:58 -07:00
Andrew Tridgell d4a564843e HAL_SITL: support new motor orders 2019-02-06 11:17:35 +11:00
Andrew Tridgell d176776357 HAL_SITL: support limiting baudrate of simulated telemetry 2019-01-27 08:56:12 +11:00
Andrew Tridgell 751dade9a8 HAL_SITL: enable optional storage in flash
this brings storage in SITL very close to storage in ChibiOS
2019-01-21 20:59:00 +11:00
Peter Barker 9253e9b381 AP_HAL_SITL: add simulated parachute 2019-01-09 13:16:03 +11:00
Michael du Breuil a2b924d810 AP_HAL_SITL: Add scripting heap 2018-12-31 19:25:23 -07:00
Andrew Tridgell a611803b6d HAL_SITL: fixed valgrind error in NOVA GPS 2018-12-30 18:33:27 +11:00
Peter Barker 3d08d02a66 AP_HAL_SITL: reorder setting SO_REUSEADDR and binding rc in port
This stops things failing on cygwin, and may explain rebind failures we
see in SITL.
2018-12-19 16:03:08 +00:00
Pierre Kancir a5e5ee73eb AP_HAL_SITL: correct battery setup for rover 2018-12-18 14:36:32 +09:00
Peter Barker e420f62b62 AP_HAL_SITL: check to see if setting socket and fd options worked 2018-12-18 08:51:01 +11:00
Andrew Tridgell 4c74d32ef3 HAL_SITL: fixed cygwin build of sitl
this is needed for windows SITL build
2018-12-11 09:44:05 +11:00
Andrew Tridgell 73672c90d1 HAL_SITL: added support for multicast UDP connections
this allows several copies of SITL to see each other on the same
network, emulating a mesh network, which is useful for swarm testing
2018-12-06 11:12:40 +11:00
Andrew Tridgell 50018d7a7c HAL_SITL: use mavlink_packetise() 2018-12-06 11:12:40 +11:00
Andrew Tridgell 9f8f36aad8 HAL_SITL: added udpclient support
this allows direct UDP output from SITL
2018-12-06 11:12:40 +11:00
Andrew Tridgell d46c48e28c HAL_SITL: enable morse simulator backend 2018-12-04 09:44:50 +11:00
Andrew Tridgell c72f2e57b0 HAL_SITL: fixed build on older MacOS 2018-11-30 11:03:09 +11:00
Andrew Tridgell 8c9e9bd415 HAL_SITL: implement get_system_id() 2018-11-29 16:36:29 +11:00
Kristian Klausen d7f529d3c6 AP_HAL_SITL: Use double point precision when converting langitudes and longitudes from degrees to radians.
See #9536
2018-11-15 11:22:56 +11:00
Eugene Shamaev 3794f9d51e HAL_SITL: SITL weight on wheels 2018-11-09 14:35:14 +11:00
Peter Barker fdfe5ac75a AP_HAL_SITL: add override keyword where required 2018-11-08 11:30:12 +11:00
Andrew Tridgell 5480479e73 HAL_SITL: fixed SITL example progs 2018-11-07 07:35:45 +11:00
Andrew Tridgell 7e790a04d2 HAL_SITL: increase max timer procs
needed for compass learning
2018-10-24 07:25:42 +10:00
Andrew Tridgell 44009c5459 HAL_SITL: removed hal.util->new_semaphore()
replaced with HAL_Semaphore
2018-10-17 12:54:22 +11:00
Randy Mackay ada073fbdc AP_HAL_SITL: add sailboat to SITL_cmdline.cpp 2018-09-26 12:00:13 +09:00
Peter Barker d6fe9d47e0 AP_HAL_SITL: check return value from posix_memalign
Avoids return-value-must-be-checked compiler warning
2018-09-04 09:22:18 +10:00
Peter Barker e7e2a78d35 AP_HAL_SITL: remove pointless attach_interrupt override 2018-08-31 08:32:08 +10:00
Peter Barker d968e27b45 AP_HAL_SITL: eliminate float-equals issues 2018-08-28 09:54:47 +10:00
Patrick José Pereira fb7c46bda0 AP_HAL_SITL: Remove unused check
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2018-08-27 23:35:34 +01:00
Pierre Kancir 7d9c947b9b AP_HAL_SITL: update parameter with using command line speedup option 2018-08-28 07:26:26 +10:00
Andrew Tridgell edeab9d152 HAL_SITL: support HAL_Semaphore_Recursive 2018-08-25 15:44:36 +10:00
Patrick José Pereira ab31fcb8f4 AP_HAL_SITL: Makes scheduler compile under Mac OS
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2018-08-25 11:25:17 +10:00
Peter Barker 5180e025bb AP_HAL_SITL: attach_interrupt now takes a functor
AP_HAL_SITL: add type-safety for interrupt types
2018-08-21 20:34:01 +09:00
Andrew Tridgell 836176297d HAL_SITL: added stack checking to SITL 2018-08-20 13:49:14 +10:00
Andrew Tridgell 5d3b17db6b HAL_SITL: added support for HAL_Semaphore type 2018-08-16 12:40:10 +10:00
Francisco Ferreira 350d03800f
AP_HAL_SITL: remove unused CAN header 2018-08-12 13:35:01 +01:00
Pierre Kancir 96c54550e5 AP_HAL_SITL: rearrange Grippers and Sprayers in SITL
Adds parameters to configure and disable
2018-07-31 23:34:43 +10:00
Andrew Tridgell b130036798 HAL_SITL: use SIM_RC_CHANCOUNT 2018-07-24 19:44:03 +10:00
Peter Barker fdd111a24d AP_HAL_SITL: move include for pthread.h
We need pthread_t for a member
2018-07-19 10:27:47 +10:00
Michael du Breuil 1ac78d3a80 AP_HAL_SITL: Remove GPIO::analogPinToDigitalPin() 2018-07-11 23:09:52 -07:00
Andrew Tridgell 10e9182c21 HAL_SITL: fixed delay() for SITL threads
with the new thread_create() interface we need to handle delays a bit
differently
2018-07-12 15:04:43 +10:00
Andrew Tridgell 3fc6968700 HAL_SITL: allow delay from other than main thread 2018-07-09 19:41:18 +10:00
Andrew Tridgell 88842adbd5 HAL_SITL: implement thread_create() API 2018-07-09 19:41:18 +10:00
Peter Barker be19ae41d4 AP_HAL_SITL: increase debug for SIM connections 2018-06-30 10:11:10 +10:00
Peter Barker c5d13847b2 AP_HAL_SITL: set cloexec on sitl-gps file descriptors 2018-06-29 21:53:14 +10:00
Peter Barker e577a5564f AP_HAL_SITL: correct segfault when uartg configured 2018-06-29 18:47:30 +10:00
Peter Barker ed724bc2be AP_HAL_SITL: strip -w parameter on SITL reboot 2018-06-29 10:54:27 +10:00
Andrew Tridgell 5862138a4b HAL_SITL: support uartG 2018-06-29 08:17:38 +10:00
Ebin a40de48809 AP_HAL_SITL: added BalanceBot to SITL_cmdline 2018-06-28 21:55:20 +09:00
Michael du Breuil 8680f1ab52 AP_HAL_SITL: Clear UART buffers when opening a port 2018-06-26 02:18:18 +01:00
Patrick José Pereira cd5c59773b AP_HAL_SITL: Use SITL, baro, INS and compass singletons
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2018-06-26 00:02:01 +01:00
Patrick José Pereira a4d8ed4b75 AP_HAL_SITL: Use reinterpret_cast with AP_Param::find_object
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2018-06-26 00:02:01 +01:00
Francisco Ferreira 5de516dd6a
AP_HAL_SITL: remove underscore prefix for local variables 2018-06-20 16:38:52 +01:00
Francisco Ferreira 06c41bc768
AP_HAL_SITL: re-use unused FDM address option for FG view IP address 2018-06-20 16:38:52 +01:00
Francisco Ferreira 46868409ec
AP_HAL_SITL: remove unused code 2018-06-20 16:38:52 +01:00
Peter Barker f2a842e415 AP_HAL_SITL: set_cloexec on SITL's RCIN port 2018-06-19 09:14:28 +10:00
Peter Barker 574a2b3652 AP_HAL_SITL: set cloexec on port 5760 2018-06-19 09:14:28 +10:00
Peter Barker 00153f513c AP_HAL_SITL: use OS clock for get_hw_rtc 2018-06-15 08:01:22 +10:00
Carlos Martínez Úbeda 30e0c7f746 AP_HAL_SITL: use FD_CLOEXEC instead of linux SOCK_CLOEXEC for socket 2018-06-10 19:15:50 +01:00
Michael du Breuil 0f2482f05b AP_HAL_SITL: Remove timer process suspension interface 2018-06-06 07:16:58 +10:00
Michael du Breuil 9c288df8d7 AP_HAL_SITL: Remove RC overrides 2018-06-05 09:51:09 +10:00
Pierre Kancir b615677223 HAL_SITL: implement reboot support 2018-05-30 18:48:53 +10:00
Pierre Kancir 7732b41186 AP_HAL_SITL: fix static member access through instance 2018-05-30 18:48:53 +10:00
Pierre Kancir f986f1366f AP_HAL_SITL: set close-on-exec flag on uart socket 2018-05-30 18:48:53 +10:00
Patrick José Pereira b014b6c857 AP_Baro: Use SSL variables
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2018-05-23 02:36:43 +01:00
Andrew Tridgell 049e3ae02d HAL_SITL: take account of available bytes in receive_time_constraint_us 2018-05-21 14:53:18 +10:00
Andrew Tridgell 4e452c77f8 HAL_SITL: implement UART timestamp API 2018-05-16 18:49:22 +10:00
Michael du Breuil 97696281ae AP_HAL_SITL: Remove set_overrides() method 2018-05-11 12:13:39 +01:00
Andrew Tridgell f8464577ac Revert "SITL: Instance number change MavID"
This reverts commit 507f4d688b.

This broke normal usage of sim_vehicle.py
2018-05-10 09:56:38 +10:00
Pierre Kancir 507f4d688b SITL: Instance number change MavID 2018-05-09 22:00:42 +10:00
Peter Barker 190bd18769 AP_HAL_SITL: move delay callback handling to base HAL Scheduler class 2018-05-09 16:15:38 +10:00
Eugene Shamaev 5d4579a086 AP_HAL_SITL: add wind type parameters 2018-05-02 07:32:25 -07:00
Peter Barker 1eecf07e68 AP_HAL_SITL: use a 16-bit mask for GPIO out
This allows Relay pins to be represented (typically pin 13)
2018-04-18 20:31:55 +09:00
Peter Barker 4db9a5e6fe AP_HAL_SITL: remove cast to signed type
... we're currently taking an unsigned type, casting it to a signed type
and then comparing the result of that to an unsigned type.  That's
unhealthy.
2018-04-03 13:08:56 +01:00
Peter Barker 7d271e0f3c AP_HAL_SITL: check return value of setsockopt 2018-04-02 09:23:27 +09:00
Michael du Breuil 5bd4091976 AP_HAL_SITL: Protect against nullpointer dereference 2018-03-31 16:15:48 +09:00
Michael du Breuil 8dd55a85cd SITL: Create a second voltage to monitor for battery voltages 2018-03-27 22:12:21 +01:00
Peter Barker 85b41a8abb AP_HAL_SITL: add vicon-over-mavlink support 2018-03-27 20:28:51 +09:00
Peter Barker 1151d76345 AP_HAL_SITL: sim: namespace for specifying SITL devices from cmdline 2018-03-27 20:28:50 +09:00