Commit Graph

56 Commits

Author SHA1 Message Date
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
Andy Piper 3224cf19a8 SITL: remove unused variables 2023-07-13 11:02:40 +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 a0af08a3aa SITL switched to motor_mask for which actuators are motors
this allows for any output to be an ESC, which allows for proper
simulation of quadplanes with ESCs on outputs 5-8 or 9-12, for testing
notch filtering
2022-10-16 20:38:19 +11:00
Iampete1 f61d96dd5c SITL: SIM_Frame: add number of motors to json spec 2022-05-03 10:03:07 +10:00
Iampete1 6a8fff67f7 SITL: SIM_Frame: remove motor evaluation debug code 2022-05-03 10:03:07 +10:00
Iampete1 6eea4d12ee SITL: apply momentum drag per-motor 2022-05-01 09:17:23 +10:00
Iampete1 f9050c3040 SITL: Frame: take drag from thrust not accel 2022-05-01 09:17:23 +10:00
Iampete1 92135400f8 SITL: Frame: stop adding random physics noise 2022-05-01 09:17:23 +10:00
Iampete1 f869506b0a SITL: Motor: acount for airflow due to vehicle rotation 2022-05-01 09:17:23 +10:00
Iampete1 bead0ac0f8 SITL: JSON allow to set motor rotation direciton 2022-05-01 09:17:23 +10:00
Iampete1 f0c17f0e49 SITL: use AP_SIM_ENABLED define more 2022-04-26 10:26:29 +10:00
Iampete1 a7abfeeb4a SITL: allow cutom motor postions and thrust vectors to be specified 2022-04-19 09:43:51 +10:00
Iampete1 47f327b500 SITL: allow Vector3f inertia to be set via JSON 2022-04-19 09:43:51 +10:00
Iampete1 6272dc33dd SITL: move moments inertia to frame property 2022-04-19 09:43:51 +10:00
Iampete1 7936f3bb0a SITL: move motor related constants to motor object 2022-04-19 09:43:51 +10:00
Randy Mackay 375ab84e56 SITL: correct suggestion to user re wind estimatation param value
EK3_MCOEF becomes EK3_DRAG_MCOEF
EK3_BCOEF_ becomes EK3_DRAG_BCOEF_
2022-04-13 07:57:35 +09:00
Peter Barker 3cf7091525 SITL: make parsing of json files dependent on PICOJSON
picojson uses the standard library; this will be a problem on embedded
platforms
2022-03-17 14:39:55 +11:00
Peter Barker 9ef959b93b SITL: make C_TO_KELVIN a function macro; create KELVIN_TO_C
These are in celsius
2022-01-13 18:31:46 +11:00
Andrew Tridgell ba58558bd1 SITL: fixed default BATT_CAPACITY for SITL
don't override from JSON model unless we have a value
2021-12-21 19:53:43 +11:00
Iampete1 6628fd2837 SITL: swap rotation direciton of motor 2 for lower yaw offset 2021-08-28 10:32:59 +09:00
Peter Barker d38e704115 SITL: fix memory over-read detected by Valgrind
==15803== Conditional jump or move depends on uninitialised value(s)
==15803==    at 0x4C34975: index (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15803==    by 0x444D8D: SITL::Frame::load_frame_params(char const*) (SIM_Frame.cpp:363)
==15803==    by 0x445415: SITL::Frame::init(char const*, SITL::Battery*) (SIM_Frame.cpp:432)
==15803==    by 0x3696ED: SITL::MultiCopter::MultiCopter(char const*) (SIM_Multicopter.cpp:35)
==15803==    by 0x34B49C: SITL::MultiCopter::create(char const*) (SIM_Multicopter.h:44)
==15803==    by 0x34C58E: HALSITL::SITL_State::_parse_command_line(int, char* const*) (SITL_cmdline.cpp:480)
==15803==    by 0x344005: HALSITL::SITL_State::init(int, char* const*) (SITL_State.cpp:923)
==15803==    by 0x33D854: HAL_SITL::run(int, char* const*, AP_HAL::HAL::Callbacks*) const (HAL_SITL_Class.cpp:182)
==15803==    by 0x15ACDD: main (Copter.cpp:678)
==15803==
2021-05-05 21:21:56 +10:00
Peter Barker 0661a27400 SITL: ensure st.size is valid when loading model json
Before this patch st.size is undefined when we use it to create a buffer
on the stack - probably not a good thing.
2021-05-05 21:21:56 +10:00
Paul Riseborough b258cb0539 SITL: Add momentum drag to Z axis to work around thrust model deficiencies 2020-12-11 15:21:41 +11:00
Paul Riseborough a907c10733 SITL: Add momentum drag to multicopter model 2020-12-11 15:21:41 +11:00
murata 13c7980f0b SITL: Support for decacopters 2020-12-08 11:59:10 +11:00
Andrew Tridgell d8337cf9e5 SITL: allow loading of model from ROMFS 2020-10-28 14:20:44 +11:00
Andrew Tridgell e07cecb264 SITL: added support for simulated battery discharge 2020-10-28 14:20:44 +11:00
Andrew Tridgell a0bc9d3148 SITL: fixed quadplane mass and rpm indexing 2020-10-28 14:20:44 +11:00
Andrew Tridgell 767773da5e SITL: improved multicopter simulation
this takes account of motor expo, velocity of air over propellers,
mass, size and other factors

It also allows for frame parameters to be supplied as an external json file
2020-10-28 14:20:44 +11:00
Andrew Tridgell 7c2d13c571 SITL: added simulation of pressure altitude for multicopter
this gives us a ceiling of 5.4km above sea level for the default
copter
2020-06-05 11:35:53 +10:00
Rishabh 08f27f7668 SITL: Added cwx motor setup for hexa, octa and octaquad 2020-02-19 11:28:25 +09:00
Rishabh dc662a56b2 SITL: Added DJI Hexa and Octa for SITL 2020-01-29 16:57:23 +09:00
Andrew Tridgell dc80df23e9 SITL: added betaflight-rev-x frame 2020-01-16 19:13:13 +11:00
Andy Piper c807267bab SITL: add rpm-based motor noise per-motor to gyros and accels
convert multicopter thrust to rpm per motor
2019-12-17 10:07:06 +11:00
Andrew Tridgell 40babb1172 SITL: support 3 more X quad motor orders
- betaflight X
 - DJI X
 - clockwise X
2019-02-06 11:17:35 +11:00
Andrew Tridgell 358c570d9d SITL: added simulated battery for quadplane
needed for motor interference for mag
2019-01-14 08:23:47 +11:00
Pierre Kancir 37f7cc4bcf SITL: rearrange Grippers and Sprayers in SITL 2018-07-31 23:34:43 +10:00
mirkix 93b3970141 SITL: Add tilthvec frame 2017-09-18 21:20:39 +10:00
murata c21b586ccc SITL: add dodeca-hexa support 2017-05-27 14:21:13 +09:00
Andrew Tridgell 1e69508322 SITL: added a vectored tilt tricopter quadplane 2017-04-24 16:54:41 +10:00
Andrew Tridgell 0171b64feb SITL: setup simulator to match firefly6 AvA servo outputs 2017-02-06 16:18:58 +11:00
murata c808ee2f49 Global: To nullptr from NULL.
RC_Channel: To nullptr from NULL.

AC_Fence: To nullptr from NULL.

AC_Avoidance: To nullptr from NULL.

AC_PrecLand: To nullptr from NULL.

DataFlash: To nullptr from NULL.

SITL: To nullptr from NULL.

GCS_MAVLink: To nullptr from NULL.

DataFlash: To nullptr from NULL.

AP_Compass: To nullptr from NULL.

Global: To nullptr from NULL.

Global: To nullptr from NULL.
2016-11-02 16:04:47 -02:00
Peter Barker 1997a4e044 SITL: include mass of sprayer payload in vehicle mass 2016-10-29 15:02:56 +09:00
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
Andrew Tridgell f387f248d3 SITL: added support for servo slew rates and retract servos
this is for tiltrotors with retract servos
2016-07-05 09:40:37 +10:00
Andrew Tridgell 88b910c13d SITL: changed firefly motors to be suitable for a pixhawk
get channel groupings right
2016-05-11 05:55:25 +10:00
Andrew Tridgell 3e1cad5df2 SITL: adjust tricopter so default yaw servo values will work 2016-05-11 05:55:24 +10:00
Andrew Tridgell bd8cd71745 SITL: fixed fwd motor angles for tri and y6 frames
should be 60 degrees to have motors evenly spaced around frame for
equal lift per motor when level
2016-05-11 05:55:23 +10:00
Andrew Tridgell 125a9feb3d SITL: added tilttri frame type
tiltrotor tricopter
2016-05-11 05:55:22 +10:00