Commit Graph

1187 Commits

Author SHA1 Message Date
Andrew Tridgell 9225b9f76d SITL: added 4 motor tilt vectored quadplane
from 2 motors tilt for "quadplane-tilt". This is the most common tilt
quadplane setup
2024-02-18 16:28:43 +11:00
Andrew Tridgell 388b04d671 SITL: fixed SITL for tilted motors
vector math was done in the wrong order
2024-02-18 16:28:43 +11:00
Richard Marko 04b46678a4 treewide: fix shebangs - /bin/bash -> /usr/bin/env bash
Most scripts/tools use non-portable `/bin/bash`, switch
to environment agnostic `/usr/bin/env bash`.
2024-02-13 11:36:23 +11:00
Peter Barker 2761a528f3 SITL: remove unused include of AP_Stats.h 2024-01-30 11:12:21 +11:00
Andrew Tridgell b051719836 SITL: fixed name of pitch limit parameters 2024-01-23 15:00:30 +11:00
Andrew Tridgell 315f4963cc SITL: fixed parameter names 2024-01-23 15:00:30 +11:00
Andrew Tridgell 15a9909127 SITL: tidy TRIM_PITCH to PTCH_TRIM_DEG 2024-01-23 15:00:30 +11:00
Andrew Tridgell 04d72d3adc SITL: convert param files for LAND_PITCH_DEG 2024-01-23 15:00:30 +11:00
Andrew Tridgell bea9102d72 SITL: convert param files LIM_ROLL_CD -> ROLL_LIMIT_DEG 2024-01-23 15:00:30 +11:00
Andrew Tridgell 74e455ef6a SITL: convert param files for pitch limits 2024-01-23 15:00:30 +11:00
Andrew Tridgell d0757b5aec SITL: param rename for CRUISE_ALT_FLOOR 2024-01-23 15:00:30 +11:00
Andrew Tridgell 54f38b7570 SITL: convert ALT_HOLD_RTL and ALT_HOLD_FBWCM 2024-01-23 15:00:30 +11:00
Andrew Tridgell a87dea0139 SITL: convert ARSPD_FBW_MIN/MAX to AIRSPEED_MIN and AIRSPEED_MAX 2024-01-23 15:00:30 +11:00
Andrew Tridgell c3ae310d4c SITL: converted TRIM_ARSPD_CM to AIRSPEED_CRUISE 2024-01-23 15:00:30 +11:00
Tim Tuxworth 426f645f5e SITL: convert TRIM_PITCH_CD to TRIM_PITCH_DEG 2024-01-23 15:00:30 +11:00
Peter Barker 76eb1b43e4 SITL: rename COMPASS_TYPEMASK to COMPASS_DISBLMSK
this is a very confusingly named parameter.  I've seen several instances of people treating this as an enable mask rather than a disable mask
2024-01-23 11:54:49 +11:00
Peter Barker e8708227a1 SITL: new Loweheiser generator/efi sim
Co-authored-by: Joshua Henderson <hendjoshsr71@gmail.com>

SITL: break out common GeneratorEngine code
2024-01-23 11:27:30 +11:00
Peter Barker bddb9aaac7 SITL: add ASSERT_STORAGE_SIZE macro
saves havin gto name the dummy variable yourself
2024-01-22 22:44:05 +11:00
Peter Barker dec618645d SITL: add support for simulated QMC5883L compass 2024-01-22 19:15:08 +11:00
Peter Barker 5ae4355e26 SITL: correct compilation when HAL_LOGGING_ENABLED is false 2024-01-17 18:25:55 +11:00
Jacob Olson 689a5c7b52 SITL: SIM_Frame: fixed per_motor_vars config loading 2024-01-09 10:53:33 +11:00
Peter Barker 3a37796eb2 SITL: move simulated height_agl into fdm structure
allows value to be shipped via multicast to simulated peripherals
2024-01-08 20:00:01 +11:00
Andrew Tridgell 6c88111267 SITL: fixed build with sim on hw 2024-01-07 20:51:55 +11:00
Peter Barker b43f4f78a3 SITL: add missing includes for SITL object 2024-01-03 18:33:10 +11:00
Andrew Tridgell adffd93894 SITL: use SocketAPM_native 2024-01-03 12:14:47 +11:00
Andrew Tridgell b72b4b5bc0 SITL: added required headers with new SITL header structure 2024-01-03 12:14:47 +11:00
Andrew Tridgell 9428e41301 SITL: fixed running example firmwares
don't call model update with no sitl instance
2024-01-02 08:12:37 +11:00
Thomas Watson f6ea8201b2 SITL: remove references to legacy UART order incl. sim arguments 2023-12-19 06:53:15 +11:00
Andrew Tridgell a17438d52c SITL: added InertialLabs simulator 2023-12-17 09:47:30 +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
Ryan Friedman 1ae13cd66d SITL: Switch to using GPS Timestamp for 5 series driver
* The old descriptor is deprecated

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2023-12-05 11:09:22 +11:00
Peter Barker 0d9c658a1e SITL: add missing includes 2023-12-04 07:04:12 +11:00
Peter Barker 97417a1038 SITL: rename SITL::GPS_GSOF to SITL::GPS_Trimble 2023-11-29 18:04:56 +11:00
Peter Barker a143d2e453 SITL: remove trailing whitespace in SITL GPS drivers
we've just lost the history for these lines anyway
2023-11-29 18:04:56 +11:00
Peter Barker d992ead5b1 SITL: rename GSOF to Trimble
... as now it's not just GSOF but also DCOL
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
Iampete1 d626928e0c SITL: SIM IntelligentEnergy24: add error string to V2 protocol 2023-11-28 11:27:14 +11:00
Gone4Dirt ab5d28073d SITL: Add V2 telemetry protocol to IE24 fuel cell 2023-11-28 11:27:14 +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
Peter Barker a018bed042 SITL: improve MegaSquirt simulator fidelity 2023-11-17 13:09:02 +11:00
Peter Barker ca16e924db SITL: add simulator Hirth EFI 2023-11-17 13:09:02 +11:00
Peter Barker 2f710a4689 SITL: correct MegaSquirt simulation 2023-11-17 13:09:02 +11:00
Peter Barker bd05fad850 SITL: add code to add, remove or corrupt bytes in SITL::SerialDevice xfrs 2023-11-17 10:56:25 +11:00
Peter Barker 2a2a103195 SITL: add JAE JRE simulator 2023-11-15 10:50:49 +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
Peter Barker fbe690d44b SITL: track simulated ADSB vehicles relative to simulation origin
removes dependence on ArduPilot AHRS library

Also removes vehicles based off vehicle simulated position rather than distance-from-origin, so you always have company
2023-11-02 15:52:42 +11:00
Peter Barker 4ec80076a1 SITL: correct bit for enabling MXS simulation 2023-11-02 15:52:17 +11:00
Andrew Tridgell f7a1227c25 SITL: added SIM_MAG_SAVE_IDS
this controls whether SITL saves device IDs for compasses on startup
so the compasses always appear calibrated
2023-10-31 10:14:42 +11:00
Peter Barker fd67c71eb0 SITL: add Sagetech MXS simulator 2023-10-25 20:06:47 +11:00
Andrew Tridgell 030dfe2fa1 SITL: use AP_BUILD_ROOT 2023-10-25 09:50:08 +11:00
Andrew Tridgell 928d50900a SITL: use connect_timeout() for realflight
this gives much better handling of network glitches, preventing long
simulation timeouts which impact on the stability of the simulation
2023-10-23 20:27:49 +11:00
Anthony Luo 51cbaed9d9 SITL: fix typos 2023-10-05 12:54:43 +11:00
Anthony Luo 021d9717c4 SITL: document airspeed params 2023-10-05 08:18:44 +11:00
Andrew Tridgell be01fcfdfd SITL: use mavlink_XXX_encode_status()
this avoids clobbering sequence numbers and fixes race conditions
2023-10-02 21:45:28 +11:00
Samuel Tabor 40f62949b3 Send lat lon in SIM_STATE as int32_t extensions 2023-09-27 14:14:37 -07:00
Tom Pittenger 8c4d00e6f2 SITL: add a thermal at home 2023-09-27 12:19:00 -07:00
Peter Barker 34bceb8eec SITL: log achieved speedup rate 2023-09-23 19:49:02 +10:00
Peter Barker 1208938d3b SITL: fix balancebot yaw reset to be kinimatically consistent
... or at least closer to it.

We were hard-resetting the yaw to zero when the vehicle was upright.  That makes for huge simulated gyro rates, and that means the differences between the gyros can be huge sample-to-sample, so we can get gyros-inconsistent errors.

Fix things so we don't reset yaw at the same time as pitch, and also twist the vehicle to point North again when disarmed.
2023-09-20 22:59:41 +10:00
Anthony Luo f0d7a367f4 SITL: document SIM_FLOW_* params 2023-09-12 18:56:06 +10:00
James O'Shannessy 8125ba1a41 SITL: add hardware relay enable mask for passing relays through to hardware 2023-09-11 12:21:13 +10:00
Ryan Friedman 0432863832 SITL: Add missing shebang
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2023-09-08 17:09:26 +10:00
Peter Barker d9818ae1ab SITL: add simulation instructions for TSYS03 sensor 2023-09-06 23:00:30 +10:00
Anthony Luo 6201f56d40 SITL: document SITL GPS params
* Document GPS_LAG_MS

* Document GPS2_LAG_MS, Consistency fixes

* document DriftAlt & Hz

* document GPS_POS offsets

* document locktime and noise

* document GPS_ALT_OFS and GPS_HDG

* document GPS_ACC

* Finish documenting GPS parameters
2023-09-05 10:02:43 +10:00
Peter Barker 390b025fa0 SITL: add simulator for TSYS03 temperature sensor 2023-09-05 07:17:00 +10:00
Peter Barker 7e0c178c6c SITL: add temperature to battery simulation 2023-09-05 07:17:00 +10:00
Anthony Luo 991e429afb SITL: document SIM_GPS_BYTELOSS and SIM_GPS_NUMSATS 2023-08-31 16:58:06 +10:00
Andrew Tridgell 3508d7eaa9 SITL: added SIM_CAN_TYPE0 and SIM_CAN_TYPE1
this selects the transport to use for CAN
2023-08-29 15:09:48 +10:00
Ryan Friedman 461a8dc86f SITL: split to MicroStrain5
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2023-08-29 10:31:44 +10:00
Peter Barker 7fff465251 SITL: SIM_ICEngine sends diagnostics to GCS rather than stdout
makes it much easier to see what the simulated engine is doing
2023-08-26 21:21:49 +10:00
Peter Barker 149921792c SITL: document SIM_ACCx_BIAS_y 2023-08-26 16:15:58 +10:00
Andrew Tridgell 1b6c329de5 SITL: use NaN for invalid rangefinder data
needed to cope properly with terrain errors leading to negative
rangefinder data
2023-08-24 13:06:40 +10:00
Andrew Tridgell 4e71023018 SITL: added SIM_CAN_SRV_MSK
mask of outputs that will come from the CAN SITL peripheral
2023-08-24 13:06:40 +10:00
Andrew Tridgell 9cde659545 SITL: disable gimbal and ADSB in SITL periph
lack of MAVLink makes these problematic
2023-08-24 13:06:40 +10:00
Andrew Tridgell 791d0acefe SITL: removed GPS FIFO 2023-08-24 13:06:40 +10:00
Peter Barker 84b3c9e267 SITL: reset balancebot to vertical in a kinmetically consistent manner
The hard-reset of all state variables means we feed the EKF inconsistent gyro data.  Attempt to upright the vehicle with a simple p-gain when it is disarmed, as if someone is pushing the thing back upright
2023-08-21 22:09:04 +10:00
Michelle Rossouw 26bbd6536a SITL: Improve Blimp dynamics and fin motion to be more realistic, allow SITL loop rate to be changed and add more logging 2023-08-21 21:01:47 +10:00
Andrew Tridgell 3e3c086ab7 SITL: build the whole simulator as double precision 2023-08-15 22:39:23 +10:00
Michelle Rossouw e4d44c1006 SITL: Make SIM_Aircraft use double precision to stop SITL's short-range teleporting 2023-08-12 10:49:02 +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 65cc16c51d SITL: add descriptions for simulated IMU scale factors 2023-08-11 10:34:02 +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
bnsgeyer 53100c8e96 SITL: fix vertical axis dynamics for autorotation 2023-08-07 22:10:09 -04: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
Ryan Friedman 7c2baa75d9 SITL: Rename LORD to MicroStrain
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2023-08-07 19:16:03 +10:00
Peter Barker 5d52d7f78b SITL: add description for SIM_BATT_VOLTAGE 2023-08-07 15:32:31 +10:00
Andrew Tridgell 217f073165 SITL: added simulated MSP GPS 2023-07-31 14:24:04 +10:00
Andy Piper 3224cf19a8 SITL: remove unused variables 2023-07-13 11:02:40 +10:00
Peter Barker 6b87318062 SITL: act on safety switch being enabled in SITL by zeroing outputs 2023-07-12 17:53:12 +10:00
rishabsingh3003 6b8dfdfc10 SITL: Add simulated nooploop tofsense 2023-06-28 17:16:22 +10:00
Peter Barker 320bd43334 SITL: use SIM_config for ship and adsb simulations 2023-06-17 17:57:15 +10:00
Peter Barker 5791aea3fc SITL: correct compilation when AP_SIM_IS31FL3195_ENABLED off
object won't exist in that case
2023-06-17 15:14:45 +10:00
bnsgeyer a18c818949 SITL: cleanup tradheli gas engine inputs 2023-06-16 23:18:23 +10:00
bnsgeyer 1bef3839e5 SITL: tradheli - add gas engine model for conventional heli 2023-06-16 23:18:23 +10:00
Peter Barker 7952e99813 SITL: add IS31FL3195 simulator 2023-06-15 12:14:26 +10:00
Randy Mackay 29292c2aaa SITL: simulated SF45b fixes and enhancements
resolve crash if time_delta_ms is too long
correct sample_count calculation
sends one reading per 3deg (closer to real device)
distance max is 53m
returns -1m on failure
sweeps back and forth -190~190 deg
2023-06-14 17:49:30 +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