Commit Graph

385 Commits

Author SHA1 Message Date
Andrew Tridgell eaf5676636 SITL: fixed unselection bitmask bug in XPlane 2017-01-09 09:55:14 +11:00
Andrew Tridgell 35d6dc141a SITL: only de-select data types in xplane once
don't fight the user
2017-01-07 14:41:23 +11:00
Pierre Kancir bf135aeff7 SITL: Aircraft correct some syntax, implicit cast, make some local variable const, remove tabs and whitespace 2016-12-19 14:53:17 +00:00
Randy Mackay 3ed9eb98f3 SITL: minor comment fix for SIM_Multicopter 2016-12-19 17:01:04 +09:00
Andrew Tridgell 65c3d0e060 SITL: added ACC2_BIAS 2016-12-19 08:07:14 +11:00
Pierre Kancir a5161edc97 SITL: remove duplicate 2016-12-05 10:59:45 -08:00
Peter Barker 20b86605fa SITL: gripper closes faster, vary load carried by gripper
If gripper is closed on ground it is considered to be carrying
something
2016-12-02 12:04:05 +11:00
Peter Barker b751f836bb SITL: attach a string with a mass on the end to servo gripper 2016-12-02 12:04:05 +11:00
Peter Barker f8918d15b1 SITL: add a hagl method to aircraft 2016-12-02 12:04:05 +11:00
Peter Barker f1c23dc9be SITL: remove argument to on_ground
This was always the current position
2016-12-02 12:04:05 +11:00
Peter Barker e24f3f9419 SITL: correct on-ground correction
Using the cached ground_height_difference may mean
you end up at the wrong height if you were near
the edge of an SRTM square and had high horizontal
velocity
2016-12-02 12:04:05 +11:00
Andrew Tridgell 42435e700b SITL: expose height above ground to all models 2016-11-28 08:26:56 +11:00
Tom Pittenger 11229d2588 SITL: fix whitespace 2016-11-18 10:42:10 -08:00
ori ganoni 631b5c3ebc adding turbulance to SITL 2016-11-17 20:06:35 -08:00
Lucas De Marchi f6d475c1e6 AP_HAL_SITL: add O_CLOEXEC in places missing it
By opening with O_CLOEXEC we make sure we don't leak the file descriptor
when we are exec'ing or calling out subprograms. Right now we currently
don't do it so there's no harm, but it's good practice in Linux to have
it.
2016-11-07 12:37:30 -03:00
Peter Barker d9cbcd9487 SITL: a simulator for the EPM grabber 2016-11-05 10:20:43 +09:00
Peter Barker d439bbe5bf SITL: SIM_Gripper_Servo, a simulated servo gripper 2016-11-05 10:20:29 +09: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
Peter Barker a7867603a0 SITL: SIM_Sprayer: a simulated sprayer 2016-10-29 15:02:48 +09:00
priseborough d830f68901 SITL: Add angular acceleration to simulator states
The calculation used is an approximation to work around the lack of angular acceleration in the interface with the flight dynamics model.
2016-10-27 14:54:44 +11:00
priseborough 27dab27565 SITL: Add parameters for sensor position offsets in body frame 2016-10-27 14:54:44 +11:00
Andrew Tridgell 5e03358b0b SITL: added servo filtering
SIM_SERVO_SPEED is servo time constant in seconds
2016-10-25 20:39:38 +11: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
Peter Barker 6f200cdc3d SITL: SIM_Rover: remove unused variables 2016-10-24 08:57:55 -02:00
Peter Barker d3422d1653 SITL: SIM_Tracker: remove unused variable 2016-10-24 08:57:55 -02:00
Georacer 54c1efe5e1 Connection to last_letter once again successful 2016-10-17 09:37:23 +11:00
John Hsu fc13efa673 SITL: update SIM_Gazebo SITL interface servo packet to have 16 floats, matching sitl_input struct. 2016-10-13 12:03:20 +11:00
Gustavo Jose de Sousa 06c3102701 SITL: SIM_Calibration: bring angular velocity controller back
And fix header documentation.
2016-10-11 12:58:37 +11:00
Murilo Belluzzo 0b86532b5c Global: Remove '\r' character from all source code files 2016-10-03 22:13:27 -03:00
Michael Oborne 11c376588d AP_GPS_NOVA: support tersus/novatel/comnav gps 2016-09-20 10:53:49 +10:00
Andrew Tridgell c275e7c61d SITL: added SIM_SPEEDUP parameter
allows changing speed of simulation while running
2016-09-19 07:45:24 +10:00
Andrew Tridgell 52caf8419e SITL: fixed sense of wind direction
wind direction is where wind is coming from, not going to
2016-09-16 10:59:27 +10:00
Andrew Tridgell 8f35305496 SITL: added a simpler compass cal simulation
just output 1250 to servo5 and it will go through lots of rotations
2016-09-16 08:59:43 +10:00
Andrew Tridgell 3aba0d8359 SITL: fixed rover altitude
thanks to Grant for noticing this
2016-08-24 13:29:45 +10:00
Andrew Tridgell 49b82b767f SITL: added RPM for heli sim 2016-08-23 09:30:14 +10:00
Andrew Tridgell 3ecf2850a8 SITL: fixed send of MAVLink2 pkt 2016-08-16 16:33:36 -07:00
Tom Pittenger 19ac9bce48 SITL: add Ping2020 simulated device 2016-08-16 16:33:36 -07:00
Andrew Tridgell 622d26b122 SITL: expand to 16 output channels
needed for IC engine testing with octaquadplane
2016-07-25 15:45:39 +10:00
Andrew Tridgell e73d43d4f9 SITL: improve ICEngine simulation 2016-07-25 10:06:02 +10:00
Andrew Tridgell 995fb7cd86 SITL: added IC engine simulation 2016-07-25 10:06:02 +10:00
Andrew Tridgell 4301faeac9 SITL: map X-Plane Mixture inputs to channels 6 and 7
this gives two user controllable channels for experimental aircraft
2016-07-22 19:14:46 +10:00
Andrew Tridgell 69da7e9f86 SITL: added elevrev option for plane sim
used by autotest
2016-07-22 16:42:23 +10:00
Andrew Tridgell f075fcd79f SITL: added SIM_PIN_MASK
for simulation of GPIO pins
2016-07-22 15:01:20 +10:00
Tom Pittenger 44a60f278a SITL: change default of SIM_ADSB_RADIUS from 1E3 to 10E3 2016-07-21 00:04:20 -07:00
Andrew Tridgell a1c759e491 SITL: added sensor smoothing
this adds smoothing of sensors for kinematic consistency when
interacting with the ground. It means when we land the EKF doesn't go
crazy
2016-07-19 21:38:16 +10:00
Andrew Tridgell 4faa57074a SITL: removed vehicle specific ground handling 2016-07-19 14:47:47 +10:00
Andrew Tridgell e7a54c83d1 SITL: allow SITL to use terrain data for ground height 2016-07-19 14:42:31 +10:00
Tom Pittenger acaf0c6a5d SITL: LPF the SIM_WIND_DIR and SIM_WIND_SPD values to eliminate step inputs 2016-07-15 18:37:40 -07:00
Andrew Tridgell 4e8b4f29d9 SITL: added -heavy option to fixed wing model 2016-07-16 08:14:29 +10:00
Andrew Tridgell f3f34be9c4 SITL: added comment on heli interlock 2016-07-12 20:50:22 +10:00
Andrew Tridgell 4f17093add SITL: give a bit more pitch on tail in XPlane heli 2016-07-12 19:08:50 +10:00
Andrew Tridgell fdd20830d6 SITL: use flaps for collective on helis in X-Plane 10
works for more helis
2016-07-12 19:08:50 +10:00
Andrew Tridgell 871219d199 SITL: support helicopters with X-Plane 10
we get collective from "throttle2" and get interlock from generator1 on/off
2016-07-12 14:40:08 +10:00
Andrew Tridgell 0be442d34b SITL: improved throttle input in XPlane
reduce chance that throttle output will be interpreted as input
2016-07-05 09:48:40 +10: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 82f131667d SITL: added flaps control in XPlane 2016-06-30 20:26:00 +10:00
Andrew Tridgell a6e927d434 SITL: default gyro cal off in XPlane and FlightAxis
pointless doing cal on these backends
2016-06-24 10:32:52 +10:00
Andrew Tridgell 569443231a SITL: improved altitude data in XPlane 2016-06-20 12:52:13 +10:00
Andrew Tridgell 51fff00871 SITL: report data and frame rates in XPlane
and avoid time going backwards if possible
2016-06-20 12:52:13 +10:00
Andrew Tridgell b7395ee74b SITL: fixed sign of magnetic inclination 2016-06-20 11:17:36 +10:00
Andrew Tridgell 5b7b799046 SITL: fixed mag field in JSBSim and last_letter 2016-06-20 11:07:51 +10:00
Andrew Tridgell 16595d2f3b SITL: auto-set AHRS_EKF_TYPE to 10 for XPlane and FlightAxis 2016-06-20 08:38:53 +10:00
Andrew Tridgell 2f88c24f49 SITL: added debug showing UDP ports for XPlane 2016-06-19 21:18:19 +10:00
Andrew Tridgell ec5534bd6a SITL: explain the throttle_magic code for XPlane 2016-06-19 21:10:49 +10:00
Andrew Tridgell f76a7e64ca SITL: auto-select correct data fields from X-Plane10 2016-06-19 20:57:34 +10:00
Andrew Tridgell 4f99c17aae SITL: added X-Plane 10 SITL backend 2016-06-19 13:59:15 +10:00
Paul Riseborough 55b0bbd3f1 SITL: Add simulation of 3D earth magnetic field
Use an independant method to the flight code using tables that that can updated.
Data taken from NOAA online calculator using WMM data at 2016-6-16 date
2016-06-19 12:51:34 +10:00
Paul Riseborough 078284e2e2 SITL: Add magnetic field environment to simulation
Includes parameters enabling a ground level magnetic anomaly to be modelled.
TODO - add automatic setting of declination, inclination and field strength using WGS-84 position.
2016-06-19 12:51:34 +10:00
Andrew Tridgell e360c6117e SITL: make SIM_* variables available to simulator backends directly 2016-06-17 08:36:13 +10:00
Tom Pittenger 1770f314ac SITL: change SIM_ADSB default to -1 to default disabled to leave telem port available 2016-06-15 17:22:54 -07:00
Andrew Tridgell 027788f72b SITL: fixed gimbal simulator for recent MAVLink2 changes 2016-06-16 10:17:28 +10:00
Andrew Tridgell 145ab1d626 SITL: fixed send of ADSB_Vehicle packets with recent MAVLink2 changes 2016-06-16 10:15:07 +10:00
Tom Pittenger 0ed868d97b SITL: compiler warning, comparing float to 0 2016-06-14 21:05:38 -07:00
Tom Pittenger c3b241ca88 SITL: change ADSB_VEHICLE update rate to 1Hz instead of 2Hz to match PING behavior 2016-06-14 21:05:32 -07:00
Tom Pittenger 95da4accfb SITL: add SIM_ADSB_COUNT, RADIUS, ALT params 2016-06-14 21:00:39 -07:00
Andrew Tridgell 9e9a048016 SITL: make heli RPM rpm1 in FlightAxis 2016-06-04 18:33:36 +10:00
Andrew Tridgell 79ffc28f68 SITL: fixed ground accel for helis in FlightAxis
fixes landing detection
2016-06-04 15:52:00 +10:00
Andrew Tridgell 7c227ac96c SITL: debug code for logging raw SITL data 2016-06-04 14:21:21 +10:00
Andrew Tridgell f6a7c1839a SITL: use FlightAxis body accel
less noisy than rotating early accel
2016-06-04 14:20:55 +10:00
Andrew Tridgell f6e42cb3e2 SITL: cope with restarting RealFlight while connected 2016-06-04 12:07:03 +10:00
Andrew Tridgell 9c13ac997e SITL: use FlightAxis accel when not touching the ground 2016-06-04 11:34:57 +10:00
Andrew Tridgell 0b9fca6ef9 SITL: use quaternion attitude from FlightAxis 2016-06-04 11:04:15 +10:00
Andrew Tridgell f4f0ae8c8b SITL: auto-reconnect FlightAxis on reset button 2016-05-29 19:17:29 +10:00
Leonard Hall e5bdf0a0a2 SITL: Single and Coax fixes 2016-05-29 16:12:13 +10:00
Andrew Tridgell 4c66e14563 SITL: fixed air resistance bug for heli, balloon and singlecopter 2016-05-26 20:38:20 +10:00
Randy Mackay d26a9d4a22 SITL: fix compiler warning by defaulting frame_type 2016-05-26 17:03:28 +09:00
Andrew Tridgell 9f33ece3ef SITL: support coax copter 2016-05-26 17:08:27 +10:00
Andrew Tridgell 8944d298ed SITL: added SingleCopter simulator 2016-05-26 16:30:39 +10:00
Grant Morphett 52755c893d Rover: Print message when running skid steering SITL 2016-05-24 12:24:53 +10:00
Tom Pittenger c77a5e6764 SITL: rename aspd variables and params to arspd 2016-05-17 16:36:07 -07:00
Peter Barker 7510e4d0a7 SITL: setsid() when starting JSBSim so Ctrl-C doesn't kill it in GDB 2016-05-11 14:10:48 +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 48ca1a8d92 SITL: increase the mass of the plane to 2kg
less wafty in the air
2016-05-11 05:55:24 +10:00
Andrew Tridgell 9c90709872 SITL: fixed namespace of SITL classes 2016-05-11 05:55:23 +10:00
Andrew Tridgell 91abc636f4 SITL: fixed quadplanes with elevons 2016-05-11 05:55:23 +10:00
Andrew Tridgell 2d47ca8095 SITL: fixed moment of rotated motors 2016-05-11 05:55:23 +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
dgrat 41661f815f AP_Math: Replace the pythagorous* functions with a variadic template
The new function can deal with a variable number of function parameters.
Additionally, I renamed the functions to norm(), because this is the
standard name used in several other projects.
2016-05-10 11:41:26 -03:00
Gustavo Jose de Sousa 9fa85d9bcf SITL: add SIM_Calibration
That model can be used to run compass and accelerometer calibration by rotating
the vehicle through the servos channels.
2016-05-10 16:16:37 +10:00
Gustavo Jose de Sousa 45754ef37c SITL: Multicopter: remove leftover comment
That went unnoticed by 8a98ce4 ("SITL: moved to common code for attitude/pos
update")
2016-05-10 16:16:37 +10:00
Gustavo Jose de Sousa ce8766e1cd SITL: remove set_yaw_degrees()
That function isn't being used anywhere.
2016-05-10 16:16:37 +10:00
Andrew Tridgell 7cdab2a6c9 SITL: FlightAxis can support 8 channels 2016-05-04 13:05:43 +10:00
Andrew Tridgell 3b0cd9f101 SITL: added RC input from FlightAxis
use the interlink controller for input for 6 channels
2016-05-04 12:51:27 +10:00
Andrew Tridgell 68e17af070 SITL: allow for changing FlightAxis controller IP 2016-04-29 09:03:48 +10:00
Andrew Tridgell e428d1e72d SITL: support tricopter quadplanes 2016-04-28 22:36:53 +10:00
Andrew Tridgell 9e01d7de6c SITL: added support for "quad-fast" frame
much more powerful copter for testing nav at high speed
2016-04-28 10:05:04 +10:00
Andrew Tridgell 785ad0614a SITL: fixed coverity 125055 2016-04-26 16:46:06 +10:00
Andrew Tridgell ed4e8b635a SITL: fixed fd leak
coverity #125056
2016-04-26 16:43:54 +10:00
Andrew Tridgell 847483d744 SITL: fixed coverity warning 2016-04-26 16:37:17 +10:00
Andrew Tridgell 180a7905e5 SITL: make Z down in motors 2016-04-22 10:45:55 +10:00
Andrew Tridgell aa80851138 SITL: support fireflyY6 quadplane model 2016-04-22 10:28:15 +10:00
Andrew Tridgell 8880635fe1 SITL: support vtail and elevon planes in builtin plane sim
remove old tiltrotor in favor of new tiltrotor code
2016-04-22 10:28:15 +10:00
Andrew Tridgell b4d24d8e03 SITL: fixed rotations of motors by large angles 2016-04-22 10:28:15 +10:00
Andrew Tridgell 71ca534ec6 SITL: added Y6 frame 2016-04-21 21:11:38 +10:00
Andrew Tridgell 49822effca SITL: added tricopter simulator 2016-04-21 20:29:49 +10:00
Andrew Tridgell c262d6a1b4 SITL: break up multicopter into Motor/Frame/Multicopter classes
ready for more tiltrotors
2016-04-21 19:56:44 +10:00
Andrew Tridgell 57aef8e1e9 SITL: added basic wind support in multicopter, plane and quadplane
this adds non-turbulent wind support for the built-in simulators. I
added it primarily for quadplane testing, but it should also be useful
for multicopter navigation testing.
2016-04-20 11:48:37 +10:00
Grant Morphett 5861b754cc Rover: fixing a bug the Rover simulation
Just a small change to ensure the max_wheel_turn parameter is used
instead of a hard coded value.
2016-04-14 08:55:04 +09:00
Andrew Tridgell 7dcd17a2fa SITL: make multicopter motors only effective above 10% 2016-04-02 22:45:05 +11:00
Andrew Tridgell 73a2c99d56 SITL: limit rotational rate to 2000dps 2016-03-26 14:23:05 +11:00
Andrew Tridgell 1d42b0281a SITL: ADSB: fixed heading and fixed windows startup 2016-03-18 11:18:19 +11:00
Andrew Tridgell b0ac6c26e0 SITL: support octaquad in quadplane sim 2016-03-13 10:12:14 +11:00
Will Sackfield 8b5fa9d23d SITL: Initialise yaw_rate and pitch_rate
* Clang requires these variables to be initialized
2016-02-29 14:14:37 +11:00
dgrat 5148e41c1a AP_Math: Cleaned macro definitions
Moved Definitions into a separate header. Replaced PI with M_PI and
removed the M_PI_*_F macros.
2016-02-27 02:51:33 -03:00
Tom Pittenger faa4238370 SITL: fixed warning comparing signed vs unsigned 2016-02-23 10:32:48 -08:00
Tom Pittenger f20841f491 SITL: add reverse thrust to Plane Sim 2016-02-09 14:18:01 +11:00
Tom Pittenger 1f714ed75d SITL: handle negative throttle
- negative throttle was causing negative offsets
2016-02-09 14:18:01 +11:00
Andrew Tridgell d820eeaec6 SITL: use AP_Motors conventions for multicopters
this makes it easier to add a simulated vehicle to match a
MotorsMatrix frame type
2016-02-08 10:58:56 +11:00
Andrew Tridgell 5efe98a814 SITL: allow quadplane simulator to simulate other frame types 2016-02-08 09:17:22 +11:00
Andrew Tridgell e62d6711c3 SITL: added very simple tiltrotor simulation
uses channel 9 to control tilt of rotors
2016-01-30 09:45:43 +11:00
Andrew Tridgell 6baae735de SITL: updated fixed wing model based on last_letter skywalker_2013
many thanks to Georacer for this code!
2016-01-20 17:23:36 +11:00
Andrew Tridgell a828db792e SITL: added SIM_GYR_SCALE_{X,Y,Z}
allows testing of gyro scale factor learning in EKF2
2016-01-19 15:28:53 +11:00
Andrew Tridgell 7a7bd0607f SITL: first version of FlightAxis SITL support 2016-01-09 07:38:51 +11:00
Andrew Tridgell 2777ff63ba SITL: heli-sim: prevent ground rotation and reduced affect of ground impact 2016-01-06 21:59:56 +11:00
Andrew Tridgell 62b2a2117d SITL: only report ground contact at most once per second 2016-01-05 09:47:58 +11:00
Andrew Tridgell 0966398d8d SITL: improved realism of fixed wing sim somewhat
still not good, but a bit better for manual flight
2016-01-04 08:03:46 +11:00
Andrew Tridgell 22873ee687 SITL: reduced drag in plane model 2016-01-01 18:40:22 +11:00
Andrew Tridgell 619a4c0925 SITL: use common dynamics code for QuadPlane 2016-01-01 17:20:30 +11:00
Andrew Tridgell 33998a58ac SITL: prevent aircraft going below ground level 2016-01-01 17:01:23 +11:00
Andrew Tridgell d425965f6d SITL: expose home yaw to FDMs 2016-01-01 17:00:57 +11:00
Andrew Tridgell 630d4410d4 SITL: removed debug code from QuadPlane 2016-01-01 15:48:56 +11:00
Andrew Tridgell 8a98ce427c SITL: moved to common code for attitude/pos update 2016-01-01 15:12:33 +11:00
Andrew Tridgell f2c8193f8b SITL: added a QuadPlane model 2016-01-01 14:35:15 +11:00
Andrew Tridgell 6f9e9d761f SITL: move calculations into multicopter frame class
this will enable a QuadPlane model
2016-01-01 14:35:15 +11:00
Andrew Tridgell fcfd11ef53 SITL: very simple fixed wing simulator
useful for debugging
2016-01-01 12:41:05 +11:00
Tom Pittenger 37054d9571 SITL: update units for new adsb mavlink msg 2015-12-09 14:36:30 +11:00
Tom Pittenger 7236b48518 SITL: compiler warning: double to float demotion
- replace atof() with strtof() for the correct return time
2015-12-08 14:54:58 +09:00