Commit Graph

8563 Commits

Author SHA1 Message Date
Andrew Tridgell
da5d5c9936 SITL: fixed airspeed pass-thru from simulators 2015-05-23 11:24:10 +10:00
Andrew Tridgell
e7f3716e8c HAL_SITL: pass in wind speed to C++ simulators 2015-05-23 11:04:13 +10:00
Andrew Tridgell
091a1e7fe0 SITL: fixed wind support in JSBSim 2015-05-23 11:03:57 +10:00
Andrew Tridgell
4486ddc53e DataFlash: changed TimeUS to SampleUS for raw IMU logging
this prevents a problem with an upcoming patch from Peter
2015-05-22 17:58:18 +10:00
Jonathan Challinger
28731d2bdc AP_Motors: add throttle filter input constraint from -100 to 1100 2015-05-22 16:12:27 +09:00
Andrew Tridgell
60221f5e9c SITL: use sendto() in CRRCSim
this makes us robust to restart of client or server
2015-05-22 16:07:45 +10:00
Andrew Tridgell
6cbd291dd2 HAL_SITL: make model name case insensitive 2015-05-22 16:07:44 +10:00
Andrew Tridgell
9336914598 AP_HAL: added sendto socket method 2015-05-22 16:07:44 +10:00
Andrew Tridgell
4e117bc90f HAL_SITL: support last_letter simulator 2015-05-22 16:07:44 +10:00
Andrew Tridgell
b35c21fbe2 SITL: fixed socket recv error check 2015-05-22 16:07:43 +10:00
Andrew Tridgell
e487d95c1b SITL: added direct support for last_letter simulator 2015-05-22 16:07:43 +10:00
Robert Lefebvre
bcc3fa0526 AC_HELI_PID: Pass default FF param setting in constructor 2015-05-22 09:38:28 +09:00
Robert Lefebvre
73bafa131e AP_MotorsHeli: Overload output()
To protect it from future interference from Multirotor code.
2015-05-22 09:38:23 +09:00
Robert Lefebvre
d3ce68a8ca AP_MotorsHeli: Overload update_throttle_filter()
Do not reset filter to zero when disarmed to allow collective pitch servo movement.
2015-05-22 09:38:20 +09:00
Peter Barker
6299a8c90d autotest: drain control socket in SITL
fixes SITL on plane
2015-05-22 08:09:15 +10:00
Andrew Tridgell
cd66ce1c74 HAL_SITL: don't advance clock on garbage SIM input 2015-05-21 21:17:22 +10:00
Andrew Tridgell
605b8b4ece AP_Math: converted rotations example to cpp
this is just a test conversion before we start converting on-mass
2015-05-21 13:41:20 +10:00
Andrew Tridgell
062c9406bd AP_Math: fixed rotations example build 2015-05-21 13:37:44 +10:00
Andrew Tridgell
a1a3212131 AP_Common: moved NOINLINE define to AP_Common.h 2015-05-21 09:35:26 +10:00
Andrew Tridgell
fb97c16a84 AP_Param: make data pointer const 2015-05-21 07:48:52 +10:00
Andrew Tridgell
84726e4a3a GCS_MAVLink: use APM_BUILD_DELEGATES 2015-05-21 07:48:52 +10:00
Andrew Tridgell
f8aef57ec3 DataFlash: use APM_BUILD_DELEGATES 2015-05-21 07:48:51 +10:00
Andrew Tridgell
0847bd2608 AP_Scheduler: use APM_BUILD_DELEGATES 2015-05-21 07:48:51 +10:00
Andrew Tridgell
e7ba2c8d93 AP_Mission: use APM_BUILD_DELEGATES 2015-05-21 07:48:51 +10:00
Andrew Tridgell
3a300575bc AP_Menu: use APM_BUILD_DELEGATES 2015-05-21 07:48:51 +10:00
Andrew Tridgell
98d2b9b3aa AP_Vehicle: added APM_BUILD_DELEGATES macro 2015-05-21 07:48:50 +10:00
Andrew Tridgell
c3aa8d67fa AP_Arming: convert to delegates 2015-05-21 07:48:50 +10:00
Andrew Tridgell
71b550d7b5 GCS_MAVLink: support member functions for rover 2015-05-21 07:48:47 +10:00
Andrew Tridgell
b5d930be61 DataFlash: support member functions for rover 2015-05-21 07:48:47 +10:00
Andrew Tridgell
1237772479 AP_Scheduler: support member functions for rover 2015-05-21 07:48:46 +10:00
Andrew Tridgell
12cbf7888f AP_Mission: support member functions for rover 2015-05-21 07:48:46 +10:00
Andrew Tridgell
db13f657a8 AP_Menu: support member functions for rover 2015-05-21 07:48:46 +10:00
Andrew Tridgell
e1e85ecc3d AP_Progmem: simpler PROGMEM header 2015-05-21 07:48:46 +10:00
Andrew Tridgell
abfb601db6 AP_Progmem: added pgm_read_block() 2015-05-21 07:48:45 +10:00
Andrew Tridgell
d57fcf7e46 AP_HAL: added workaround for AVR delegates in PROGMEM 2015-05-21 07:48:45 +10:00
Andrew Tridgell
be587beedc AP_HAL: disable nagle on sockets for faster local operation 2015-05-21 07:48:45 +10:00
Andrew Tridgell
b0932548d8 AP_GPS: enable NMEA GPS on AntennaTracker
we have enough flash space for it
2015-05-21 07:30:21 +10:00
Andrew Tridgell
411a96b4b3 AP_NavEKF: take at most 30s to accept DCM attitude
velocity noise on the GPS can cause DCM to take a long time to
converge. If it takes longer than 30s then allow EKF to start
2015-05-20 15:22:15 +10:00
Andrew Tridgell
7a76f72bf5 AP_AHRS: added uptime_ms() interface 2015-05-20 15:22:14 +10:00
ziltoid2
23787cf695 AP_Baro: use ground_temperature instead of calibration_temperature for alt calculation 2015-05-20 11:42:21 +10:00
Andrew Tridgell
92c4c5cbcf AP_NavEKF: change using_gps threshold to 4s
this means plane will continue to use dead reckoning with GPS 3D lock
for 4s
2015-05-19 20:52:39 +10:00
Paul Riseborough
69ca654194 AP_NavEKF: Update declination when we know our location
This ensures that when we start using GPS, that the EKF will be using the correct declination for that location
If declination is not known it defaults to zero
2015-05-19 20:35:52 +10:00
Paul Riseborough
c1c5e3598a AP_NavEKF: Enforce alignment of realigned earth mag field with declination
This prevents bad inertial or GPS data combined with the post takeoff heading alignment check used by plane from resulting in earth field states that have an incorrect declination
2015-05-19 20:35:52 +10:00
Paul Riseborough
b1d8805114 AP_NavEKF: Reduce takeoff detection sensitivity
This patch reworks the in-air transition criteria to reduce the likelihood of false positives and to ensure that there will be enough ground speed to make the heading check work reliably.
2015-05-19 20:35:52 +10:00
Randy Mackay
d1808c645d AC_PosControl: recalc leash length on speed or accel change
This resolves an issue in which do-set-speed would not take effect until
one waypoint too late in a mission.
2015-05-19 18:16:39 +09:00
Andrew Tridgell
5514a9f690 AP_NavEKF: base EKF decisions on vehicle class
using the vehicle class rather than the build macros allows this to
work correctly in replay
2015-05-19 15:21:22 +10:00
Andrew Tridgell
92daa15ccc AP_AHRS: on plane and rover make AHRS unhealthy when EKF not initialised
planes and rovers need full absolute position from the EKF if the EKF
is going to be used. We don't want users to arm without full
capabilities
2015-05-19 15:21:21 +10:00
Andy Piper
c600c1a746 DataFlash: log Gyro and Accel Health for IMUs.
Log the health of the various IMUs under GyHlt and AcHlt.
(Names are shortened to get inside the string array limit).
2015-05-19 13:13:35 +09:00
Andrew Tridgell
0619247992 HAL_Linux: don't advance time in delay() and delay_microseconds()
this could cause time to go backwards in Replay. Thanks to Peter for
finding this
2015-05-19 13:17:15 +10:00
Andrew Tridgell
29f0561ce4 AP_AHRS: reject EKF for plane when we have GPS and aren't fusing
plane users would prefer to use GPS in this case
2015-05-17 21:24:57 +10:00
Andrew Tridgell
6154db5cf8 AP_NavEKF: added using_gps status bit 2015-05-17 21:24:57 +10:00
Randy Mackay
0077cac1b7 AC_WPNav: rename stop to brake 2015-05-17 14:44:33 +09:00
Andrew Tridgell
80c20b5cf2 DataFlash: use L for latitude/longitude in DF messages 2015-05-16 14:04:31 +10:00
Tom Pittenger
e987173ffb AP_NavEKF: float to double promotion via tan instead of tanf 2015-05-16 08:21:49 +10:00
Tom Pittenger
5f677c2b5b AP_Math: float to double promotion via cos instead of cosf 2015-05-16 08:21:49 +10:00
Tom Pittenger
7b95241306 AP_HAL_SITL: float to double promotion via cos instead of cosf 2015-05-16 08:21:37 +10:00
Tom Pittenger
4f1dd2c8a4 AC_AttitudeControl: compiler warning stuff
float to double promotion via cos & sin instead of cosf & sinf
(this code is commented out but in case it ever gets included it would be nice to be correct
2015-05-16 08:21:36 +10:00
Andrew Tridgell
aaa35bd1ec AP_InertialSensor: using atan2f() gives more accurate euler corrections
thanks to Jon and Paul!
2015-05-16 08:19:18 +10:00
Andrew Tridgell
9e723ef907 AP_InertialSensor: added calibrate_trim() function
used for redoing trim calculation
2015-05-16 07:56:34 +10:00
Andrew Tridgell
b564ba0868 AP_InertialSensor: fixed AHRS_TRIM calculation again 2015-05-16 07:56:33 +10:00
Andrew Tridgell
2475ee9630 AP_Compass: setup HIL/SITL for two compasses 2015-05-16 07:06:04 +10:00
Andrew Tridgell
ab687ab0f5 DataFlash: added double to list of format strings
thanks to Dario <proyectoire@gmail.com> for noticing this
2015-05-15 21:14:49 +10:00
Jonathan Challinger
159599879f AP_InertialSensor: simplify and correct AHRS_TRIM computation 2015-05-15 21:03:03 +10:00
Andrew Tridgell
d7e4310df0 DataFlash: Lat can be negative in POS 2015-05-15 17:55:50 +10:00
Randy Mackay
559684b257 GCS_MAVLink: fix flow control check
Thanks to Tridge for spotting is
2015-05-15 15:39:34 +09:00
Andrew Tridgell
b0a90df135 DataFlash: fixed double Init of DF object
thanks to Michael De Breuil
2015-05-15 16:33:10 +10:00
Randy Mackay
763c671d0a GCS_Console: fix example sketch after mavlink_comm_port to array 2015-05-15 15:07:32 +09:00
Randy Mackay
85eeba93c0 GCS_MAVLink: mavlink_comm_port to array 2015-05-15 15:07:31 +09:00
Randy Mackay
facbfaf31f SerialManager: support for 4th mavlink channel 2015-05-15 15:07:24 +09:00
Randy Mackay
62e7e8cc7d GCS_MAVLink: add support for 4th mavlink chan on PX4 2015-05-15 15:07:23 +09:00
Andrew Tridgell
74485c5754 DataFlash: added Log_Write_POS() call
write AHRS position to DF log
2015-05-15 14:28:08 +10:00
Andrew Tridgell
3370ec62a1 HAL_SITL: fix for multi-compass SITL 2015-05-15 14:25:44 +10:00
Andrew Tridgell
91b4ba3588 AP_Compass: allow for more than one compass in HIL/SITL 2015-05-15 14:25:44 +10:00
Andrew Tridgell
11f70da8b4 DataFlash: fixed incorrect change to GPS message 2015-05-15 14:25:43 +10:00
Randy Mackay
ade4f81c77 Compass: fix example sketch 2015-05-15 11:53:28 +09:00
Paul Riseborough
bd91b9727f AP_NavEKF: Add pre-arm check for horizontal inertial errors
This check will declare the EKF as unhealthy if the horizontal position innovations exceed a threshold  before motors are armed.
This will help to prevent a takeoff with bad inertial data caused by bad accel or gyro offsets.
2015-05-15 10:35:25 +09:00
Randy Mackay
1b13250fd8 RC_Channel: small parameter description change 2015-05-14 10:33:08 +09:00
Randy Mackay
61c851885f AC_WPNav: remove unused set_spline_dest_and_vel 2015-05-13 22:40:08 +09:00
Randy Mackay
7056484ef0 Copter: fix spline overshoot 2015-05-13 22:40:06 +09:00
Randy Mackay
56b92e7d8c AC_PID: fix example sketch 2015-05-13 17:55:39 +09:00
Paul Riseborough
c2ac80cc63 AP_AHRS: Prevent copter from switching to DCM unless EKF has severe errors 2015-05-13 16:11:13 +09:00
Randy Mackay
3f8b832075 InertialSensor: fix example sketch 2015-05-13 10:13:51 +09:00
Randy Mackay
3bcd97fcd1 Parachute: increase deployment duration to 2sec 2015-05-12 22:08:20 +09:00
Randy Mackay
5560d3dba1 BattMonitor: fix example sketch 2015-05-12 21:34:24 +09:00
Randy Mackay
e080b2acce AP_Arming: use accel_calibrated_ok_all 2015-05-12 16:32:22 +09:00
Randy Mackay
1f14eec4ea InertialSensor: accel_calibrated_all_ok replaces calibrated
This checks that the current number of accelerometers matches the number
of calibrated accels in order to catch accel failures at boot
2015-05-12 16:32:16 +09:00
Randy Mackay
0d72f3ac29 AP_HAL: fix example sketches 2015-05-12 14:42:15 +09:00
Andrew Tridgell
8bf2baef70 AP_InertialSensor: fixed primary accel/gyro in replay 2015-05-11 11:19:11 +10:00
Andrew Tridgell
f40c96de9d SITL: add 'quad' and 'copter' as aliases for quadcopter 2015-05-11 09:19:53 +10:00
Andrew Tridgell
2a47cc3c81 HAL_SITL: cleanup command line handling 2015-05-11 08:48:42 +10:00
Andrew Tridgell
bab94c8a04 SITL: close high fds before launching JSBSIM 2015-05-11 08:06:10 +10:00
Andrew Tridgell
414f4125de AP_HAL: use FD_CLOEXEC to prevent sockets being inherited in SITL 2015-05-11 08:05:51 +10:00
Andrew Tridgell
7692889248 SIM_JSBSim: added elevon and vtail support 2015-05-10 21:57:39 +10:00
Andrew Tridgell
aa9853179c SITL: fixed startup yaw 2015-05-10 21:57:19 +10:00
Andrew Tridgell
5687adbdba HAL_SITL: support JSBSim backend 2015-05-10 21:02:20 +10:00
Andrew Tridgell
692fc18698 AP_HAL: protect Socket.h from double include 2015-05-10 21:02:04 +10:00
Andrew Tridgell
c136d65c25 SITL: added initial JSBSim simulator backend 2015-05-10 21:01:49 +10:00
Andrew Tridgell
8ec98a5ec9 SITL: make it possible to connect two SITL instances together
this adds --client to set uartC as a tcp client rather than a TCP
server
2015-05-10 15:36:18 +10:00
Andrew Tridgell
3991e0c476 DataFlash: fixed sign of sv in GRAW message 2015-05-10 12:15:04 +10:00
Andrew Tridgell
3529e02675 AP_AHRS: if we have 3 gyros then only use first two
the 3rd gyro on a PH2 has a lot more noise as it is not vibration
isolated
2015-05-09 21:00:49 +10:00
Paul Riseborough
cb59570938 AP_NavEKF: Remove bug preventing external selection of optical flow mode 2015-05-09 18:31:18 +10:00
Randy Mackay
3390d9932e AP_AHRS: fix example sketch 2015-05-09 12:23:05 +09:00
Tom Pittenger
2deb0e08ea AP_NavEKF: replace fabs() with fabsf() 2015-05-09 09:57:27 +10:00
Tom Pittenger
79605de8f5 AP_Mission: replace fabs() with fabsf() 2015-05-09 09:57:27 +10:00
Tom Pittenger
e20ffa8c75 AP_Math: replace fabs() with fabsf() 2015-05-09 09:57:27 +10:00
Tom Pittenger
1c8efb25a8 AP_HAL_SITL: replace fabs() with fabsf() 2015-05-09 09:57:26 +10:00
Tom Pittenger
4b6d0d8e24 AP_HAL: replace fabs() with fabsf() 2015-05-09 09:57:26 +10:00
Tom Pittenger
9d74f57ed3 AP_PID: replace fabs() with fabsf() 2015-05-09 09:57:26 +10:00
Tom Pittenger
70bef20a29 AC_AttitudeControl: replace fabs() with fabsf() 2015-05-09 09:57:26 +10:00
Andrew Tridgell
1127b716c4 SITL: lower the default noise
prevents problems calibrating the gyro
2015-05-09 07:22:37 +10:00
Andrew Tridgell
2552acbf12 AP_Arming: fixed accel cal test in arming
use a per-imu time of last cal pass, and triple accel threshold for
IMU3. Raise threshold to 0.5 for IMU1/IMU2
2015-05-08 21:01:52 +10:00
Tom Pittenger
d94c95a6ef GCS_MAVLink: return true if mission recieve is complete
when handing a mission item, and that is the last item, return true so that whoever is handling this knows we have a new mission list. From here we can log a new mission
2015-05-08 21:01:51 +10:00
Paul Riseborough
a232606fc9 AP_NavEKF: Prevent EKF yaw errors due to fast yaw spins
Prolonged yaw rotations with gyro scale factor errors can cause yaw errors and gyro bias estimation errors to build up to a point where EKF health checks fail.
This patch introduces the following protections:

1) The assumed yaw gyro error is scaled using a filtered yaw rate and an assumed 3% scale factor error (MPU6000 data sheet)
2) When the filtered yaw rate magnitude is greater than 1 rad/sec, the Z gyro bias process noise is zeroed and the state variance set to zero to inhibit modification of the bias state
3) When the filtered yaw rate magnitude is greater than 1 rad/sec, the magnetometer quaternion corrections are scaled by a factor of four to maintain tighter alignment with the compass
2015-05-08 16:47:31 +09:00
Paul Riseborough
08382373f1 AP_NavEKF: Reduce likelihood of in-air switch to GPS with a bad heading
Increases magnetometer weighting on yaw corrections when there there is no other aiding to constrain yaw drift.
Prevents switch to GPS if magnetometer data is failing innovation checks which indicates a bad yaw angle
2015-05-08 16:47:29 +09:00
Randy Mackay
3781f133d7 AC_AttControlHeli: remove unused definitions 2015-05-08 14:50:38 +09:00
Randy Mackay
bef5633ed5 AC_AttControlHeli: use params from parent class 2015-05-08 14:50:36 +09:00
Randy Mackay
7951346d72 AC_AttControl: bf_feedfoward_save made more concise 2015-05-08 14:29:49 +09:00
Randy Mackay
3d9a6a69e2 MotorsHeli: COLYAW to float 2015-05-08 14:14:36 +09:00
Randy Mackay
edfa206bb8 Motors_Heli: nest heli params 2015-05-08 14:14:35 +09:00
Randy Mackay
68b05a4ca2 AP_Motors: is_throttle_mix_min returns bol 2015-05-08 14:14:32 +09:00
Leonard Hall
cf45a1cf3a AC_AttitudeControl: add get accel and save ff 2015-05-08 14:14:30 +09:00
Leonard Hall
1900cc7582 AC_AttitudeControl: Enable FF by default 2015-05-08 14:14:21 +09:00
Leonard Hall
0f894ac1a8 AP_Motors: Rename and move Throttle Mix / Comp 2015-05-08 14:14:17 +09:00
Jonathan Challinger
142e018a18 AP_NavEKF: fix bug causing takeoff to fail 2015-05-08 09:15:45 +09:00
Randy Mackay
fa4ba456b4 GPS: fix example sketches 2015-05-07 14:01:14 +09:00
Andrew Tridgell
afc9812d0b AP_InertialSensor: update VibTest after moving messages info DataFlash 2015-05-07 13:25:37 +10:00
Andrew Tridgell
7d90033a36 AP_InertialSensor: support raw accel and gyro dataflash logging 2015-05-07 12:08:30 +10:00
Andrew Tridgell
21d805422d DataFlash: added defines for raw accel and gyro logging 2015-05-07 12:08:04 +10:00
Andrew Tridgell
f5140e25b0 AP_InertialSensor: updated VibTest for latest PX4 interfaces 2015-05-07 10:51:52 +10:00
Andrew Tridgell
cbdc9f0706 SITL: fixed autotest SITL 2015-05-06 10:09:43 +10:00
Andrew Tridgell
2369e06815 AP_HAL: fixed SITL build on windows 2015-05-06 09:07:03 +10:00
Andrew Tridgell
b09fcfc20e HAL_Linux: cope with systems without I2C_RDRW_IOCTL_MAX_MSGS
such as my ubuntu 14.04 laptop :-)
2015-05-05 21:42:46 +10:00
Andrew Tridgell
6a8da06d19 HAL_SITL: hook in CRRCSim backend 2015-05-05 21:42:46 +10:00
Andrew Tridgell
93d5101bf9 SITL: added CRRCSim simulation connection 2015-05-05 21:42:45 +10:00
Andrew Tridgell
4c11002976 AP_HAL: added HAL_OS_SOCKETS define
used for systems with BSD sockets
2015-05-05 21:34:19 +10:00
Andrew Tridgell
08b9ed3342 AP_HAL: added socket handling class 2015-05-05 21:34:19 +10:00
Randy Mackay
9dede2f0ec Math: remove duplicate HALF_SQRT_2 definition 2015-05-05 14:23:14 +09:00
Randy Mackay
151707cb0a Filter: replace 2*M_PI_F with M_2PI_F 2015-05-05 14:22:52 +09:00
Peter Barker
463270e0ee AP_AHRS: avoid FPE when we don't have a compass reading 2015-05-05 15:02:35 +10:00
Andrew Tridgell
77a2b4acf6 AP_Math: removed fast_atan 2015-05-05 13:57:22 +10:00
Andrew Tridgell
872583f441 AC_AttitudeControl: removed fast_atan 2015-05-05 13:57:16 +10:00
Andrew Tridgell
8ba5272b0e AP_Scheduler: fixed PSTR() usage 2015-05-05 13:54:27 +10:00
Andrew Tridgell
88fb7ddff8 AP_Param: fixed PSTR() usage 2015-05-05 13:54:15 +10:00
Andrew Tridgell
089e63f987 AP_InertialSensor: fixed PSTR handling
must use PSTR on code compiled for AVR
2015-05-05 13:54:00 +10:00
Andrew Tridgell
31693e332e AP_InertialSensor: use non-PSTR printf
this is not built on AVR
2015-05-05 13:48:34 +10:00
Andrew Tridgell
730644eaeb AP_Mount: use M_PI_F instead of (float)M_PI 2015-05-05 13:44:25 +10:00
Andrew Tridgell
84ac721340 AC_AttitudeControl: use M_PI_F instead of (float)M_PI 2015-05-05 13:44:19 +10:00
Andrew Tridgell
f9114f849b Filter: revert AP_Math class change 2015-05-05 13:27:07 +10:00
Andrew Tridgell
bcc6c7d380 AP_Param: revert AP_Math class change 2015-05-05 13:27:07 +10:00
Andrew Tridgell
a140a5e77f AP_NavEKF: revert AP_Math class change 2015-05-05 13:27:07 +10:00
Andrew Tridgell
7c9e3d4b58 AP_Mount: revert AP_Math class change 2015-05-05 13:27:06 +10:00
Andrew Tridgell
0b897e04bb AP_Math: revert AP_Math class change 2015-05-05 13:27:06 +10:00
Andrew Tridgell
e6a8a6da07 AP_InertialSensor: revert AP_Math class change 2015-05-05 13:27:06 +10:00
Andrew Tridgell
015fce5183 AP_Compass: revert AP_Math class change 2015-05-05 13:27:06 +10:00
Andrew Tridgell
d2167633f0 AP_Camera: revert AP_Math class change 2015-05-05 13:27:06 +10:00
Andrew Tridgell
48fb7f8159 AP_BARO: revert AP_Math class change 2015-05-05 13:27:05 +10:00
Andrew Tridgell
4d4a607b80 AP_AHRS: revert AP_Math class change 2015-05-05 13:27:05 +10:00
Andrew Tridgell
c08b62f9e4 AC_WPNAV: revert AP_Math class change 2015-05-05 13:27:05 +10:00
Andrew Tridgell
33555b7f12 AC_PID: revert AP_Math class change 2015-05-05 13:27:05 +10:00
Andrew Tridgell
aa1bfb1ca7 AC_Fence: revert AP_Math class change 2015-05-05 13:27:04 +10:00
Andrew Tridgell
326b0b33ea AC_AttitudeControl: revert AP_Math class change 2015-05-05 13:27:04 +10:00
Andrew Tridgell
936fbbb362 AP_Math: removed AP_Math class 2015-05-05 13:27:03 +10:00
Tom Pittenger
7fd285f483 AC_WPNav: Compiler warnings: nuke fast_atan2()
per Randy's suggestion, fast_atan2() is no longer necessary over atan2() because only copter uses it and copter is no longer supported on future builds of APM

ccd578664f (commitcomment-11025083)
2015-05-05 13:27:03 +10:00
Tom Pittenger
4ec2fb3a9c AP_Math: Compiler warnings: nuke fast_atan2()
per Randy's suggestion, fast_atan2() is no longer necessary over atan2() because only copter uses it and copter is no longer supported on future builds of APM

ccd578664f (commitcomment-11025083)
2015-05-05 13:27:02 +10:00
Tom Pittenger
1b84bbc3e7 AC_WPNav: Compiler warnings: add in the appropriate whitrespace 2015-05-05 13:27:02 +10:00
Tom Pittenger
0e076d6dc8 AP_InertialSensor: compile warnings: format not a string literal, argument types not checked
PSTR() goofs things up when using hal.console->printf_P()
2015-05-05 13:27:02 +10:00
Tom Pittenger
6acd92be1e AP_RangeFinder: compiler warnings: compare signed to unsigned 2015-05-05 13:27:02 +10:00
Tom Pittenger
9e98c68099 AP_InertialSensor: compile warnings: format not a string literal, argument types not checked
PSTR() goofs things up when using hal.console->printf_P()
2015-05-05 13:27:01 +10:00
Tom Pittenger
d823541eb1 AP_Scheduler: compile warnings: format not a string literal, argument types not checked
PSTR() goofs things up when using hal.console->printf_P()
2015-05-05 13:27:01 +10:00
Tom Pittenger
bfd1b2b11a AP_Param: compile warnings: format not a string literal, argument types not checked 2015-05-05 13:27:01 +10:00
Tom Pittenger
b9771ca37c AP_Param: compile warnings: float to double. print statements require doubles 2015-05-05 13:27:00 +10:00
Tom Pittenger
330e4126bb Ap_Math: compile warnings: float to double. use atan2f instead of atan2 2015-05-05 13:27:00 +10:00
Tom Pittenger
440438fdda AP_Param: compiler warnings: apply is_zero(float) or is_equal(float)
due to an include cross-dependency between ap_param and ap_math, I punted and reimplemented is_equal() for this one function in the header
2015-05-05 13:26:58 +10:00
Tom Pittenger
820f0bf02a AP_Math: compiler warnings: float to double promotion
cast as float because we're in magical template land where T minus T means promote to double
2015-05-05 13:26:58 +10:00
Tom Pittenger
1c3ad00aa7 AP_Math: compiler warnings: use double for the constant so the template can handle it 2015-05-05 13:26:57 +10:00
Tom Pittenger
6e6f481ecb AP_Math: compiler warnings: apply is_zero(float) or is_equal(float) 2015-05-05 13:26:56 +10:00
Tom Pittenger
98c5137107 AP_HAL_PX4: compiler warnings: float to doubles 2015-05-05 13:26:56 +10:00
Tom Pittenger
54f4d4b07c AP_PID: compiler warnings: reordered constructor 2015-05-05 13:26:56 +10:00
Tom Pittenger
0b29848277 AP_Baro: compiler warnings: apply is_zero(float) or is_equal(float) 2015-05-05 13:26:56 +10:00
Tom Pittenger
d275e6711d AP_HAL_VRBRAIN: compiler warnings: apply is_zero(float) or is_equal(float) 2015-05-05 13:26:55 +10:00
Tom Pittenger
20f47417d5 AP_AHRS: compiler warnings: apply is_zero(float) or is_equal(float) and float to doubles 2015-05-05 13:26:55 +10:00
Tom Pittenger
94ffc9b942 AC_Fence: compiler warnings: apply is_zero(float) or is_equal(float) 2015-05-05 13:26:55 +10:00
Tom Pittenger
1bca81eaed AC_AttitudeControl: compiler warnings: apply is_zero(float) or is_equal(float) and float to doubles 2015-05-05 13:26:55 +10:00
Tom Pittenger
6d1b517aae Filter: compiler warnings: apply is_zero(float) or is_equal(float) 2015-05-05 13:26:55 +10:00
Tom Pittenger
913d00f525 AP_WPNav: compiler warnings: apply is_zero(float) or is_equal(float) 2015-05-05 13:26:54 +10:00
Tom Pittenger
98ca790cb9 AP_DataFlash: compiler warnings: float to double 2015-05-05 13:26:54 +10:00
Tom Pittenger
4ac1f8a2fa AP_Mount: compiler warnings: apply is_zero(float) or is_equal(float) 2015-05-05 13:26:54 +10:00
Tom Pittenger
9b53961a7d AP_NavEKF: compiler warnings: float to double 2015-05-05 13:26:52 +10:00
Tom Pittenger
3276eec30e AP_NavEKF: compiler warnings: apply is_zero(float) or is_equal(float) 2015-05-05 13:26:52 +10:00
Tom Pittenger
35f7a466e5 AP_Math: compiler warnings: apply is_zero(float) or is_equal(float) 2015-05-05 13:26:52 +10:00
Tom Pittenger
a5d2f3a82f AP_Math: compiler warnings: float to double 2015-05-05 13:26:52 +10:00
Tom Pittenger
d09ef4783d AP_Compass: compiler warnings: reorder constructors 2015-05-05 13:26:52 +10:00
Tom Pittenger
ad11a57f57 AP_Compass: compiler warnings: apply is_zero(float) or is_equal(float) 2015-05-05 13:26:51 +10:00
Tom Pittenger
820199635b AP_InertialSensors: compiler warnings: apply is_zero(float) or is_equal(float) 2015-05-05 13:26:51 +10:00
Tom Pittenger
01180d52c4 AP_PID: compiler warnings: apply is_zero(float) 2015-05-05 13:26:51 +10:00
Tom Pittenger
ac4e7b2b03 AP_Math: compiler warnings: apply is_equal(float) 2015-05-05 13:26:51 +10:00
Tom Pittenger
c93c773de2 AP_Math: change is_equal and is_zero to static class for better visability 2015-05-05 13:26:50 +10:00
Tom Pittenger
3cb2221315 AP_IntertialSensor: double to float warning 2015-05-05 13:26:50 +10:00
Tom Pittenger
bdda11b327 AP_Math: compiler warning: is_zero special case for vector3.h in a template 2015-05-05 13:26:50 +10:00
Andrew Tridgell
878eb88c3a AP_GPS: avoid expanding the ublox buffer on APM2 2015-05-05 13:25:34 +10:00
Micheal Knight
ee85d37ee2 AP_GPS: added logging of RXM_RAW messages for UBlox
this will allow for post-flight RTK processing of DF logs
2015-05-05 13:25:34 +10:00
Andrew Tridgell
f8e09da50e DataFlash: added GRAW raw GPS message
for saving RXM_RAW for post flight RTK
2015-05-05 13:25:34 +10:00
Andrew Tridgell
42c6801d61 SITL: reformat SITL code with astyle 2015-05-05 11:49:54 +10:00
Andrew Tridgell
c81ad1d622 HAL_SITL: reformat HAL_SITL with astyle 2015-05-05 10:59:07 +10:00
Lucas De Marchi
d640bc8345 AP_HAL_Linux: use kernel's limit of msgs per I2C transaction
Instead of hardcoding 8 as the limit for I2C msgs, use whatever the
kernel exported to us.  In upstream this is 42 so it means we can group
together 21 addr/data pair instead of only 8.
2015-05-05 09:56:44 +10:00
Andrew Tridgell
d8791134f9 HAL_SITL: need to use fabs() for double checking 2015-05-05 09:45:59 +10:00
Andrew Tridgell
b9abf30785 HAL_SITL: removed unused cygwin code 2015-05-05 09:45:58 +10:00
Andrew Tridgell
5158f91263 HAL_SITL: converted command line code to getopt_cpp 2015-05-05 09:45:58 +10:00
Andrew Tridgell
a58a663085 SITL: fixed build on APM2 2015-05-05 09:45:58 +10:00
Andrew Tridgell
35d22b9d57 AP_HAL: added getopt_cpp class
a simple port of getopt_long to C++
2015-05-05 09:45:58 +10:00
Andrew Tridgell
438f954379 DataFlash: fixed some build warnings 2015-05-05 09:45:58 +10:00
Andrew Tridgell
d8ca0658d7 AP_Mount: fixed some build warnings 2015-05-05 09:45:58 +10:00
Andrew Tridgell
b2b5c8cd18 HAL_SITL: fixed some build warnings 2015-05-05 09:45:58 +10:00
Andrew Tridgell
a7c3125bcc AP_GPS: fixed warnings in SBP driver 2015-05-05 09:45:57 +10:00
Andrew Tridgell
212e0ec002 StorageManager: fix for HAL_SITL rename 2015-05-05 09:45:57 +10:00
Andrew Tridgell
fa688a7b14 RC_Channel: fix for HAL_SITL rename 2015-05-05 09:45:57 +10:00
Andrew Tridgell
f449b34fdd PID: fix for HAL_SITL rename 2015-05-05 09:45:56 +10:00
Andrew Tridgell
2d89b8b53d GCS_MAVLink: fix for HAL_SITL rename 2015-05-05 09:45:56 +10:00
Andrew Tridgell
69f9d25cd0 DataFlash: fix for HAL_SITL rename 2015-05-05 09:45:56 +10:00
Andrew Tridgell
cf4602afc1 AP_TECS: fix for HAL_SITL rename 2015-05-05 09:45:56 +10:00
Andrew Tridgell
a4e8d960d2 AP_Scheduler: fix for HAL_SITL rename 2015-05-05 09:45:56 +10:00
Andrew Tridgell
c80a631813 AP_Relay: fix for HAL_SITL rename 2015-05-05 09:45:56 +10:00
Andrew Tridgell
ac43972883 AP_RangeFinder: fix for HAL_SITL rename 2015-05-05 09:45:56 +10:00
Andrew Tridgell
4ee54a8915 AP_OpticalFlow: fix for HAL_SITL rename 2015-05-05 09:45:56 +10:00
Andrew Tridgell
9f10e2d26c AP_Notify: fix for HAL_SITL rename 2015-05-05 09:45:56 +10:00
Andrew Tridgell
c4d6f9d040 AP_NavEKF: fix for HAL_SITL rename 2015-05-05 09:45:55 +10:00
Andrew Tridgell
2e57c62ebb AP_Motors: fix for HAL_SITL rename 2015-05-05 09:45:55 +10:00
Andrew Tridgell
0c142bb25a AP_Mission: fix for HAL_SITL rename 2015-05-05 09:45:55 +10:00
Andrew Tridgell
eca675c556 AP_Math: fix for HAL_SITL rename 2015-05-05 09:45:55 +10:00
Andrew Tridgell
ef527d9daa AP_InertialSensor: fix for HAL_SITL rename 2015-05-05 09:45:55 +10:00
Andrew Tridgell
2be45bc7e6 AP_GPS: fix for HAL_SITL rename 2015-05-05 09:45:55 +10:00
Andrew Tridgell
dd94cc18a1 AP_Common: fix for HAL_SITL rename 2015-05-05 09:45:55 +10:00
Andrew Tridgell
8055e5792d AP_BattMonitor: fix for HAL_SITL rename 2015-05-05 09:45:55 +10:00
Andrew Tridgell
7d9d594283 AP_Baro: fix for HAL_SITL rename 2015-05-05 09:45:55 +10:00
Andrew Tridgell
f23bc463cb AP_Airspeed: fix for HAL_SITL rename 2015-05-05 09:45:54 +10:00
Andrew Tridgell
e597575747 AP_AHRS: fix for HAL_SITL rename 2015-05-05 09:45:54 +10:00
Andrew Tridgell
d8cd986696 APM_Control: fix for HAL_SITL rename 2015-05-05 09:45:54 +10:00
Andrew Tridgell
e789984c98 AC_WPNav: fix for HAL_SITL rename 2015-05-05 09:45:54 +10:00
Andrew Tridgell
777685ce1f AC_PID: fix for HAL_SITL rename 2015-05-05 09:45:54 +10:00
Andrew Tridgell
40e3b422b5 HAL_SITL: rename HAL_AVR_SITL to HAL_SITL
it is nothing to do with the original AVR emulation now
2015-05-05 09:45:54 +10:00
Andrew Tridgell
24fc1d8ebf HAL_SITL: added -F option for FDM address 2015-05-05 09:45:54 +10:00
Andrew Tridgell
630cd14252 HAL_SITL: added rover simulator support 2015-05-05 09:45:53 +10:00
Andrew Tridgell
64fa219c05 SITL: converted rover simulator from python to C++ 2015-05-05 09:45:53 +10:00
Andrew Tridgell
11df612c04 HAL_SITL: added a table of simulator constructors 2015-05-05 09:45:53 +10:00
Andrew Tridgell
6ec6158b8b SITL: converted helicopter simulator from python 2015-05-05 09:45:53 +10:00
Andrew Tridgell
be3d6c924e AP_Compass: rename enum values to avoid header conflicts for 'ERROR' 2015-05-05 09:45:53 +10:00
Andrew Tridgell
963e5c5977 HAL_SITL: removed pthread.h as no longer needed 2015-05-05 09:45:53 +10:00
Michael Oborne
c26f2c9b1c SITL: add missing include 'select' 2015-05-05 09:45:53 +10:00
Andrew Tridgell
878549530d HAL_SITL: g_state is not needed any more 2015-05-05 09:45:53 +10:00
Andrew Tridgell
a17fc9e5ab SITL: fixed time handling type 2015-05-05 09:45:53 +10:00
Andrew Tridgell
ce0a863d01 AP_NavEKF: allow for optimisation of the EKF
disable optimisation when debugging needed
2015-05-05 09:45:53 +10:00
Andrew Tridgell
25de563687 HAL_SITL: support direct RC input 2015-05-05 09:45:52 +10:00
Andrew Tridgell
77f007ab27 SITL: support speedup setting on the command line 2015-05-05 09:45:52 +10:00
Andrew Tridgell
a6f41b3ca6 HAL_SITL: removed the need for the FDM thread
this also removes the need for the barriers
2015-05-05 09:45:52 +10:00
Andrew Tridgell
19147a05f6 SITL: support functions for new simulators 2015-05-05 09:45:52 +10:00
Andrew Tridgell
437e1bdba0 SITL: added fill_fdm() for FDM output from simulator 2015-05-05 09:45:52 +10:00
Andrew Tridgell
ab2d4349b4 HAL_SITL: initial support for internal simulators 2015-05-05 09:45:52 +10:00
Andrew Tridgell
24b051565b AP_Math: added normalize() method to Matrix3f 2015-05-05 09:45:52 +10:00
Andrew Tridgell
914b91af9e SITL: initial conversion of multicopter sim to C++ 2015-05-05 07:12:36 +10:00
Randy Mackay
2a6421d1bf Airspeed: fix example sketch 2015-05-02 20:53:49 +09:00
Randy Mackay
55298a4c73 Baro: fix example sketch 2015-05-02 17:25:44 +09:00
Paul Riseborough
be04be9b43 AP_NavEKF: Fix bug preventing home position being set by copter
The interface definition has been modified so that it returns true for a position obtained usin geither the normal inertial navigation calculation, or a raw GPS measurement.
This enables this function to be used to set a home position before flight.
2015-05-02 17:20:21 +09:00
Randy Mackay
75e2498da2 Scheduler: fix example sketch 2015-05-02 11:55:50 +09:00
Randy Mackay
c78068b8b8 StorageManager: fix example sketch 2015-05-01 21:03:13 +09:00
Randy Mackay
5b15c07d47 RC_Channel: fix example sketch 2015-05-01 21:02:57 +09:00
Randy Mackay
240a845206 Notify: fix example sketches 2015-05-01 20:58:34 +09:00
Randy Mackay
b223e90ef6 AP_Motors: fix example sketches 2015-05-01 20:58:20 +09:00
Randy Mackay
ed61d961c3 Mission: fix example sketch 2015-05-01 20:58:06 +09:00
Randy Mackay
fecbf06008 AP_Math: fix example sketches 2015-05-01 20:57:38 +09:00
Jonathan Challinger
2b29060a4e AC_WPNav: remove unused set_loiter_velocity 2015-05-01 16:46:53 +09:00
Randy Mackay
187dd0dccd HAL_PX4: fix example sketch 2015-05-01 16:44:10 +09:00
Randy Mackay
fb7e75594f AP_NavEKF: replace memset with quaternion.initialise 2015-05-01 16:37:35 +09:00
Randy Mackay
eaedeeb7bf AP_Math: add quaternion.initialise 2015-05-01 16:37:34 +09:00
Randy Mackay
c366fbbc96 AP_NavEKF: remove unused haveDeltaAngles 2015-05-01 16:37:33 +09:00
Randy Mackay
6773c0b232 AP_InertialSensor: default primary accel and gyro 2015-05-01 16:37:33 +09:00
Paul Riseborough
b71b8f4bda AP_NavEKF: Always return a NED relative position if possible
If a calculated position is not available, the function will return a value based on raw GPS or last calculation if available, but the status will be set to false to indicate that it cannot be used for control.
2015-05-01 16:37:32 +09:00
Paul Riseborough
20ba1e6b1b AP_NavEKF: Always return a WGS-84 location if possible
If a calculated location is not available, the function will return raw GPS data if available, but the status will be set to false.
2015-05-01 16:37:31 +09:00
Paul Riseborough
dd1e0b2f0b AP_NavEKF: Add missing function to return the NED to XYZ quaternion 2015-05-01 16:37:30 +09:00
Paul Riseborough
2c4572eb50 AP_NavEKF: Make ground effect variable names more descriptive 2015-05-01 16:37:29 +09:00
Paul Riseborough
3986851c51 AP_NavEKF: Prevent Z accel bias changing during ground effect takeoff
The inconsistent baro data during ground effect takeoff combined with the larger variances in the Z accel bias state early in flight can cause unwanted changes in bias estimate and therefore changes in height estimation error.
This patch turns of the process noise and state updates for the Z accel bias state when takeoff in ground effect is expected.
2015-05-01 16:37:28 +09:00
Paul Riseborough
2cba60c731 AP_NavEKF: Decouple takeoff ground effect compensation from arm transtion
Thsi fixes a potential bug where the vehicle could land at a lower location without disarming and re-enter ground effect takeoff mode wiht a baro height floor above the current altitude, causing unpredictable height gain
2015-05-01 16:37:27 +09:00
Paul Riseborough
c4c0f819b5 AP_NavEKF: Ensure Covariance initialisation uses correct IMU time step 2015-05-01 16:37:26 +09:00
Paul Riseborough
5dc29699ab AP_NavEKF: Publish the INS delta quaternion 2015-05-01 16:37:25 +09:00
Paul Riseborough
d273302ce7 AP_NavEKF: Improve rate of accel bias learning before flight 2015-05-01 16:37:24 +09:00
Paul Riseborough
8dc6354a54 AP_NavEKF: Prevent touchdown baro errors tripping height innovation check
Ground effect baro errors can cause a spike in height innovation on disarming if ground effect compensation was used during the landing. This causes a transient AHRS fault message if this innovation is outside the pre-arm check limits.
Resetting the vertical position state to the measured height after disarming prevents this.
2015-05-01 16:37:23 +09:00
Jonathan Challinger
2f38dd1b67 AP_NavEKF: use quaternion functions to apply IMU delta angles 2015-05-01 16:37:22 +09:00
Jonathan Challinger
9c374eb4a8 AP_NavEKF: apply constrained floor to barometer innovation while landing 2015-05-01 16:37:21 +09:00
Jonathan Challinger
3c6446fadd AP_NavEKF: refactor meaHgtAtTakeOff filter 2015-05-01 16:37:20 +09:00
Paul Riseborough
744de74c16 AP_NavEKF: Reduce ground effect baro induced height errors during takeoff 2015-05-01 16:37:19 +09:00
Paul Riseborough
13616d6436 AP_NavEKF: Add takeoff and touchdown expected to reported filter status 2015-05-01 16:37:19 +09:00
Jonathan Challinger
8c92524b8a AP_NavEKF: add takeoffExpected and touchdownExpected 2015-05-01 16:37:18 +09:00
Jonathan Challinger
b6b55bf6f2 AP_NavEKF: integrate gravity over correct time period 2015-05-01 16:37:17 +09:00
Jonathan Challinger
cb0c424da1 AP_NavEKF: rewrite readIMUData 2015-05-01 16:37:16 +09:00
Jonathan Challinger
bb88a4f8fe AP_InertialSensor: healthy() checks bounds 2015-05-01 16:37:15 +09:00
Jonathan Challinger
af80f20a51 AP_InertialSensor: add get_primary_gyro, fix get_primary_accel 2015-05-01 16:37:14 +09:00
Randy Mackay
0acc06d713 AP_Motors: minor comment for interlock 2015-05-01 14:30:45 +09:00
Robert Lefebvre
1a482de5e2 AP_MotorsHeli: Overload output_armed_zero_throttle 2015-05-01 14:30:25 +09:00
Robert Lefebvre
6bdace30d2 AP_Motors: Add throttle interlock functionality
AP_MotorsMatrix's output_armed_zero_throttle uses output_min default from base class
2015-05-01 14:30:24 +09:00
Randy Mackay
31edd6a72b AC_PosControl: add_takeoff_climb_rate method
This function simply increments the current altitude target given a
climb rate and dt
2015-05-01 12:56:30 +09:00
Jonathan Challinger
348001e786 AP_Motors: add get_throttle_warn function 2015-05-01 12:56:11 +09:00
Andrew Tridgell
74581a55bc HAL_SITL: fixed startup of SITL in synthetic clock mode 2015-04-30 17:19:56 +10:00
Andrew Tridgell
df21c6c68d AP_HAL: support micros64() and millis64() on all platforms
this will allow for 64 bit timestamps in DF logs (Peter is working on
that)
2015-04-30 12:17:34 +10:00
Andrew Tridgell
4c4a4f9ea5 AP_RangeFinder: fixed cm to meter comparison
thanks to EShamaev for this fix (see PR #1352)
2015-04-30 11:26:36 +10:00
Randy Mackay
dfadcad69d Mission: allow zoom_step to be negative 2015-04-29 14:36:25 +09:00
Randy Mackay
bae1722946 AP_Motors: get_compensation_gain gets div-by-zero check 2015-04-29 14:36:22 +09:00
Randy Mackay
1b381b5675 Baro: get_air_density_ratio gets div-by-zero check 2015-04-29 14:36:20 +09:00
Jonathan Challinger
41ae7207c7 AP_Motors: scale roll/pitch/yaw gain for air density 2015-04-29 14:36:15 +09:00
Jonathan Challinger
e2ba351149 AP_Motors: refactor apply_thrust_curve_and_volt_scaling 2015-04-29 14:36:12 +09:00
Jonathan Challinger
f381ef93e8 AP_Baro: add get_air_density_ratio 2015-04-29 14:36:10 +09:00
Randy Mackay
b55367ccc7 GCS_MAVLink: fix example sketch 2015-04-29 10:18:57 +09:00
Randy Mackay
67b0c6f5c4 AC_PID: replace is_equal with is_zero 2015-04-28 16:22:08 +09:00
Randy Mackay
3514177314 AC_PI_2D: minor format fix 2015-04-28 16:21:53 +09:00
dgrat
303cfd683a AC_PID: replace floating point '==' with is_equal
Also add div-by-zero check to fix calc_filt_alpha

Also get_i and get_shrink_i do not need to set values to zero in Vector2f
constructor because this is already done.
2015-04-28 16:21:46 +09:00
Randy Mackay
0392292489 AP_Math: inline is_equal, add is_zero 2015-04-28 16:19:01 +09:00
dgrat
726d7df710 AP_Math: add is_equal to compare floats 2015-04-28 16:18:59 +09:00
Grant Morphett
444841537e AP_Camera: Just putting the newline at the end of the file. 2015-04-28 15:23:34 +09:00
Andrew Tridgell
007b01533d AP_InertialSensor: switched to 16g accel range for MPU9250
this matches the Pixhawk, and makes us less prone to vibration. We
have seen clipping at 8g
2015-04-28 15:30:29 +10:00
Randy Mackay
33431acaa4 AC_WPNav: protect against div-by-zero related to gnd_speed_limit 2015-04-28 13:53:19 +09:00
Paul Riseborough
7481217445 AC_WPNav: Improve application of EKF optical flow speed limit 2015-04-28 13:53:17 +09:00
Andrew Tridgell
514c349060 AP_NavEKF: raise DCM error_rp threshold to 0.05
it was failing on many boards with fixed wing
2015-04-28 14:07:39 +10:00
Andrew Tridgell
6bfca648b9 AP_AHRS: raise DCM P gains when disarmed for first 20 seconds 2015-04-28 14:07:39 +10:00
Andrew Tridgell
42d2addbdd HAL_SITL: removed the special code for cygwin
we no longer need special timing code for cygwin
2015-04-28 13:15:40 +10:00
Andrew Tridgell
063a33ebce HAL_SITL: implement barriers using pthread condition variables
this avoid pthread_barrier_*, which is not available on cygwin
2015-04-28 13:14:12 +10:00
Jonathan Challinger
3812773485 AP_Math: make quaternion divide by zero protection more conservative 2015-04-28 11:42:13 +10:00
Jonathan Challinger
fb8da1b2d8 AP_Math: add get_euler_(roll|pitch|yaw) functions to quaternion 2015-04-28 11:42:13 +10:00
Andrew Tridgell
020d9ea78a HAL_PX4: only consider power to have changed when armed
this prevents false positives with multi-battery setups
2015-04-28 11:05:29 +10:00
Randy Mackay
608bb3d611 Notify: minor format fix 2015-04-27 12:10:17 +09:00
Andrew Tridgell
028248d1f5 HAL_SITL: avoid floating point exceptions on i386
fixes issue #2147
2015-04-27 13:09:21 +10:00
Andrew Tridgell
4e86a6cd0e GCS_MAVLink: merged upstream header changes 2015-04-27 09:00:38 +10:00
Randy Mackay
35874292a0 AC_WPNav: move stop below all loiter methods
No functional change
2015-04-26 16:26:53 +09:00
Robert Lefebvre
4a7fe83b0f AC_WPNav: Create Stop Mode functions 2015-04-26 16:11:45 +09:00
Andrew Tridgell
fdac41dbab GCS_MAVLink: re-generate headers 2015-04-25 09:12:16 +10:00
Michael Day
3d3267d472 AP_Mission: Now support mission item MAV_CMD_NAV_LOITER_TO_ALT 2015-04-25 09:12:16 +10:00
Michael Day
98d7f943ef GCS_MAVLink: Added definition for MAV_CMD_NAV_LOITER_TO_ALT 2015-04-25 09:12:16 +10:00
Jonathan Challinger
a07b322d31 AP_Motors: set_throttle takes a float 2015-04-24 16:30:45 +09:00
Jonathan Challinger
ab2532a609 AC_AttitudeControl: constrain _angle_boost to avoid overflow 2015-04-24 16:30:43 +09:00
Randy Mackay
fdf226ebc1 AP_NavEKF: include AP_RangeFinder.h 2015-04-24 15:49:11 +09:00
Tom Pittenger
10c933966b AP_Math: fix compile warning re float constants 2015-04-24 14:25:02 +09:00
Tom Pittenger
dbc01e2f1a BattMon: fix compile warning re to unused variable 2015-04-24 14:18:36 +09:00
Tom Pittenger
3b3752468d HAL_PX4: fix compile warnings re unused variables 2015-04-24 14:18:24 +09:00
Tom Pittenger
84d3069a77 AttControl_Heli: fix compile warning re member init order 2015-04-24 14:15:35 +09:00
Tom Pittenger
52474faa2e AP_ADC: fix compile warning re member init order 2015-04-24 14:15:24 +09:00
Tom Pittenger
4191c44bbd Baro: fix compile warning re member init order 2015-04-24 14:15:11 +09:00
Tom Pittenger
16e71ec1ce Compass: fix compile warning re member init order 2015-04-24 14:15:00 +09:00
Tom Pittenger
179c72bfa9 HAL_PX4: fix compile warning re member init order 2015-04-24 14:14:38 +09:00
Tom Pittenger
ee1a415baa HAL_VRBrain: fix compile warning re member init order 2015-04-24 14:14:27 +09:00
Tom Pittenger
a340d13d01 NavEKF: fix compile warning re member init order 2015-04-24 14:14:12 +09:00
Tom Pittenger
f3d13656ba PID: fix compile warnings re float constants 2015-04-24 14:04:24 +09:00
Tom Pittenger
91476d78ae SITL: fix compile warnings re float constants 2015-04-24 14:04:19 +09:00
Tom Pittenger
1575abff63 GCS_Console: fix compile warnings re float constants 2015-04-24 14:04:17 +09:00
Tom Pittenger
347fc1e59c Filter: fix compile warnings re float constants 2015-04-24 14:04:14 +09:00
Tom Pittenger
f700f76923 DataFlash: fix compile warnings re float constants 2015-04-24 14:04:12 +09:00
Tom Pittenger
5ead138917 RangeFinder: fix compile warnings re float constants 2015-04-24 14:04:10 +09:00
Tom Pittenger
5f49b79d2f Rally: fix compile warnings re float constants 2015-04-24 14:04:08 +09:00
Tom Pittenger
2179705791 PerfMon: fix compile warnings re float constants 2015-04-24 14:04:06 +09:00
Tom Pittenger
66ddfdeae6 AP_Param: fix compile warnings re float constants 2015-04-24 14:04:04 +09:00
Tom Pittenger
d6b34209b5 NavEKF: fix compile warnings re float constants 2015-04-24 14:04:02 +09:00
Tom Pittenger
a5ffadf201 AP_Motors: fix compile warnings re float constants 2015-04-24 14:04:00 +09:00
Tom Pittenger
a8dda9f2ed AP_Math: fix compile warnings re float constants 2015-04-24 14:03:54 +09:00
Tom Pittenger
a4b8575432 InertialSensor: fix compile warnings re float constants 2015-04-24 14:03:49 +09:00
Tom Pittenger
ae6d44bf82 HAL_VRBrain: fix compile warnings re float constants 2015-04-24 14:03:38 +09:00
Tom Pittenger
7e18480cd2 HAL_PX4: fix compile warnings re float constants 2015-04-24 12:49:18 +09:00
Tom Pittenger
11951dbf48 HAL_Flymaple: fix compile warnings re float constants 2015-04-24 12:48:20 +09:00
Tom Pittenger
b7fb4022b4 AVR_SITL: fix compile warnings re float constants 2015-04-24 12:47:11 +09:00
Tom Pittenger
12b604663c FrSky_Telem: fix compile warnings re float constants 2015-04-24 12:39:21 +09:00
Tom Pittenger
dffcdbd751 Curve: fix compile warnings re float constants 2015-04-24 12:39:02 +09:00
Tom Pittenger
bf1d128d70 Compass: fix compile warnings re float constants
Also fix example sketch
2015-04-24 12:29:07 +09:00
Tom Pittenger
c1d4992dac Camera: fix compile warnings re float constants 2015-04-24 12:28:03 +09:00
Tom Pittenger
0926cf17dd BattMon: fix compile warnings re float constants 2015-04-24 12:27:23 +09:00
Tom Pittenger
8f11507594 Arming: fix compile warnings re float constants 2015-04-24 12:27:05 +09:00
Tom Pittenger
e28c555889 AHRS_DCM: fix compile warnings re float constants
Also fix example sketch
2015-04-24 12:26:08 +09:00
Tom Pittenger
f4bfc12316 AP_ADC: fix compile warnings re float constants 2015-04-24 12:24:49 +09:00
Tom Pittenger
7132b39dcf AP_AutoTune: fix compile warnings re float constants 2015-04-24 12:24:19 +09:00
Tom Pittenger
2f9e0c1938 APM_PI: fix compile warnings re float constants 2015-04-24 12:24:02 +09:00
Tom Pittenger
b9865c5f3e AC_Circle: fix compile warnings re float constants 2015-04-24 12:23:38 +09:00
Tom Pittenger
4b97cc1957 AC_PID: fix compile warnings re float constants 2015-04-24 12:22:43 +09:00
Randy Mackay
b05bdd657d AP_NavEKF: getHeightControlLimit modifies height on success 2015-04-24 10:58:05 +09:00
Randy Mackay
ba94a993f5 AP_InertialNav: get_hgt_ctrl_limit only modifies limit on success 2015-04-24 10:58:00 +09:00
Paul Riseborough
51624149e1 AP_InertialNav: Add function to return EKF height control limit 2015-04-24 10:57:58 +09:00
Paul Riseborough
cf04600710 AP_NavEKF: Add public function to limit height control during OF nav 2015-04-24 10:57:56 +09:00
Paul Riseborough
68b225de4d AP_NavEKF: Prevent pre-arm baro drift affecting mag field reset height 2015-04-24 10:57:54 +09:00
Paul Riseborough
c2e6fdb56c AP_NavEKF: Reduce effect of noisy baro data on baro height offset estimate
This estimate is used to offset baro data if we need to switch across from range finder data due to sensor failure. The previous filter coefficients gave a 0.5 seconds time constant on the offset which was too susceptible to baro noise.
2015-04-24 10:57:51 +09:00
Paul Riseborough
fd7fdc1ad9 AP_NavEKF: Remove unnecessary state resets on arm and disarm
Resetting states unnecessarily creates transients due to presence of bias errors
2015-04-24 10:57:49 +09:00
Paul Riseborough
3e67080002 AP_NavEKF: Use GPS vertical velocity observations to estimate Z accel bias 2015-04-24 10:57:47 +09:00
Paul Riseborough
e48171ab11 AP_NavEKF: Improve takeoff with optical flow and range data loss
Range finder and optical flow data can drop-out and be reliable very close to ground. these patches enable the takeoff to be more relaibly detected and constrain optical flow navigation drift in the first part of takeoff.
2015-04-24 10:57:45 +09:00
Paul Riseborough
3e061b174e AP_NavEKF: Report unhealthy for all filter faults 2015-04-24 10:57:43 +09:00
Paul Riseborough
6c4c54c2ba AP_NavEKF: Use default on ground range parameter from range finder object 2015-04-24 10:57:41 +09:00
Jonathan Challinger
10476333d8 AP_NavEKF: don't run when previously disarmed and time has slipped 2015-04-24 10:57:39 +09:00
Jonathan Challinger
085faaac6a AP_NavEKF: fix delay detection so that filter properly resets after a delay 2015-04-24 10:57:36 +09:00
Randy Mackay
a01fb64f12 RangeFinder: fix example sketch 2015-04-24 10:57:25 +09:00
Randy Mackay
715da653c3 RangeFinder_Analog: set status 2015-04-24 10:57:23 +09:00
Randy Mackay
fadfa70e99 RangeFinder_MaxSonar: set status 2015-04-24 10:57:21 +09:00
Randy Mackay
e212ebb0d0 RangeFinder_PulsedLight: set status 2015-04-24 10:57:19 +09:00
Randy Mackay
aa04bef5af RangeFinder_PX4: set status and consume out of range samples 2015-04-24 10:57:16 +09:00
Randy Mackay
71de0ab815 RangeFinder_PX4_PWM: set status and consume out of range samples 2015-04-24 10:57:12 +09:00
Randy Mackay
7663b8eade RangeFinder: replace healthy with status and no_data methods 2015-04-24 10:57:10 +09:00
Randy Mackay
8ed6207ca8 RangeFinder: add pre-arm checks 2015-04-24 10:57:05 +09:00
Randy Mackay
f1cbd1f03b RangeFinder: add ground clearance parameter 2015-04-24 10:57:03 +09:00
Paul Riseborough
1c8e3f9444 AP_NavEKF: Allow EKF to pull data from range finder object 2015-04-24 10:57:01 +09:00
Paul Riseborough
7f1749dc1c AP_AHRS: Allow EKF to pull data from range finder object 2015-04-24 10:56:58 +09:00
Andrew Tridgell
f21aa17980 AP_GPS: fixed sending of GPS_RAW_INT with multiple links
thanks to ziltoid2 for this fix! See PR #2132
2015-04-24 08:21:00 +10:00
Niels Joubert
2a5b25ddbf GCS_MAVLink: Re-enable GPS Injection Packets 2015-04-24 08:01:32 +10:00
Niels Joubert
a5beef00d1 GPS: Official Swift Binary Protocol GPS Driver v3 for Piksi GPS
DRIVER FEATURES:
- All logic for RTK vs Normal now lives inside Piksi
- Supports observation uplink through telem radio
- Supports full SBP packet logging
- Reports high-rate green blinking to indicate RTK lock.
- Switchable to accept only Float or Integer RTK locks.

THIS REQUIRES PIKSI FIRMWARE v0.14 OR HIGHER
- Uses Piksi's new Pseudo-Absolute-Positioning mode
- Onboard Piksi must have Pseudo-Absolute mode enabled
- Ground Station Piksi must have a surveyed location in settings
- Ground Station Piksi must send its location to Onboard Piksi.

NEXT STEPS REQUIRED:
- EKF needs to take higher accuracy GPS into account
- EKF needs to take GPS RTK height into account
- GCS needs to support sending SBP observation packets
--- MAVProxy patch forthcoming
2015-04-24 08:01:32 +10:00
Fergus Noble
0480867de2 SITL: Update SBP simulation functions for pseudo-absolute mode 2015-04-24 08:01:32 +10:00
Paul Riseborough
405862bd8f AP_AHRS: Reduce time delay for EKF initialisation 2015-04-23 20:35:52 +09:00
Paul Riseborough
4a5bf0a266 AP_NavEKF: Reduce EKF start time
Makes EKF start conditional on DCM solution tilt error
2015-04-23 20:35:48 +09:00
Paul Riseborough
5184bca87f AP_AHRS: Prevent DCM reporting good tilt error when inverted 2015-04-23 20:35:39 +09:00
Paul Riseborough
ea8217bd3a AP_AHRS: Reduce time constant on filtering of DCM error reporting
Reduces time constant from 2 to 1 second to make data more useful for pre-flight alignment checks by the EKF
2015-04-23 20:35:35 +09:00
Randy Mackay
7e43eaafab GPS: TYPE param description to PX4-UAVCAN 2015-04-23 20:17:26 +09:00
Randy Mackay
6e30093924 AP_AHRS: correct sanity checks on update_trig 2015-04-23 09:45:43 +09:00
Jonathan Challinger
6a6ccb4f32 AP_AHRS: add sanity checks 2015-04-22 21:50:51 +09:00
Randy Mackay
c6f71ea2e0 AHRS: make get_error_rp and get_error_yaw const 2015-04-21 22:42:17 +09:00
Randy Mackay
18a73d8630 Camera: use camera feedback flag 2015-04-21 22:22:57 +09:00
Randy Mackay
26383183d2 GCS_MAVLink: version update after generate 2015-04-21 22:22:54 +09:00
Randy Mackay
48c6803717 GCS_MAVLink: generate after fixing camera feedback flags 2015-04-21 22:22:52 +09:00
Randy Mackay
8e2616ddcf GCS_MAVLink: prefix camera feedback flags 2015-04-21 22:22:49 +09:00
Dario Lindo Andres
a21d328b93 GCS_Mavlink: Update ardupilotmega.xml
Define PHOTO flag on CAMERA_FEEDBACK_FLAGS.
2015-04-21 22:22:47 +09:00
Randy Mackay
8ced9cc904 Gimbal: only include for high performance CPUs 2015-04-21 21:47:18 +09:00
Randy Mackay
93ba2d2d32 Mount_MAVLink: uses vehicle's sysid 2015-04-21 21:47:17 +09:00
Randy Mackay
e726a05f3b Gimbal: fix to parameter init order
resolves a compiler warning
2015-04-21 21:47:16 +09:00
Randy Mackay
e9b2153672 Gimbal: formatting fixes
Also isCopterFlipped returns bool instead of uint8_t
No functional change
2015-04-21 21:47:15 +09:00
Randy Mackay
db6bb295c7 Mount: add gimbal parameter descriptions 2015-04-21 21:47:14 +09:00
Randy Mackay
924a3b2c67 GCS_MAVLink: version update after generate 2015-04-21 21:47:13 +09:00
Randy Mackay
9f10c43708 GCS_MAVLink: generate after GIMBAL/GOPRO msgs added 2015-04-21 21:47:12 +09:00
Angus Peart
86b81120fd GCS_MAVLink: update gopro message definitions 2015-04-21 21:45:53 +09:00
Jonathan Challinger
231f776dd7 AP_Gimbal: change isCopterFlipped() 2015-04-21 21:45:52 +09:00
Arthur Benemann
e59c6ddbae AP_SmallEKF: increase start-up time of the SmallEKF 2015-04-21 21:45:51 +09:00
Arthur Benemann
21b909f670 AP_Gimbal: report gimbal angles using a 312 rotation vector 2015-04-21 21:45:50 +09:00
Arthur Benemann
2850c7ab4a AP_Gimbal: nest AP_Gimbal files into AP_Mount library 2015-04-21 21:45:49 +09:00
Arthur Benemann
608017ba4a AP_Gimbal: optimize function calls using const refrences 2015-04-21 21:45:48 +09:00
Arthur Benemann
03c0e17a4d AP_Gimbal: fix typo 2015-04-21 21:45:47 +09:00
Arthur Benemann
03974c93bb AP_Gimbal: use new quaternion math to handle gimbal lock issue 2015-04-21 21:45:46 +09:00
Arthur Benemann
255c5b3025 AP_Mount: report MAVLink gimbal angle to the GCS 2015-04-21 21:45:45 +09:00
Arthur Benemann
b3c35aee4e AP_Gimbal: fix problem with rotation math on control loop 2015-04-21 21:45:44 +09:00
Arthur Benemann
4bdf909bbf AP_Mount: Create new copter parameters to hold gimbal settings 2015-04-21 21:45:43 +09:00
Arthur Benemann
cf2377d113 AP_Gimbal: Move gimbal parameters to a structure 2015-04-21 21:45:42 +09:00
Arthur Benemann
9b94f26583 AP_Gimbal: Relax minimal angle constrains on the gimbal 2015-04-21 21:45:41 +09:00
Arthur Benemann
a05fe7e117 AP_Gimbal: Re-implement the target low-pass filter 2015-04-21 21:45:40 +09:00
Arthur Benemann
b3dd8891c8 AP_Mount: Use AP_Gimbal on the AP_Mount_MAVLink class 2015-04-21 21:45:38 +09:00
Arthur Benemann
ee8c92c850 AP_Gimbal: clean-up for AP_Mount merge 2015-04-21 21:45:37 +09:00
Arthur Benemann
4ad3e786a5 AP_NavEKF: fix initialization of the SmallEKF
The constructor 'states' variable was not being called. To make sure other variables where also zeroed now
2015-04-21 21:45:36 +09:00
Arthur Benemann
0189f80462 AP_Gimbal: update getGimbalRateDemVecTilt to use quaternions 2015-04-21 21:45:35 +09:00
Arthur Benemann
4bdae02cfd AP_Gimbal: disable gimbal motors if copter is fliped 2015-04-21 21:45:34 +09:00
Arthur Benemann
ebaf1e28b1 AP_Gimbal: smooth the RC input with a low pass filter 2015-04-21 21:45:33 +09:00
Arthur Benemann
534790634b AP_Gimbal: add a radio failsafe state to the gimbal 2015-04-21 21:45:32 +09:00
Arthur Benemann
1da4be3a87 AP_Gimbal: initial implementation of the rate controlled gimbal library 2015-04-21 21:45:30 +09:00
Arthur Benemann
1d9beed42f AP_SmallEKF: add function to report if the EKF is stable 2015-04-21 21:45:29 +09:00
Arthur Benemann
7b28bf7d44 AP_NavEKF: Remove small EKF dependency on navigation EKF 2015-04-21 21:45:28 +09:00
Arthur Benemann
558a69bdca Mount_MAVLink: remove code now in AP_Gimbal 2015-04-21 21:44:56 +09:00
Jonathan Challinger
2053d5e42e GCS_MAVlink: add GIMBAL_ and GOPRO_ messages 2015-04-21 21:40:05 +09:00
Randy Mackay
87e6452ee9 Mission: bug fix when jump target is zero
This would result in copter flying to a waypoint high above home
2015-04-21 20:42:49 +09:00
Andrew Tridgell
a0969905ce AP_AHRS: make get_error_rp() and get_error_yaw() const
this makes them usable by multiple consumers, and allows use by EKF
2015-04-21 21:42:17 +10:00
Andrew Tridgell
2dfe3cb844 DataFlash: added a perf counter for microSD overruns
this allows us to tell if a microSD can handle a high logging rate
2015-04-21 20:45:30 +10:00
Andy Piper
b0937154f5 DataFlash: log compass health
This patch simply logs the health of each compass for easy diagnosis.
2015-04-21 13:18:24 +09:00
Andrew Tridgell
c153d31dd2 DataFlash: speed up DataFlash in Replay 2015-04-21 10:14:41 +10:00
Andrew Tridgell
dcb25632fb AP_Compass: removed old setHIL compass offset 2015-04-21 08:30:05 +10:00
Andrew Tridgell
a4bad1c703 HAL_SITL: use SIM_MAG_OFS in SITL compass 2015-04-21 08:29:51 +10:00
Andrew Tridgell
1ce9cb693a SITL: added SIM_MAG_OFS for setting compass offsets in SITL 2015-04-21 08:29:27 +10:00
Andrew Tridgell
179e47c618 HAL_Linux: prevent time from going backwards in Replay 2015-04-20 15:12:51 +10:00
Andrew Tridgell
d7000c4105 AP_Compass: fixed compass timestamps in Replay 2015-04-20 15:12:51 +10:00
Randy Mackay
337a94e52e Camera: remove empty configure_msg method 2015-04-20 13:50:15 +09:00
Randy Mackay
d456b97fd2 Camera: control_cmd triggers pic 2015-04-20 13:50:12 +09:00
Jaime Machuca
38491c4ff7 Camera: fix mission cmds sending msgs to components
mission commands were triggering the sending of
mavlink mission items when they should have been sending
command long messages
2015-04-20 13:50:10 +09:00
Randy Mackay
4eb3263653 Camera: mission cmds send do-digicam msgs to components
This allows digicam-control and digicam-configure mission
command to trigger sending the equivalent mavlink messages
to components
2015-04-20 13:50:08 +09:00
Randy Mackay
8dcd555037 Camera: trigger_pic sends do-digicam-control to components
This (optionally) allows pictures triggered from ch7/ch8
switch to send a mavlink do-digicam-control message to
components
2015-04-20 13:50:06 +09:00
Randy Mackay
1f705eb6a3 GCS_MAVLink: add send_to_components method 2015-04-20 13:50:04 +09:00
Randy Mackay
888c2289ce Mission: support do-digicam-control parameters 2015-04-20 13:50:01 +09:00
Peter Barker
c95348c1d9 SITL: Avoid run-time FPEs due to bad gyro settings if SIM_DRIFT_TIME is set to 0
_gyro_drift essentially suffers a divide-by-zero if SIM_DRIFT_TIME is 0.  The gyro initialisation routines in AP_InertialSensor do not return once the generated NaN propogates back to them.
2015-04-19 07:24:45 +10:00
Jonathan Challinger
12957867fd AC_PosControl: fix thr twitch when changing modes 2015-04-18 12:38:44 +09:00
Randy Mackay
44d2ae06fb Mount: unix style line endings 2015-04-17 22:59:34 +09:00
Randy Mackay
06ea18f97e Filter: fix LPF example sketch 2015-04-17 22:54:06 +09:00
Randy Mackay
99a9a88529 Filter: dt check fix for LPF 2015-04-17 10:59:03 +09:00
Jonathan Challinger
f20a91ec95 Filter: add dt<0 check to LPF 2015-04-17 10:47:06 +09:00
Randy Mackay
22e1156c31 Filter: add some comments to LowPassFilter 2015-04-17 10:47:04 +09:00
Jonathan Challinger
738b1967ad AC_PosControl: use LowPassFilterVector2f 2015-04-17 10:47:01 +09:00
Jonathan Challinger
8f667b3d1c AC_PosControl: fix up comments 2015-04-17 10:46:59 +09:00
Jonathan Challinger
4993fd4d71 AP_Motors: use new lowpass filter 2015-04-17 10:46:47 +09:00
Jonathan Challinger
87500d9d70 AC_AttitudeControl: use new lowpass filter 2015-04-17 10:46:45 +09:00
Jonathan Challinger
76da2868d0 Filter: rework LowPassFilter 2015-04-17 10:46:42 +09:00
Leonard Hall
c2a6a0a9e2 AC_PosControl: add accel filter parameter 2015-04-16 21:00:45 +09:00
Leonard Hall
a632a57d79 AC_PosControl: accessors to log z-axis vel and accel 2015-04-16 21:00:32 +09:00
Leonard Hall
0aca3c4be6 AC_PosControl: add relax Alt Hold controllers 2015-04-16 21:00:25 +09:00
Leonard Hall
24b8d32b0e AC_AttitudeControl: add comment 2015-04-16 21:00:22 +09:00
Leonard Hall
7cb3c4ba39 AC_PosControl: add feed forward to Alt Hold 2015-04-16 21:00:20 +09:00
Randy Mackay
a1e6a3ee32 AC_PosControl: minor format fix 2015-04-16 21:00:14 +09:00
Jonathan Challinger
3e0dab7b2d AC_PosControl: remove accel error filter and set throttle output filter instead 2015-04-16 21:00:07 +09:00
Jonathan Challinger
b7f7624aac AC_AttitudeControl: add throttle filter cutoff parameter to set_throttle_out functions 2015-04-16 21:00:04 +09:00
Jonathan Challinger
e80776f1f5 AP_Motors: remove MOT_THR_FILT parameter and add interface to configure filter 2015-04-16 21:00:01 +09:00
Jonathan Challinger
518e798f53 AC_AttitudeControl: rework angle_boost 2015-04-16 20:59:58 +09:00
Jonathan Challinger
7abd02baf2 AC_PosControl: change int32/int16 to float in accel_to_throttle 2015-04-16 20:59:55 +09:00
Jonathan Challinger
d14893fcd5 AC_PosControl: don't limit throttle any more 2015-04-16 20:59:51 +09:00
Jonathan Challinger
f3555d0d43 AC_AttitudeControl: modify throttle interface to specify stabilization 2015-04-16 20:59:45 +09:00
Jonathan Challinger
5c2341009a AC_AttitudeControl: throttle is a float 2015-04-16 20:59:42 +09:00
Jonathan Challinger
8e442675a7 AP_Motors: introduce set_stabilize(bool), specifies whether torque demands should be output 2015-04-16 20:59:40 +09:00
Jonathan Challinger
bc2afb31dd AP_Motors: virtual not necessary in child class 2015-04-16 20:59:37 +09:00
Jonathan Challinger
a2c69fe90d AP_Motors: add optional motor output throttle filter 2015-04-16 20:59:31 +09:00
Leonard Hall
4d9da2720b AC_AttitudeControl: add get for angle bf errors 2015-04-16 13:29:52 +09:00
Leonard Hall
88be3d67e7 AP_Motors: add get for throttle comp 2015-04-16 13:29:50 +09:00
Leonard Hall
791fbcf9b3 AP_Motors_Class: time constants of throttle comp 2015-04-16 13:29:46 +09:00
Michael du Breuil
04e9141881 AP_TECS: Allow tecs to control throttle during takeoff 2015-04-16 08:56:37 +10:00
Michael du Breuil
a9fc2b8a32 AP_Vehicle: Moved takeoff_throttle_max into plane parameters 2015-04-16 08:56:36 +10:00
Andrew Tridgell
4586de6637 AP_NavEKF: enable optimisation in Linux build
only really need debugging for SITL
2015-04-16 08:36:16 +10:00
Leonard Hall
48fb487a8c AC_AttitudeControl: Formatting fix 2015-04-15 22:04:27 +09:00
Paul Riseborough
dffa2e19bf AP_NavEKF: Make copter glitch accel consistent with timeout and radius 2015-04-15 17:32:48 +09:00
Paul Riseborough
5d70854c08 AP_NavEKF: Fix minor bug in calculation of innovation variance
the innovation variance for GPS should be the sum of squares of the state and measurement uncertainty.
2015-04-15 17:32:46 +09:00
Paul Riseborough
1008c6390c AP_NavEKF: Fail absolute position status if GPS repeatedly rejected 2015-04-15 17:32:44 +09:00
Paul Riseborough
77d3798278 AP_NavEKF: Reduce recovery time after a GPS fusion timeout 2015-04-15 17:32:41 +09:00
Paul Riseborough
0852aeab6e AP_NavEKF: Allow raw innovations to be monitored during timeouts 2015-04-15 17:32:39 +09:00
Paul Riseborough
d3f4b4a02b AP_NavEKF: Fix name consistency for data check time stamps 2015-04-15 17:32:36 +09:00
Jonathan Challinger
6ea91d012e AC_PID: calculate filt_alpha every time the filter is run 2015-04-14 16:19:02 +09:00
Randy Mackay
f06c859d93 AC_Fence: add comment re check_fence method 2015-04-14 16:10:09 +09:00
Jonathan Challinger
05fda4ee4c AC_Fence: accept curr_alt parameter instead of getting alt from inav 2015-04-14 16:10:07 +09:00
Jonathan Challinger
f06cc5d0c1 AC_Fence: change inav to const reference 2015-04-14 16:10:02 +09:00
Staroselskii Georgii
dff430e136 AP_HAL_Linux: added UART port for second GPS 2015-04-14 15:59:34 +10:00
Staroselskii Georgii
da6316ed4c AP_HAL_Linux: fixed TCP client connection in LinuxUARTDriver 2015-04-14 15:59:33 +10:00
Randy Mackay
39213584da AC_WPNav: minor comment and formatting changes 2015-04-14 14:50:58 +09:00
Jonathan Challinger
fd55068620 AC_WPNav: fix double-twitch on stop in loiter 2015-04-14 14:50:55 +09:00
Jonathan Challinger
1da410a6c6 AC_WPNav: allow user to tune loiter 2015-04-14 14:50:53 +09:00
mirkix
13ee34c58a AP_InertialSensor: MPU9150 fix compiler warnings 2015-04-14 11:14:48 +10:00
Staroselskii Georgii
4a3e61f4e4 AP_GPS: turn UBlox autodetection only for NavIO 2015-04-14 10:45:49 +10:00
Staroselskii Georgii
716fd56c62 AP_HAL_Linux: added support for dynamic speed configration in LinuxSPIUARTDriver 2015-04-14 10:45:49 +10:00
Staroselskii Georgii
47a336d192 AP_GPS: added Ublox' hardware generation autodetection 2015-04-14 10:45:49 +10:00
Staroselskii Georgii
baf2b4da4e AP_HAL_Linux: renamed AnalogIn_Navio 2015-04-14 10:16:26 +10:00
Mikhail Avkhimenia
7ba6a5e346 AP_HAL: Specify terrain directory for Navio 2015-04-14 10:16:25 +10:00
Staroselskii Georgii
930aeaf556 AP_HAL_Linux: add RPi version runtime detection 2015-04-14 10:16:25 +10:00
Mikhail Avkhimenia
c11304ba7a AP_HAL_Linux: change GPIO register address for Raspberry Pi 2 2015-04-14 10:16:25 +10:00
Staroselskii Georgii
641fa05028 AP_HAL_Linux: added buffering in RCOutput_Navio 2015-04-14 10:16:25 +10:00
Staroselskii Georgii
e6c2977da2 AP_HAL_Linux: fixed style in RCOutput_Navio 2015-04-14 10:16:25 +10:00
Staroselskii Georgii
024825f95a AP_HAL_Linux: fixed PCA9685 initialization for RCOutput_Navio 2015-04-14 10:16:25 +10:00
Staroselskii Georgii
2a137b6ea9 AP_HAL_Linux: fixed RCInput initialization on NavIO 2015-04-14 10:16:24 +10:00
Sean O\'Brien
6474aa2477 AP_HAL_AVR_SITL: added sensor delays to sitl. 2015-04-14 10:10:38 +10:00
Sean O\'Brien
bfba8870e2 AP_HAL_AVR_SITL: added sensor delays to sitl. 2015-04-14 10:10:35 +10:00
Lucas De Marchi
b292873304 AP_InertialSensor: fix starvation in L3G4200D
The main thread would always be blocked on the semaphore to read the
data from accelerometer and gyroscope. Especially if we have a slow
update of these values in _accumulate() due to the I2C transfer function
taking too much time: the timer thread would never give up the CPU,
causing starvation on the main thread.

This fixes the issue by reducing the critical region using a flip-buffer
so _accumulate() can work on its own copy of the data. Now that the
critical region is smaller, also avoid the semaphore and use a spinlock
instead.
2015-04-14 10:01:47 +10:00
Andrew Tridgell
b17878c8c4 SITL: lower default GPS delay to 0.2 seconds
this matches typical uBlox
2015-04-14 09:57:47 +10:00
Andrew Tridgell
d7249cc1e6 AP_AHRS: only use EKF for plane and rover if all data available
we need position and velocity to be working for plane and rover
2015-04-14 09:57:45 +10:00
Lucas De Marchi
996739df12 AP_Compass: Do not panic if compass is not found
Copter uses 2 compasses for linux configuration, but one of them may not
be available. Do not panic if a AK8963 isn't found.
2015-04-14 09:29:12 +10:00
Gustavo Jose de Sousa
be67b019a7 AP_GPS: Add missing setup for GPS_AUTO_test
GPS_AUTO_test was missing some setup lines.
2015-04-14 09:27:41 +10:00
Andrew Tridgell
7f7d92913e HAL_Linux: allow running as non-root
this is needed for Replay, plus is very useful for debugging
2015-04-14 09:25:35 +10:00
Lucas De Marchi
f049c8e4c5 AP_HAL_Linux: remove needless call to mlockall()
All threads share the same address space and have the same pages locked
into memory so it's not necessary to call mlockall() for each of them.

Grepping /proc/<tid>/status gives the same VmLck for all of them, even
when only the main thread locks the memory:

    # for i in `seq 477 482`; do \
	name=$(cat /proc/$i/comm); \
	vm=$(cat /proc/$i/status |grep VmLck); \
        echo -e "$name\t$vm"; \
    done
    ArduCopter.elf  VmLck:     57868 kB
    sched-timer     VmLck:     57868 kB
    sched-uart      VmLck:     57868 kB
    sched-rcin      VmLck:     57868 kB
    sched-tonealarm VmLck:     57868 kB
    sched-io        VmLck:     57868 kB
2015-04-14 09:17:21 +10:00
Lucas De Marchi
b7355dc62b AP_HAL_Linux: set thread name for ease debug
Use pthread_setname_np() to set thread name so it's easier to debug
what't going on with each of them. This is the example output of the
relevant par of "ps -Leo class,rtprio,wchan,comm":

FF      12 futex_ ArduCopter.elf
FF      15 usleep sched-timer
FF      14 hrtime sched-uart
FF      13 poll_s sched-rcin
FF      11 hrtime sched-tonealarm
FF      10 hrtime sched-io
2015-04-14 09:17:21 +10:00
Lucas De Marchi
2c48434110 AP_HAL_Linux: use a table to initialize threads
Refactor function calls into a table and pass in the name so it can be
used in error message.
2015-04-14 09:17:21 +10:00
Lucas De Marchi
e3d78b8960 AP_HAL_Linux: fix passing callback to member function
It's undefined behavior to pass the callback to pthread to a class
member like we were doing. Refactor the code so the callbacks are static
members.

This fixes the following warnings:

libraries/AP_HAL_Linux/Scheduler.cpp: In member function 'virtual void Linux::LinuxScheduler::init(void*)':
/home/lucas/p/dronecode/ardupilot/libraries/AP_HAL_Linux/Scheduler.cpp:61:76: warning: converting from 'void* (Linux::LinuxScheduler::*)()' to 'Linux::LinuxScheduler::pthread_startroutine_t {aka void* (*)(void*)}' [-Wpmf-conversions]
                            (pthread_startroutine_t)&Linux::LinuxScheduler::_timer_thread);
                                                                            ^
libraries/AP_HAL_Linux/Scheduler.cpp:65:76: warning: converting from 'void* (Linux::LinuxScheduler::*)()' to 'Linux::LinuxScheduler::pthread_startroutine_t {aka void* (*)(void*)}' [-Wpmf-conversions]
                            (pthread_startroutine_t)&Linux::LinuxScheduler::_uart_thread);
                                                                            ^
libraries/AP_HAL_Linux/Scheduler.cpp:69:76: warning: converting from 'void* (Linux::LinuxScheduler::*)()' to 'Linux::LinuxScheduler::pthread_startroutine_t {aka void* (*)(void*)}' [-Wpmf-conversions]
                            (pthread_startroutine_t)&Linux::LinuxScheduler::_rcin_thread);
                                                                            ^
libraries/AP_HAL_Linux/Scheduler.cpp:73:76: warning: converting from 'void* (Linux::LinuxScheduler::*)()' to 'Linux::LinuxScheduler::pthread_startroutine_t {aka void* (*)(void*)}' [-Wpmf-conversions]
                            (pthread_startroutine_t)&Linux::LinuxScheduler::_tonealarm_thread);
                                                                            ^
libraries/AP_HAL_Linux/Scheduler.cpp:77:76: warning: converting from 'void* (Linux::LinuxScheduler::*)()' to 'Linux::LinuxScheduler::pthread_startroutine_t {aka void* (*)(void*)}' [-Wpmf-conversions]
                            (pthread_startroutine_t)&Linux::LinuxScheduler::_io_thread);
2015-04-14 09:17:20 +10:00
Lucas De Marchi
62c2f737d5 AP_HAL_Linux: fix setting RT priorities
LinuxScheduler::init() was not really working as it should. This was the
result of "ps -Leo class,rtprio,wchan,comm | grep ArduCopter":

FF      12 futex_ ArduCopter.elf
FF      12 usleep ArduCopter.elf
FF      12 hrtime ArduCopter.elf
FF      12 poll_s ArduCopter.elf
FF      12 hrtime ArduCopter.elf
FF      12 hrtime ArduCopter.elf

As can be seen all the threads run with the same priority, the one of the main
thread. There were basically 2 mistakes:

	1) pthread_attr_setschedpolicy() needs to be called before
	   pthread_attr_setschedparam(). Otherwise the latter will just return
	   an error and not set the priority

	2) pthread_create() defaults to ignore the priority and inherit the
	   it from the parent thread. pthread_attr_setinheritsched() needs to
	   be called to change the behavior to PTHREAD_EXPLICIT_SCHED. See
	   pthread_attr_setinheritsched(3) for an example program to test the
	   behaviors.

Also, it's undefined behavior to call pthread_attr_init() several times on the
same pthread_attr_t. Although we could reutilize the same attribute without
calling  pthread_attr_init() again, lets refactor the code a little bit, so all
the pthread calls are in a single place. Then also call pthread_attr_destroy()
when we are done.
2015-04-14 09:17:20 +10:00
Lucas De Marchi
29b667efdf AP_HAL_Linux: remove useless mlock of stack
In Linux the default stack size is always greater than 32k, either 2MB
or 8MB depending on the architecture. There's no point in creating a
function to lock 32k.
2015-04-14 09:17:20 +10:00
Randy Mackay
e2071a4630 Notify: ToneAlarm fix to stopping continuous tones 2015-04-13 17:44:45 +09:00
Randy Mackay
2472702838 Notify: rename lost_copter to vehicle_lost 2015-04-13 17:44:44 +09:00
Jaime Machuca
043d24f03a Notify: add Lost Copter tone 2015-04-13 17:42:07 +09:00
Andrew Tridgell
0695277773 HAL_SITL: use pthread barriers for synthetic clock synchronisation
this avoids siganls and provides a race free way of keeping time in
lock step
2015-04-13 06:05:55 +10:00
Paul Riseborough
e79ccf1fcc AP_NavEKF: Fix bug allowing terrain to be above vehicle position
The terrain state and vehicle state need to be compared at the same time horizon.
2015-04-11 15:51:08 +09:00
Paul Riseborough
6d58c63c4c AP_NavEKF: Prevent potential divide by zeros in OF fusion 2015-04-11 15:51:03 +09:00
Paul Riseborough
89142f1c5f AP_NavEKF: Prevent inadvertent use of DCM roll and pitch estimates.
the use of roll and pitch from the AHRS object is bad because that object could be returning estimates from the backup DCM algorithm.
2015-04-11 15:19:05 +09:00
Randy Mackay
56d2306a18 BattMon_SMBus_PX4: read capacity 2015-04-11 14:10:22 +09:00
Randy Mackay
c6440a48b3 BattMon_Backend: add init and set_capacity methods 2015-04-11 14:10:19 +09:00
Paul Riseborough
9268024094 AP_NavEKF: Update default parameters for copter optical flow fusion 2015-04-10 11:08:11 +09:00
Paul Riseborough
4fbdab27ff AP_NavEKF: Use range finder for primary hgt ref in opt flow mode
Falls back to baro if range finder is unavailable
Adds parameter enabling user to select which height source (baro or range finder) will be used during optical flow nav.
2015-04-10 11:08:07 +09:00
Paul Riseborough
ff9917d338 AP_AHRS: Fix bug preventing EKF from initialising 2015-04-10 11:07:42 +09:00
Paul Riseborough
d618c55e2f AP_NavEKF: Improved handling of noisy GPS speed accuracy data 2015-04-10 11:07:34 +09:00
Paul Riseborough
53358a4e10 AP_OpticalFlow: Add parameter to compensate for flow sensor yaw angle
AP_OpticalFlow: update parameter name
2015-04-10 11:07:31 +09:00
Paul Riseborough
cab171b580 AP_InertialNav: Add method to return EKF height above ground estimate
AP_InertialNav: Add validity flag to height above ground estimate
2015-04-10 11:07:27 +09:00
Paul Riseborough
e98edaa6cb AP_NavEKF: Return more accurate validity status for height above ground 2015-04-10 11:07:24 +09:00
Paul Riseborough
586e4a7d2b AP_NavEKF: Add Matlab derivations and simulations behind small EKF 2015-04-10 11:07:21 +09:00
Jonathan Challinger
dc5bdd5ad8 AP_AHRS: use filtered INS output to compute _accel_ef_blended 2015-04-09 20:19:56 +09:00
Randy Mackay
a095a8c3a1 AC_PID: more protection against NaN and Inf 2015-04-09 20:19:55 +09:00
Randy Mackay
bdfe8bbc54 AC_AttControl_Heli: remove RATE_RP_MAX, RATE_Y_MAX 2015-04-09 20:19:54 +09:00
Leonard Hall
afcd1c6ec3 AC_AttitudeControl: sqrt controller on Stab 2015-04-09 20:19:43 +09:00
Leonard Hall
ae77c18a19 AC_PID: Protect against NaN and INF 2015-04-09 18:30:12 +09:00
Andrzej Zaborowski
132cdc4916 Motors: Use _motor_to_channel_map in tricopter consistently.
In AP_MotorsTri.cpp the AP_MOTORS_MOT_1, _2 and _4 constants are
always mapped to actual output channels through _motor_to_channel_map
while the _CH_TRI_YAW is not, but there were a few inconsistencies
in this that could lead to things like PWM min and max values being
set on wrong channels.

It looks like all in all _motor_to_channel_map being in PROGMEM
probably doesn't help save memory and I'm not sure how useful it is
in the first place but regardless the usage should be consistent.
2015-04-09 11:43:22 +09:00
Randy Mackay
558018d839 InertialNav: add get_location method 2015-04-09 10:56:57 +09:00
Tom Pittenger
9ecbd0e30f AP_L1_Control: fixed uTurn-wobble
When performing a u-turn in AUTO (waypoints are 180deg turn from each other) sometimes the aircraft can't decide to turn left or right and wobbled back and forth a couple times. There was existing code to solve this but it was not executing all the time like when in LOITER mode. Frankly, I don't understand the criteria that was required to make it execute and i suspect there is still a gremlin in that logic but just executing the check all the time makes prevents the wobble behavior.
2015-04-08 15:21:02 -07:00
Jonathan Challinger
6e8008ab69 AP_SerialManager: use protocol_match in find_baudrate 2015-04-08 09:14:31 -07:00
Randy Mackay
f260536373 AC_PID: fix example sketch compile error 2015-04-08 15:05:29 +09:00
Jonathan Challinger
6baec4952b AP_Math: add conversions to and from 3-1-2 euler angles 2015-04-07 21:20:51 -07:00
Jonathan Challinger
a1d4f40c16 AP_Math: change quaternion operator* and operator/ to const 2015-04-07 21:20:51 -07:00
Jonathan Challinger
07735fefa6 AP_Math: fix div by zero in quaternion 2015-04-07 21:20:51 -07:00
Paul Riseborough
c57e25142c AP_NavEKF: Update optical flow fusion maths to reduce height errors 2015-04-07 20:51:18 -07:00
Andrew Tridgell
35bac3ab4f GCS_MAVLink: regenerate without mavlink_frame_char changes 2015-04-06 16:43:02 -07:00
Andrew Tridgell
df948e7358 AP_Mount: fixed for new GIMBAL_REPORT message 2015-04-06 16:42:23 -07:00
Andrew Tridgell
33824e0b2f GCS_MAVLink: re-ran generate.sh 2015-04-06 16:30:16 -07:00
Jonathan Challinger
73b8890bd3 GCS_MAVLink: move GIMBAL_REPORT and GIMBAL_CONTROL and reserve messages 2015-04-06 16:29:02 -07:00
myly10
55befdc345 AP_NavEKF: Typo correction for EAS_NOISE description 2015-04-06 15:52:29 -07:00
mirkix
445f358839 AP_HAL_Linux: Fix compiler warning of MAX_PWMS redefinition (previously defined) 2015-04-06 15:34:50 -07:00
Andrew Tridgell
5284211c96 AP_SerialManager: fixed matching bug in protocol_match()
thanks to Mike Clement for noticing this
2015-04-06 15:28:03 -07:00
Mike Clement
c5c40adb76 GCS_MAVLink: use instance in find_baudrate 2015-04-06 14:47:51 -07:00
Mike Clement
89a50b99bb SerialManager: use instance in find_baudrate 2015-04-06 14:47:11 -07:00
Paul Riseborough
9b3656e77c AP_NavEKF: Fix bug introduced in Y axis flow fusion 2015-04-05 21:17:20 -07:00
Andrew Tridgell
6e52ef2a74 GCS_MAVLink: added send_local_position() 2015-04-05 09:16:41 -07:00
Andrew Tridgell
baf292def1 AP_NavEKF: prevent float exception on startup 2015-04-05 09:16:14 -07:00
Paul Riseborough
7fc0f026d2 AP_NavEKF: Fix bug in optical flow innovation variance integrity check
The check allowed negative innovation variances to pass. If this did occur, the filter would diverge.
2015-04-04 17:03:06 -07:00
Andrew Tridgell
389148ac54 AP_RangeFinder: use RNGFND_OFFSET for distance offset in PWM and I2C 2015-04-04 17:03:00 -07:00
Andrew Tridgell
55019abd71 AP_HAL: allow for default parameter override for PX4 and SITL 2015-04-04 09:01:40 -07:00
Andrew Tridgell
5a755c0400 AP_Param: allow a HAL_PARAM_DEFAULTS_PATH to override defaults
this allows a HAL_PARAM_DEFAULTS_PATH to be specified for a build to
override the default parameters for a build. This is useful to build a
firmware that has different default parameters
2015-04-04 09:01:40 -07:00
Andrew Tridgell
82a51e8791 GCS_MAVLink: use AP_Param::set_param_by_name() 2015-04-04 09:01:40 -07:00
Andrew Tridgell
5ca38e3d75 AP_Param: added set_param_by_name()
this simplifies the GCS_MAVLink code
2015-04-04 09:01:39 -07:00
Andrew Tridgell
c1a0375562 AP_NavEKF: prevent divide by zero in EKF logging 2015-04-04 07:09:02 -07:00
Paul Riseborough
d44cf14178 AP_AHRS : Publish EKF learned compass offsets 2015-04-03 15:24:47 -07:00
Paul Riseborough
10f050c53b AP_NavEKF: Prevent baro drift causing toilet bowling
The magnetic field states are reset once at 1.5 metres and again at 5 metres. This height check was using the height at the first arm event as the reference. In the situation where there is baro drift and extgended time between the first arm event and flight, this can cause the magnetic field state to be reset when on the ground. If this happens when flying off a metallic surface, the resultant heading errors can cause sever toilet bowling.
2015-04-03 15:18:42 -07:00
Paul Riseborough
d4c60ca956 AP_NavEKF: Fix bug preventing reset of velocity after OF fusion timeout 2015-04-03 15:18:39 -07:00
Jonathan Challinger
95cd3480ec AP_NavEKF: review all uses of dtIMU and use dtIMUactual where necessary
pair-programmed-with: Paul Riseborough <p_riseborough@live.com.au>
2015-04-03 15:18:09 -07:00
Andrew Tridgell
79b44d3988 AP_NavEKF: initialise gndEffectMode 2015-04-03 15:15:11 -07:00
Andrew Tridgell
3165c43dfe AP_NavEKF: initialise gpsSpdAccuracy 2015-04-03 15:15:11 -07:00
Paul Riseborough
98c32012fa AP_NavEKF: remove accel bias rate limit when disarmed 2015-04-03 15:15:11 -07:00
Paul Riseborough
fe76cb4c0b AP_NavEKF : Make initial height variance consistent with baro noise
This makes sense to do because we initialise the state to the instantaneous baro reading
2015-04-03 15:15:11 -07:00
Paul Riseborough
a976e9dad2 AP_NavEKF : Fix bug in scaling of initial Z accel bias state variance 2015-04-03 15:15:11 -07:00
Paul Riseborough
92df3adb5e AP_NavEKF : Fix bug in Z accel bias update for IMU1 2015-04-03 15:15:10 -07:00
Paul Riseborough
5d0952ba23 AP_NavEKF: eliminate onGndBaroNoise 2015-04-03 15:15:10 -07:00
Paul Riseborough
fafb898341 AP_NavEKF: tuning change to accel bias learning 2015-04-03 15:15:10 -07:00
Paul Riseborough
398accd151 AP_NavEKF: Improve pre-flight ready checking 2015-04-03 15:15:10 -07:00
Paul Riseborough
5c1a226bef AP_NavEKF : Improvements to pre-arm IMU bias estimation 2015-04-03 15:15:10 -07:00
Jonathan Challinger
a5924acb3d AP_NavEKF: set dtIMU from ins expected sample rate 2015-04-03 15:15:10 -07:00
Paul Riseborough
a1351e73ab AP_NavEKF : Compensate mag bias states for external copass offset changes 2015-04-03 15:15:09 -07:00
Paul Riseborough
14795719f6 AP_NavEKF: Add public function for estimated magnetometer offsets 2015-04-03 15:15:09 -07:00
Paul Riseborough
1c244af3d8 AP_NavEKF: Fix bug affecting in-flight GPS acquisition
This bug caused velocities to be reset to zero
2015-04-03 15:15:09 -07:00
Paul Riseborough
b9b6938b1d AP_NavEKF: Add ability to start using GPS in-flight
Improve the quality of the GPS required to set an EKF  origin
Eliminate repeated update of origin height - origin height updates once when EKF origin is set.
Operation in GPS mode is linked to setting of origin
2015-04-03 15:15:09 -07:00
Paul Riseborough
98fa918b84 AP_NavEKF: Add new compass learning option
Enables compass learning to be on continuously for non-position hold operation
2015-04-03 15:15:09 -07:00
Paul Riseborough
961faa59d9 AP_NavEKF: Don't let reported GPS accuracy modify horiz vel data checks 2015-04-03 15:15:08 -07:00
Paul Riseborough
a607eb8469 AP_NavEKF: Reduce the GPS glitch tether length from 100 to 50m 2015-04-03 15:15:08 -07:00
Paul Riseborough
496d31ab83 AP_NavEKF: Reduce max time Copters can reject GPS
The maximum time copters can reject GPS has been reduced from 10 to 7 seconds as flight logs have show that inertial dead reckoning with vibration and calibration errors is not good enough to support 10 seconds without aiding.
2015-04-03 15:15:08 -07:00
Paul Riseborough
8c2029d896 AP_NavEKF: Accel bias learning improvements
Speed up pre-flight learning
Smoothen in-flight learning
2015-04-03 15:15:08 -07:00
Paul Riseborough
19d1b3b813 AP_NavEKF: Update EKF origin height whilst disarmed
This patch causes the EKF to update the height of its origin each time it receives a valid GPs message whislt disarmed.
The resultant EKF origin height represents the height of the zero baro alt datum relative to the GPS height datum.
2015-04-03 15:15:08 -07:00
Paul Riseborough
70afcd7e70 AP_NavEKF: Add second stage alignment of yaw and earth field states
Flight tests have shown that the magnetic field distortion associated with flight from steel structures can extend 3m or higher. To counteract this, a second and final yaw and magnetic field alignment has been added which is activated when the height exceeds 5m for the first time.
2015-04-03 15:15:08 -07:00
Paul Riseborough
ed9c05cf2a AP_NavEKF: Remove logic used to delay fusion for load levelling
Logic used to delay optical flow and airspeed fusion to prevent it occurring on the same time step as magnetometer fusion has been removed. This is no longer required to efficiency improvements made at the firmware level.
2015-04-03 15:15:07 -07:00
Paul Riseborough
c0d23ffc30 AP_NavEKF: Filter accuracy and stability improvements
Improvements in PX4 firmware have reduced the computational load  and mkae the previous practicwe of splitting magnetometer and optical flow fusion across multiple time steps unnecessary and make it possible to perform a covariance prediction prior to fusing data on the same time step. This patch:

1) Ensures that a covariance prediction is always performed prior to fusion of any observation
2) Removes the splitting of magnetometer fusion so that fusion of the X,Y and Z components occurs on the same time time step
3) Removes the splitting of optical flow fusion so that fusion of X and Y components occurs on the same time step
2015-04-03 15:15:07 -07:00
Jonathan Challinger
de1f7f5e63 AP_NavEKF: use published delta velocities and delta angles if available 2015-04-03 15:15:07 -07:00
priseborough
3421a320b5 AP_NavEKF: Compensate for ground effect when takeoff or landing expected 2015-04-03 15:15:07 -07:00
Jonathan Challinger
20d92f5f9d AP_NavEKF: floor GPS velocity noise at parameter value for conservatism 2015-04-03 15:15:07 -07:00
priseborough
9a797a5d49 AP_NavEKF: Use GPS reported speed accuracy if available
UBlox receivers report an estimate of the speed accuracy that tests show correlates well to speed glitches. Using this to scale the GPS velocity observation noise will reduce the effect of bad GPS velocity data.
2015-04-03 15:15:06 -07:00
Andrew Tridgell
45e016ea5b AP_InertialSensor: check for zero delta_velocity dt 2015-04-03 15:10:47 -07:00
Jonathan Challinger
b306d7a356 AP_InertialSensor: accel cal sample for 400ms instead of 1s 2015-04-03 14:54:19 -07:00
Jonathan Challinger
1e1d8efa22 AP_InertialSensor: use expected update rate for accel cal sampling 2015-04-03 14:54:17 -07:00
Jonathan Challinger
bd84328440 AP_InertialSensor: hack to "reset" the accel filter before taking a cal sample 2015-04-03 14:54:15 -07:00
Jonathan Challinger
b2b42e081a AP_InertialSensor: use delta_velocity/dt for calibration if available 2015-04-03 14:54:10 -07:00
Jonathan Challinger
423160eaf8 AP_InertialSensor: publish delta_velocity_dt 2015-04-03 14:54:06 -07:00
Andrew Tridgell
4147825b87 AP_InertialSensor: fixed gyro calibration bug
we must not update _gyro_offset[] until we have completed calibration
of that gyro, or we will end up using the new offsets when asking for
the raw gyro vector
2015-04-03 06:57:30 -07:00
Andrew Tridgell
728dbf24db AP_Math: fixed vector inequality test
many thanks to cat888

fixes issue #2039
2015-04-01 20:40:37 -07:00
Randy Mackay
d738eda59d GCS_MAVLink: integrate Serial Manager instance 2015-04-01 14:59:23 -07:00
Randy Mackay
1ed7737669 Mount: integrate Serial Manager instance 2015-04-01 14:59:21 -07:00
Randy Mackay
cbcd32d698 GPS: integrate Serial Manager instance 2015-04-01 14:59:20 -07:00
Randy Mackay
c148330c2b FrSkyTelem: integrate Serial Manager instance 2015-04-01 14:59:18 -07:00
Randy Mackay
aef16160dc SerialManager: consolidate MAVLink1 and 2 2015-04-01 14:59:17 -07:00
Randy Mackay
ca92821445 Filter: LowPassFilter gets another div-by-zero check 2015-04-01 10:34:28 -07:00
Jonathan Challinger
57f8a4d29d Filter: add get_cutoff_frequency 2015-04-01 10:15:07 -07:00
Jonathan Challinger
1828515b3b AP_Motors: bug fix to _batt_voltage_filt 2015-04-01 10:15:06 -07:00
Jonathan Challinger
89cdd02f58 AP_Motors: remove duplicate get_throttle function 2015-04-01 10:15:05 -07:00
Jonathan Challinger
0e53c0a892 AP_Motors: make output_armed() and output_disarmed() pure virtual 2015-04-01 10:14:38 -07:00
Andrew Tridgell
5acc4c333b AP_Arming: accept accel/gyro if OK in last 10 seconds
this should prevent short periods of movement from triggering arming
status change alarms
2015-03-31 15:37:24 -07:00
Randy Mackay
3f3e622be5 AC_PID: fix example sketch 2015-03-30 16:07:56 -07:00
Andrew Tridgell
8ba043e593 AP_AHRS: fixed EKF startup bug
This fixes the EKF for when GPS lock takes more than 10 seconds

fixes issue #2010
2015-03-28 10:52:22 -07:00
Andrew Tridgell
3289d38339 AP_NavEKF: make the init functions return bool
we need to know if it has initialised successfully
2015-03-28 10:51:38 -07:00
Andrew Tridgell
7cd7ff89fd HAL_PX4: recover 12k of ram from USB buffers
faster NuttX means we don't need such larger buffers
2015-03-27 15:08:52 -07:00
Andrew Tridgell
10ec1b8290 DataFlash: example no longer builds with APM2 2015-03-26 06:32:00 -07:00
Andrew Tridgell
5cbfe4fd11 HAL_SITL: fixed copter interactive SITL 2015-03-25 12:27:27 -07:00
Andrew Tridgell
0c2232a4be HAL_SITL: don't sync clocks during system initialisation 2015-03-24 08:06:50 -07:00
Jonathan Challinger
127791127c AC_PosControl: fix double literals 2015-03-24 06:29:04 -07:00
Leonard Hall
09aa2f8114 AC_AttitudeControl: Fix function discription 2015-03-23 07:40:04 -07:00
Leonard Hall
6b104c0529 AC_AttitudeControl: No Overshoot limit for Stab
This maybe done in a more obvious way using a switch rather than just
making the overshoot larger than 180 degrees.
2015-03-23 07:40:02 -07:00
Andrew Tridgell
9748cb1e3e HAL_SITL: use a synthetic clock when possible
this decouples wall clock time from simulation time if the FDM
supports it
2015-03-22 18:57:30 -07:00
Randy Mackay
8a3a7bdcd1 Mount: add set_angle_target method 2015-03-21 21:52:22 +09:00
Randy Mackay
f6021010c5 Mission: support do-mount-control 2015-03-21 21:52:19 +09:00
Randy Mackay
2189b16165 Mount_SToRM: remove message throttling
recent versions of gimbal firmware can handle 50hz update rate
2015-03-21 05:56:18 +09:00
Randy Mackay
b3362d5829 Mount: calc_angle_to_location returns vehicle relative yaw 2015-03-21 05:56:16 +09:00
Randy Mackay
d2739c5ce5 Mount_SToRM: slow updates to 10hz, reverse yaw, pitch 2015-03-20 20:46:45 +09:00
Randy Mackay
c7dd6ae816 BattMon: SMBus becomes unhealthy after 5sec timeout
Also remove unused internal variable
2015-03-20 11:05:30 +09:00
Randy Mackay
c44f304253 BattMon: analog monitor always healthy 2015-03-20 11:05:27 +09:00
Randy Mackay
98efcd5f03 AHRS: always use EKF for copter 2015-03-19 15:15:51 +09:00
Andrew Tridgell
5a4ed85588 AP_TECS: added TECS_LAND_PMAX
this limits maximum pitch during the flare, which both reduces
integrator windup and prevents too high pitch which can cause a stall
2015-03-19 14:46:41 +11:00
Randy Mackay
9aba885231 AC_Fence: fix prearm check
before arming the EKF's pred_horiz_pos_abs flag should be used
2015-03-18 21:25:47 +09:00
Andrew Tridgell
ecd2a6f515 DataFlash: log temperature of IMUs
this is the first step towards supporting temperature calibration of
IMUs
2015-03-17 13:33:26 +11:00
Andrew Tridgell
23272e4013 AP_InertialSensor: added get_temperature() interface
this will allow logging of individual temperature sensors
2015-03-17 13:32:54 +11:00
Randy Mackay
7f25938834 AHRS: fix example sketch 2015-03-16 20:29:19 +09:00
Randy Mackay
b01f9505b1 Mission: fix example sketch
Also replace printf with print where possible
2015-03-16 20:29:05 +09:00
Randy Mackay
385b3744ea MotorTri: check servo_out above min_throttle 2015-03-16 14:49:38 +09:00
Randy Mackay
f9e29a7f77 MotorSingle: check servo_out above min_throttle
We need to recalc radio_out or the motors could fall below min throttle
2015-03-16 14:49:37 +09:00
Randy Mackay
8de5d16f96 MotorCoax: check servo_out above min_throttle
We need to recalc radio_out or the motors could fall below min throttle
2015-03-16 14:49:35 +09:00
Leonard Hall
9a3f48cc1f AC_PosControl: ensure throttle output above zero 2015-03-16 14:49:33 +09:00
Leonard Hall
31a55b2bd6 MotorsMatrix: fix div by zero by ensuring throttle is above min 2015-03-16 14:49:31 +09:00
Paul Riseborough
9c2f1ce869 AP_Mount: Fix bug in mavlink gimbal attitude control 2015-03-16 09:54:43 +11:00
ahcorde
103bb2a08d AP_InertialSensor: Fix orientation MPU6000 PXF 2015-03-16 09:50:51 +11:00
mirkix
d4d42599b0 AP_HAL_Linux: Add RcInput and RcOutput with only one PRU when using a BBB. BBBMINI use the RC AIO PRU firmware already 2015-03-16 09:33:54 +11:00
mirkix
a6b018eab9 AP_HAL_Linux: BBBMINI use kernel CS now 2015-03-16 09:15:06 +11:00
Jonathan Challinger
dff899647f AP_Mount: use AP_AHRS_TYPE instead of AP_AHRS_MOUNT 2015-03-16 09:14:03 +11:00
Jonathan Challinger
f92c711d14 AP_AHRS: define AP_AHRS_TYPE to be the type of AHRS in use 2015-03-16 09:14:03 +11:00
Andrew Tridgell
569626ac1a AP_TECS: fixed APM2 build 2015-03-16 08:40:18 +11:00
Andrew Tridgell
cf2445dc97 AP_InertialSensor: prevent nested accelerometer calibration 2015-03-15 15:22:59 +11:00
Andrew Tridgell
8fc58d1cbe AP_Vehicle: expose LAND_FLARE_SEC in vehicle parameters for fixed wing 2015-03-15 13:52:34 +11:00
Andrew Tridgell
060f553097 AP_TECS: provide a much smoother transition before flare
this moves the pitch constraint smoothly between unconstrained and
fully constrained over two time constants before the flare. This
greatly reduces the sudden pitch changes at flare
2015-03-15 13:52:17 +11:00
Andrew Tridgell
9c0614c7bb AP_RangeFinder: default test to I2C Lidar 2015-03-15 13:50:59 +11:00
Andrew Tridgell
c8b0970e61 AP_Compass: show compass count in example 2015-03-14 20:00:29 +11:00
Andrew Tridgell
c565d3b805 AP_Airspeed: fixed example build 2015-03-14 20:00:15 +11:00
Andrew Tridgell
f4455d063e AP_Compass: fixed example 2015-03-14 17:07:39 +11:00
Andrew Tridgell
585a105128 AP_AHRS: use compass->last_update_usec() 2015-03-14 12:31:50 +11:00
Andrew Tridgell
de3f461a55 AP_NavEKF: use compass->last_update_usec() 2015-03-14 12:31:39 +11:00
Andrew Tridgell
1962706a33 AP_Compass: fixed last_update, using last_update_usec()
this broke use of compass in the EKF
2015-03-14 12:31:23 +11:00
Andrew Tridgell
86fc90f54c AP_Compass: removed spurious rotation in PX4 backend
and cleanup rotation macros
2015-03-14 08:52:37 +11:00
Andrew Tridgell
d7bac39539 AP_Compass: removed two unused functions 2015-03-14 08:52:37 +11:00
Andrew Tridgell
73782c41a9 DataFlash: disable CLI on APM2 2015-03-13 22:52:55 +11:00
Andrew Tridgell
8a99cab535 AP_InertialSensor: load only HIL backend for hil_mode 2015-03-13 22:52:55 +11:00
Andrew Tridgell
fec2025469 AP_Compass: added set_hil_mode() 2015-03-13 22:52:55 +11:00
Andrew Tridgell
2e9d2e6449 AP_Baro: load only HIL backend for hil_mode 2015-03-13 22:52:55 +11:00
Randy Mackay
bb74b8dec8 AC_PosControl: fix twitch when entering RTL
Also removed slow_cpu flag
Fixed bug in update to _accel_target_jerk_limited.
2015-03-13 20:47:19 +09:00
Andrew Tridgell
8f6982860f AP_Compass: fixed devid for 2nd compass 2015-03-13 20:46:32 +11:00
Andrew Tridgell
7b51c907f5 AP_Compass: zero some more variables in constructor and init 2015-03-13 19:22:11 +11:00
Andrew Tridgell
4bc92b6373 AP_Compass: removed _product_id var 2015-03-13 18:59:52 +11:00
Andrew Tridgell
3a1cbaeb25 AP_Mission: fix for new compass API 2015-03-13 18:46:18 +11:00
Andrew Tridgell
b488d6de00 AP_AHRS: fix for new compass API 2015-03-13 18:46:17 +11:00
Andrew Tridgell
520c7c1306 AP_InertialSensor: always allow for AK8963 on MPU9250 2015-03-13 18:46:17 +11:00
Andrew Tridgell
d040318014 AP_Baro: removed unused define 2015-03-13 18:46:17 +11:00
Vic
033bd243d6 SITL: Changes in compass for SITL 2015-03-13 18:46:16 +11:00
Andrew Tridgell
60b8736cf1 AP_InertialSensor: use right AK8963 compass defines 2015-03-13 18:46:15 +11:00
Andrew Tridgell
b52918331a AP_HAL: make PXF use AK8963 compass by default 2015-03-13 18:46:15 +11:00
Andrew Tridgell
d186b82edc AP_HAL: consolidate AK8963 defines 2015-03-13 18:46:15 +11:00
Andrew Tridgell
0efd3bacea AP_Compass: make new backend match old PX4 behaviour
when a compass is internal only apply board orientation, not user
specified rotation
2015-03-13 18:46:15 +11:00
Andrew Tridgell
a871c87cad AP_Compass: use state array for compass variables 2015-03-13 18:46:15 +11:00
Víctor Mayoral Vilches
13f0aa5ecd AP_Compass: Separate common code into backend
_copy_to_frontend function takes care of abstracting
this code from the driver. For now the function takes
care of the offset and rotation that is common.
2015-03-13 18:46:15 +11:00
Víctor Mayoral Vilches
d3b76cd8d3 AP_Compass: split compass into frontend/backend 2015-03-13 18:46:15 +11:00
Randy Mackay
385558db4d OptFlow: fix example sketch 2015-03-13 16:41:01 +09:00
Randy Mackay
4772fd338c Mission: fix example sketch 2015-03-13 16:40:59 +09:00
Randy Mackay
c88ff00f5f AC_WPNav: remove example sketch
this only tested compiling anyway
2015-03-13 16:40:57 +09:00
Randy Mackay
ce2d0a14a6 AC_Sprayer: remove example sketch
This only tested compiling anyway
2015-03-13 16:40:54 +09:00
Randy Mackay
4754ecc9e2 AC_Fence: remove example sketch
This only tested compiling anyway
2015-03-13 16:40:52 +09:00
Randy Mackay
90702e2d79 AC_AttControl: remove example sketch
This sketch only tested compiling anyway
2015-03-13 16:40:50 +09:00
Randy Mackay
883e23b97d GPS_Glitch: remove class
This logic is now within the EKF
2015-03-13 16:40:48 +09:00
Randy Mackay
0344ec5d89 Arming: remove GPS glitch checks 2015-03-13 16:40:43 +09:00
Randy Mackay
0dc985a6ab Notify: remove GPS glitch notification 2015-03-13 16:40:41 +09:00
Randy Mackay
4461952534 InertialNav: remove GPS glitch protection and baro reference 2015-03-13 16:40:39 +09:00
Randy Mackay
9012c538fb InertialNav: remove example sketch 2015-03-13 16:40:35 +09:00
Randy Mackay
a76d970cc6 InertialNav_EKF: remove fall back to complementary filter 2015-03-13 16:40:33 +09:00
Randy Mackay
7221070533 InertialNav: make parent virtual 2015-03-13 16:40:31 +09:00
Randy Mackay
4e7d92094c Baro: remove glitch detection 2015-03-13 16:40:29 +09:00
Randy Mackay
c54b5b9af9 InertialNav: remove baro glitch protection 2015-03-13 16:40:25 +09:00
Randy Mackay
8e8487c699 Notify: remove baro_glitch reporting 2015-03-13 16:40:23 +09:00
Andrew Tridgell
1f70b34cbc AP_Baro: fixed baro startup on PXF cape 2015-03-13 13:48:41 +11:00
Andrew Tridgell
808c33d0a7 AP_InertialSensor: support both MPU9250 and MPU9255
seems to be just different WHOAMI register
2015-03-13 13:26:49 +11:00
Andrew Tridgell
8fee936ad7 HAL_SITL: fixed emulation of MTK1.6 GPS 2015-03-13 10:30:20 +11:00
Andrew Tridgell
e0870d5038 AP_GPS: disable NMEA and SiRF on AVR 2560
we are too low on flash space for plane on APM2 now
2015-03-13 10:30:00 +11:00
Andrew Tridgell
5da80f44b1 AP_GPS: fixed MTK1.6 time handling
my MTK1.6 does not use hectoseconds, it uses milliseconds
2015-03-13 10:29:36 +11:00
Randy Mackay
230ca583d1 NavEKF: support sending EKF_STATUS_REPORT 2015-03-12 12:20:00 +09:00
Randy Mackay
5ee67e63ec GCS_MAVLink: add EKF_STATUS_REPORT to enum 2015-03-12 12:19:58 +09:00
Randy Mackay
3c555fc396 GCS_MAVLink: version number after adding EKF_STATUS_REPORT 2015-03-12 12:19:56 +09:00
Randy Mackay
5aef7e6d1a GCS_MAVLink: generate after adding EKF_STATUS_REPORT 2015-03-12 12:19:54 +09:00
Randy Mackay
d464344c34 GCS_MAVLink: add EKF_STATUS_REPORT message to xml 2015-03-12 12:19:50 +09:00
Andrew Tridgell
07fd31c724 AP_InertialSensor: change copter filters to 20Hz
with the backend filters disabled 20Hz is closer to the old default of
30Hz
2015-03-12 13:11:17 +11:00
Andrew Tridgell
e0a0c3afcf AP_Arming: default to arming required 2015-03-12 12:53:27 +11:00
Andrew Tridgell
a1d43e39e0 AP_InertialSensor: added get_gyro_filter_hz() and get_accel_filter_hz() 2015-03-12 12:50:31 +11:00
Andrew Tridgell
3d7d46b9b0 AP_InertialSensor: replaced INS_MPU6K_FILTER with INS_ACCEL_FILTER and INS_GYRO_FILTER
this allows filtering to be set separately on accels and gyros where possible
2015-03-12 12:50:31 +11:00
Andrew Tridgell
f3314791f2 AP_InertialSensor: removed INS_CALSENSFRAME
it is no longer needed as we have shifted the accel cal indexes
2015-03-12 12:50:31 +11:00
Andrew Tridgell
4bc6c8e655 AP_InertialSensor: shift to new parameter indexes for accel calibration
this allows for users to switch between development trees and previous
stable versions while retaining their accel calibration values.
2015-03-12 12:50:30 +11:00
Andrew Tridgell
5d0eb49114 AP_InertialSensor: calculate queue depth based on requested sample rate
this auto-scales the queue depth for plane, rover and copter
2015-03-12 12:50:30 +11:00
Andrew Tridgell
f3706d63c7 Filter: prevent copying the filter parms on apply 2015-03-12 12:50:30 +11:00
Andrew Tridgell
ea49d1cd39 AP_InertialSensor: removed unused variable 2015-03-12 12:50:30 +11:00
Andrew Tridgell
b36122dec0 Filter: removed stdio.h
breaks AVR build
2015-03-12 12:50:30 +11:00