Jonathan Challinger
bd8c804ab5
AP_NavEKF2: correct comments
2016-06-28 14:20:12 +10:00
Jonathan Challinger
ebae95d7f6
AP_NavEKF2: apply corrections to new inertial data when using for output prediction
2016-06-28 14:20:11 +10:00
Jonathan Challinger
2f709dfe86
AP_NavEKF2: improve inertial prediction
2016-06-28 14:20:11 +10:00
Paul Riseborough
262c5fe56d
AP_NavEKF2: Make setter loop through all instances
...
For setters where a success boolean is returned, return false if any instance fails.
2016-06-28 14:20:11 +10:00
Jonathan Challinger
8baf064317
AP_NavEKF2: setTakeoffExpected and setTouchdownExpected loop through instances
2016-06-28 14:20:11 +10:00
Paul Riseborough
ec5c460584
AP_NavEKF2: Fix predicted nav reporting
...
Predicted nav should never be false if current nav is true
2016-06-28 14:20:11 +10:00
Jonathan Challinger
99f481e098
AP_NavEKF2: always calcGpsGoodForFlight
2016-06-28 14:20:11 +10:00
Jonathan Challinger
3382e09580
AP_NavEKF2: add height constraint during takeoff
2016-06-28 14:20:11 +10:00
Paul Riseborough
4bb46af861
AP_NavEKF2: Increase allowable gyro bias offset
2016-06-28 14:20:10 +10:00
Andrew Tridgell
af23a681e0
AP_BoardConfig: improved docs for BRD_SAFETYENABLE
2016-06-28 09:58:55 +10:00
Lucas De Marchi
1f96336f7c
Global: rename bus type enum entries
2016-06-27 17:51:41 -03:00
Gustavo Jose de Sousa
f6bebc96c0
AP_InertialSensor: INS_generic: remove unused includes
2016-06-27 17:22:43 -03:00
Gustavo Jose de Sousa
e85ac8b2c5
AP_InertialSensor: inform maximum gyro average difference
...
While at it, define GYRO_INIT_MAX_DIFF_DPS.
2016-06-27 17:22:43 -03:00
Gustavo Jose de Sousa
e6f62080f5
AP_InertialSensor: fix best_diff on gyro initialization
...
Without this patch, if accel_diff.length() > 0.2f and j == 0, then
best_diff[k] would be zero forever since diff_norm[k] >= 0 for any j.
2016-06-27 17:20:51 -03:00
Gustavo Jose de Sousa
de94392759
AP_InertialSensor: MPU9250: remove _bus_type field
...
Use _dev->bus_type instead.
2016-06-27 17:20:51 -03:00
Gustavo Jose de Sousa
83feb2e2ae
AP_InertialSensor: MPU9250: let Device handle read flag
...
There's no need to handle that in MPU9250 anymore.
2016-06-27 17:20:51 -03:00
Gustavo Jose de Sousa
1e99a7125c
AP_InertialSensor: MPU9250: remove _register_write_check()
...
That function isn't used in the code base and there should be a better way to
debug writes on registers.
2016-06-27 17:20:51 -03:00
Gustavo Jose de Sousa
a6e5eb9e14
AP_InertialSensor: MPU6000: remove _bus_type field
...
Use _dev->bus_type instead.
2016-06-27 17:20:51 -03:00
Gustavo Jose de Sousa
0718649c8b
AP_InertialSensor: MPU6000: let Device handle read flag
...
There's no need to handle that in MPU6000 anymore.
2016-06-27 17:20:51 -03:00
Gustavo Jose de Sousa
309fe4a88c
AP_InertialSensor: MPU6000: remove _register_write_check()
...
That function isn't used in the code base and there should be a better way to
debug writes on registers.
2016-06-27 17:20:51 -03:00
Gustavo Jose de Sousa
d35cf60ce1
AP_HAL_Linux: I2CDevice: use read flag in read_registers_multiple
...
Use the generic support in Device interface for read flag when we are
using read_registers_multiple() method.
2016-06-27 17:20:46 -03:00
Gustavo Jose de Sousa
66f1ad9ed0
AP_HAL: Device: add support for read flag
...
Many of our SPI and I2C sensors define the protocol of setting the most
significant bit of the register address in order to perform a read operation.
Thus, enable the use of a "read flag" that is ORed with the register's address.
Since this is an abstraction for general devices, it's a good idea to have zero
as the default value for that flag.
While at it, add documentation to read_registers().
2016-06-27 17:18:35 -03:00
Gustavo Jose de Sousa
b6a1d598e3
AP_HAL: Device: document write_register()
2016-06-27 17:18:35 -03:00
Gustavo Jose de Sousa
4693501d9d
AP_HAL: Device: add bus_type field
...
Sometimes it's necessary to know the type of bus to make some decisions where
AP_HAL::Device abstraction is used.
2016-06-27 17:18:35 -03:00
Michael du Breuil
c2da36d505
GCS_MAVLink: fix race condition when recieving last waypoint
...
only shows up when the waypoint is about to time out
2016-06-27 10:57:14 +10:00
Andrew Tridgell
689595080a
AP_Airspeed: ensure we have at least 10 samples for airspeed cal
...
thanks to Michael for pointing out this issue
2016-06-27 10:52:59 +10:00
Tom Pittenger
37f990bfad
AP_ADSB: allow param based VEHICLE list sizes, 1 to 100.
2016-06-26 11:03:33 -07:00
Lucas De Marchi
b70b9ed8d1
AP_HAL_Linux: fix warning on 64b printf
...
../../libraries/AP_HAL_Linux/Perf.cpp: In member function ‘void Linux::Perf::_debug_counters()’:
../../libraries/AP_HAL_Linux/Perf.cpp:85:36: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
c.name, c.count);
^
2016-06-25 12:05:55 -03:00
Daniel Ricketts
865aad7598
AC_Avoid: add support for stopping at polygon fence
2016-06-25 15:55:55 +09:00
Randy Mackay
26a6234a29
AC_Avoid: do not attempt to stop at circular fence if already breached
2016-06-25 15:55:55 +09:00
Randy Mackay
c6f9889a25
AC_Avoid: constify get_max_speed
...
Also get_stopping_distance and get_margin
2016-06-25 15:55:55 +09:00
Randy Mackay
5153c3d195
AC_Fence: merge with add polygon support
2016-06-25 15:55:55 +09:00
Randy Mackay
d91805edbf
AC_Fence: add support for polygon fences
2016-06-25 15:55:55 +09:00
Randy Mackay
f0bb1ac1d2
AC_Fence: AC_Polygon_loader loads points from eeprom
...
Thanks to Peter Barker for his work to library-ify Plane's geofence which was the basis for this work.
2016-06-25 15:55:55 +09:00
Daniel Ricketts
249d95b413
AP_Math: add Polygon_outside and Polygon_complete functions
2016-06-25 15:55:55 +09:00
Leonard Hall
80bda572ba
AC_AttutudeControl: Yaw shift fix
2016-06-24 18:15:48 +09:00
Leonard Hall
a5bb3c206e
Dataflash: Log rate to degrees
2016-06-24 17:17:16 +09:00
Leonard Hall
8737f6b62d
AC_AttitudeControl: enhanced quaternion attitude controller
2016-06-24 17:17:11 +09:00
Leonard Hall
117ae89505
AC_AttitudeControl: increase SLEW_YAW default to 60deg/sec
2016-06-24 16:24:17 +09:00
Leonard Hall
e0eecd56b2
AP_Math: use is_zero and float constants
2016-06-24 16:16:34 +09:00
Leonard Hall
7f933140c7
AP_Math: small formatting fix to quaternion rotation_matrix
...
No functional change
2016-06-24 16:16:33 +09:00
Leonard Hall
8afd29cc85
AP_Math: add quaternion::rotation_matrix_norm
2016-06-24 16:16:28 +09:00
Randy Mackay
a1548405c1
AC_AttitudeControlHeli: fix althold lean angle max
2016-06-24 15:03:59 +09:00
Andrew Tridgell
1f29b51dd6
AP_Vehicle: moved roll_limit_cd into AP_Vehicle
...
will be used by APM_Control
2016-06-24 11:39:21 +10:00
Andrew Tridgell
8a03b3ba22
APM_Control: reduce elevator when past LIM_ROLL_CD
...
this reduces elevator control when rolled over hard in fixed
wing. Using the elevator when on the side just caused earth frame yaw
and is counter productive. It can also prevent some aircraft from
recovering from inverted flight.
2016-06-24 11:28:18 +10:00
Andrew Tridgell
a6e927d434
SITL: default gyro cal off in XPlane and FlightAxis
...
pointless doing cal on these backends
2016-06-24 10:32:52 +10:00
Gustavo Jose de Sousa
f9cb760691
AP_Mount: use ARRAY_SUBSCRIPT instead of bytes field
...
That fixed compilation issues and seems more semantically correct. Using array
of length 0 fails compilation because of -Werror=array-bounds in GCC 6.1.
2016-06-23 21:02:05 -03:00
Gustavo Jose de Sousa
174cefa8a5
AP_GPS: use ARRAY_SUBSCRIPT instead of bytes field
...
That fixed compilation issues and seems more semantically correct. Using array
of length 0 fails compilation because of -Werror=array-bounds in GCC 6.1.
2016-06-23 21:02:05 -03:00
Lucas De Marchi
1962acad49
AP_Common: simplify ARRAY_SUBSCRIPT macro
...
Add DEFINE prefix, since this macro is defining these operators and
remove the parameter since we will always use it to access a
union/struct as a byte array.
2016-06-23 21:02:05 -03:00
Gustavo Jose de Sousa
5154369e9d
AP_Common: define the ARRAY_SUBSCRIPT macro
2016-06-23 21:02:05 -03:00
Lucas De Marchi
4a18108600
AP_HAL_Linux: rename min, max and avg fields
...
These were probably named otherwise in order not to conflict with
min/max macros from math.h. We don't have this problem anymore.
2016-06-23 19:08:14 -03:00
Lucas De Marchi
b8e3e549c7
AP_HAL_Linux: Perf: add debug method
...
Test code for integration with another thread to pull data from internal
perf counters. Since we are using the timer thread here, there's no
retry mechanism and we only print that data can be corrupted.
2016-06-23 19:08:14 -03:00
Lucas De Marchi
1727418dc9
AP_HAL_Linux: Perf: make lttng use internal fields
...
Instead of creating a new object Perf_Lttng copying the necessaries
fields, just make a tighter integration with the internal perf counters
and re-use the same fields.
2016-06-23 19:06:30 -03:00
Lucas De Marchi
619ce23799
AP_HAL_Linux: Perf: rework integration with other tools
...
The idea is to leave the internal perf enabled all the time, like it is
in PX4, and then allow the integration with lttng on top. Next step
would be to runtime enable/disable only the perf counters we are
interested in.
This also changes the structure so it's easy to allow another thread to
pull data from the Perf object. A rw lock protects from addition of new
counters and an atomic unsigned int allows other threads to do a
lockless copy of the data.
In order for this to work the allocation was changed to use a single
memory pool instead of returning a calloc'ed data for each perf counter.
Since most of our counters are of ' elapsed' type, don't bother using a
smaller struct for the 'count' type
2016-06-23 19:06:30 -03:00
Lucas De Marchi
b687473174
AP_HAL_Linux: ignore unused result on panic
...
There's not much we can do if the write() call inside a panic function
failed. Just ignore the failure.
2016-06-23 18:34:01 -03:00
Lucas De Marchi
8a58c06adb
AP_Common: add macro to ignore unused result
...
In some cases we want to call functions annotated with
warn_unused_result but we know it's safe to ignore the return value.
Prefixing with (void) used to work, but it doesn't do anymore on all
versions of gcc and clang.
See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425
This solution is a mix of the solutions provided in the above bug report
and the one provided by Gustavo Sousa at
https://github.com/ArduPilot/ardupilot/pull/4277#issuecomment-224957375
2016-06-23 18:34:01 -03:00
Francisco Ferreira
ac90527da5
AP_Common: change check from GCC version to glibc version (and Cygwin)
2016-06-23 18:19:54 +10:00
Patrick J.P
eb44d75ed8
AP_HAL: Remove trailing spaces from AP_HAL_Namespace.h
2016-06-22 16:03:30 -03:00
Randy Mackay
a427768087
AC_Avoidance: reduce maximum acceleration to 1m/s/s
...
This makes the vehicle slow very gently as it approaches the edge of the fence
2016-06-22 11:38:15 +09:00
Daniel Ricketts
8a6aa24525
AC_WPNav: use AC_Avoidance to stop at fence during Loiter
2016-06-22 11:38:15 +09:00
Daniel Ricketts
ff7bc7c0cb
AC_Avoidance: add library to stop at circular fence
2016-06-22 11:38:15 +09:00
Daniel Ricketts
e60710332b
AC_Fence: add accessors to return radius and safety margin
2016-06-22 11:38:15 +09:00
Andrew Tridgell
d1b28aaed9
AC_AttitudeControl: fixed factor of 1000 error in init_takeoff
2016-06-22 11:48:43 +10:00
Lucas De Marchi
39d4fa2cf8
Revert changes to cmath according to gcc version
...
Revert these commits:
"AP_Common: gcc 4.9.2 behaves differently from 4.9.3"
"AP_Common: this workaround for missing/cmath is also needed for gcc 4.9.3"
This breaks the build for PX4. The change is related to the libc, not
the compiler version. We have an workaround there based on compiler
version just because it's usual to have a more recent libc version when
you have a recent compiler.
2016-06-21 13:54:41 -03:00
Lucas De Marchi
9738be0ed6
AP_HAL: remove tabs and trailing whitespaces
2016-06-21 13:09:00 -03:00
Lucas De Marchi
ab66e3a69a
AP_HAL_Linux: Perf: simplify function to get current time
2016-06-21 13:09:00 -03:00
Pierre Kancir
a8e5ff93b5
AP_Math: Correct missing declaration warning
2016-06-21 12:17:46 -03:00
Lucas De Marchi
1d9d0a40db
AP_HAL_Linux: GPIO: reduce macro and variable scopes
...
Also change the coding style in a few places.
2016-06-21 12:16:32 -03:00
Lucas De Marchi
4f14b9b7e2
AP_HAL_Linux: ToneAlarm_Raspilot: add fixme comment
2016-06-21 12:16:32 -03:00
Lucas De Marchi
e122b2b651
AP_HAL: GPIO: remove unused functions
...
These functions are not used by any HAL, so remove them.
2016-06-21 12:16:32 -03:00
Lucas De Marchi
0bb86ae498
AP_HAL_Linux: GPIO_RPI: remove unused functions
...
These functions to use pins as pwm are never used in the codebase, so
remove them.
2016-06-21 12:16:32 -03:00
Andrew Tridgell
2108127712
AP_Common: gcc 4.9.2 behaves differently from 4.9.3
...
tested 4.9.3 on cygwin, 4.9.2 on ubuntu
I do hope that it doesn't depend on the OS
2016-06-21 21:34:54 +10:00
Andrew Tridgell
224c714c83
AP_Common: this workaround for missing/cmath is also needed for gcc 4.9.3
...
tested on cygwin with 4.9.3
2016-06-21 19:19:09 +10:00
Peter Barker
309ac53806
SITL: correct adsb initialisation
...
Parameters have not yet been initialised in _sitl_setup, so move
should-run checks into update
2016-06-20 18:16:34 -07:00
Andrew Tridgell
569443231a
SITL: improved altitude data in XPlane
2016-06-20 12:52:13 +10:00
Andrew Tridgell
51fff00871
SITL: report data and frame rates in XPlane
...
and avoid time going backwards if possible
2016-06-20 12:52:13 +10:00
Andrew Tridgell
b7395ee74b
SITL: fixed sign of magnetic inclination
2016-06-20 11:17:36 +10:00
Andrew Tridgell
5b7b799046
SITL: fixed mag field in JSBSim and last_letter
2016-06-20 11:07:51 +10:00
Leonard Hall
ba2382c409
AP_MotorsCoax: Fix servo 3 and 4 feed through sign
2016-06-20 09:45:17 +09:00
Andrew Tridgell
16595d2f3b
SITL: auto-set AHRS_EKF_TYPE to 10 for XPlane and FlightAxis
2016-06-20 08:38:53 +10:00
Tom Pittenger
746e2211e9
AP_ADSB: remove extra include
2016-06-19 11:24:31 -07:00
Tom Pittenger
4fe94bdea3
GCS_MAVLink: add ADSB_streamrate
2016-06-19 11:24:30 -07:00
Tom Pittenger
4cd1721bf9
AP_ADSB: add ADSB_streamrate
2016-06-19 11:24:29 -07:00
Tom Pittenger
3a38e29b39
GCS_MAVLink: do not auto-forward ADSB_VEHICLE packets
2016-06-19 11:24:29 -07:00
Andrew Tridgell
2db2486b3a
AP_AHRS: send zero EKF_STATUS_REPORT with EKF type 10
2016-06-19 22:02:25 +10:00
Andrew Tridgell
2f88c24f49
SITL: added debug showing UDP ports for XPlane
2016-06-19 21:18:19 +10:00
Andrew Tridgell
ec5534bd6a
SITL: explain the throttle_magic code for XPlane
2016-06-19 21:10:49 +10:00
Andrew Tridgell
f76a7e64ca
SITL: auto-select correct data fields from X-Plane10
2016-06-19 20:57:34 +10:00
Andrew Tridgell
acc76f80b0
HAL_SITL: added xplane support
2016-06-19 13:59:15 +10:00
Andrew Tridgell
4f99c17aae
SITL: added X-Plane 10 SITL backend
2016-06-19 13:59:15 +10:00
Andrew Tridgell
7a9b4c7572
AP_Motors: fixed motor load calculation
...
scale to 1.0 for max collective
2016-06-19 13:50:04 +10:00
Paul Riseborough
55b0bbd3f1
SITL: Add simulation of 3D earth magnetic field
...
Use an independant method to the flight code using tables that that can updated.
Data taken from NOAA online calculator using WMM data at 2016-6-16 date
2016-06-19 12:51:34 +10:00
Paul Riseborough
2cf5493b40
AP_HAL_SITL: Ensure simulated magnetic field is always used
2016-06-19 12:51:34 +10:00
Paul Riseborough
078284e2e2
SITL: Add magnetic field environment to simulation
...
Includes parameters enabling a ground level magnetic anomaly to be modelled.
TODO - add automatic setting of declination, inclination and field strength using WGS-84 position.
2016-06-19 12:51:34 +10:00
Randy Mackay
ec7c1ab0b0
AC_PosControl: comment fix to set_alt_max method
...
No functional change
2016-06-18 11:55:49 +09:00
Randy Mackay
e185bab775
AP_MotorsMulticopter: add HOVER_LEARN option to learn but not save
2016-06-18 11:55:49 +09:00
Randy Mackay
23f8227e36
AP_Motors: bug fix to save params on disarm
...
Previously was saving during arming as well as disarming.
Thanks to OXINARF for finding this!
2016-06-18 11:55:49 +09:00
Randy Mackay
a2ffd9ec7d
AP_MotorsMulticopter: fix comment for get_throttle_limit function
2016-06-18 11:55:49 +09:00
Leonard Hall
dcbb071c07
AC_PosControl: Move hover throttle calculation to AP_Motors
2016-06-18 11:55:49 +09:00
Randy Mackay
b27da7699e
AC_AttitudeControlMulti: get_throttle_avg_max made private
...
Also fixed up method's description
2016-06-18 11:55:49 +09:00