Commit Graph

9535 Commits

Author SHA1 Message Date
Lucas De Marchi e0e7b73ceb AP_NavEKF2: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:12 +11:00
Lucas De Marchi ad094b9073 AP_Mount: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:12 +11:00
Lucas De Marchi 3941bb7347 AP_Mission: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:12 +11:00
Lucas De Marchi c7871d1bca AP_Math: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:12 +11:00
Lucas De Marchi 266bb3b759 AP_L1_Control: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:12 +11:00
Lucas De Marchi 3142f21363 AP_InertialSensor: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:12 +11:00
Lucas De Marchi cf8203c08b AP_HAL_SITL: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:12 +11:00
Lucas De Marchi 8e65e88d06 AP_HAL: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:11 +11:00
Lucas De Marchi 973c3c6bc6 AP_HAL_FLYMAPLE: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:11 +11:00
Lucas De Marchi 24e5deb906 AP_GPS: remove comments about AVR boards 2015-11-04 12:14:11 +11:00
Lucas De Marchi eb75d73952 AP_Compass: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:11 +11:00
Lucas De Marchi b734777b95 AP_Common: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:11 +11:00
Lucas De Marchi 1c8f6c2ee5 AP_Camera: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:11 +11:00
Lucas De Marchi 12c88570d7 AP_BattMonitor: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:11 +11:00
Lucas De Marchi 4bd8b2ae35 AP_Baro: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:11 +11:00
Lucas De Marchi 221d822573 AP_Airspeed: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:11 +11:00
Lucas De Marchi 124937ab61 AP_AHRS: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:11 +11:00
Lucas De Marchi 4ae35c9a74 AP_ADC: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:11 +11:00
Lucas De Marchi c495bdb299 Remove AP_HAL_AVR
Replace everything under AP_HAL_AVR with a README.md file pointing to
the correct branch for AVR support.
2015-11-04 12:14:11 +11:00
Gustavo Jose de Sousa 8e351a058d AP_InertialSensor: MPU6000: enable data-ready pin for minlure
Data-ready pin wasn't being used before due to a bug in the Kernel with
concurrent accesses to GPIO in Intel Baytrail platforms. That has been fixed in
Kernel version 4.2.
2015-11-04 12:12:47 +11:00
Lucas De Marchi 3d1d6286e9 AP_InertialSensor: fix example build after PSTR removal 2015-11-04 12:11:59 +11:00
Andrew Tridgell a5a1680fb3 HAL_SITL: added support for real UART devices
This allows use of real UART devices in the simulator. Useful for GPS
driver work or other MAVLink peripherals
2015-11-04 11:29:04 +11:00
Lucas De Marchi 6984168a45 AP_HAL_Linux: don't log on failed semaphore
With commit 24f4153 ("AP_HAL_Linux: RCOutput_PCA9685: group writes") a
log was introduced when we can't get the bus semaphore. However since we
are calling the non blocking method, failing there is not that unlikely
if the bus is shared. Return back to the previous behavior of not
logging.
2015-11-03 11:08:00 +11:00
Paul Riseborough 9b37c29efa AP_NavEKF: Improve mag earth state reset accuracy
This removes errors in the in-flight reset of the earth field states by:

1) Using a state vector and magnetometer measurement from the same time coordinate
2) Not using the AHRS trim offsets in the calculation
2015-11-02 17:47:01 +09:00
Paul Riseborough 0dd5a7c4fa AP_NavEKF: Use correct blended delta time for all vel and pos integration
dtIMUactual has been spit into a separate dtDelAng and dtDelVel and dtDelVel1 and dtDelVel2 delta time in recognition of the amount of timing jitter and different update rates for the IMU's
2015-11-02 17:47:00 +09:00
Paul Riseborough 42214ec303 AP_NavEKF: Fix failure to start mag cal due to gyro noise
Vibration in the 400Hz delta angles could cause the angular rate condition check for in-flight magnetic field alignment to fail.
The symptons were failure to start magnetic field learning as expected when EK2_MAG_CAL=3 was set.
The calculation of a delta rotation between consecutive magnetometer samples has been introduced instead of the most recent IMU delta angle as this is less affected by noise and give an upper bound on the angular error.
the check has been moved into the magnetometer fusion control function so that any reset will be performed using fresh magnetometer data
2015-11-02 17:46:59 +09:00
Paul Riseborough 707089178f AP_NavEKF: Update default parameter values:
Explicitly set Plane parameters rather than rely on use of the default
If no type defined, default to Copter parameters (most common platform type
Enable different platform types to use different initial accel bias uncertainty
Reduce initial accel bias uncertainty for copter to prevent initial oscillation in bias and height estimate
2015-11-02 17:46:58 +09:00
Paul Riseborough 3d8f720aaf AP_NavEKF: Improve initial accel bias learning
Fuse synthetic velocity data at zero before arming to improve stability margins for initial bias offset learning.
2015-11-02 17:46:57 +09:00
Paul Riseborough 64ad7d6a50 AP_NavEKF: handle case where one IMU fails to return a delta velocity or angle 2015-11-02 17:46:56 +09:00
Paul Riseborough 69d4bd2481 AP_NavEKF: Protect against baro data errors in constant position mode
Large baro data errors when flying without GPS could cause total failure of the EKF.
This patch provides protection against this happening in-flight but allows for large innovations during preflight alignment.
2015-11-02 17:46:55 +09:00
Paul Riseborough 778b1c3e18 AP_NavEKF: Remove dead code for constant velocity mode 2015-11-02 17:46:54 +09:00
Paul Riseborough fb8e01a73c AP_NavEKF: Do not automatically accept DCM alignment data after 30 seconds
A looser check is applied at 30 seconds rather than no check.
2015-11-02 17:46:53 +09:00
Paul Riseborough be11e12f81 AP_NavEKF: Improve height reset during climbs and descents
Resets the vertical velocity to the GPS when the height is reset is the GPS is healthy
2015-11-02 17:46:53 +09:00
Paul Riseborough 59df23bc0f AP_NavEKF: Reduce EKF health pre-arm check false positives 2015-11-02 17:46:52 +09:00
Paul Riseborough aa14de9d39 AP_NavEKF2: Fix failure to start mag cal due to gyro noise
Vibration in the 400Hz delta angles could cause the angular rate condition check for in-flight magnetic field alignment to fail.
The symptons were failure to start magnetic field learning as expected when EK2_MAG_CAL=3 was set.
2015-11-02 14:12:17 +11:00
Paul Riseborough 2ebce110b7 AP_NavEKF2: Explicitly define plane build type for default parameters
Use Copter parameters if build type is unknown
2015-11-02 14:12:17 +11:00
Paul Riseborough 7ed36d8e65 AP_AHRS: Enable pre-flight GPS check status reporting for EKF2 2015-11-02 14:12:17 +11:00
Paul Riseborough b6d63d4b4e AP_NavEKF2: Fix reporting of pre-flight GPS checks
Re-order checks so that that less important messages are not hidden when the 40 character buffer overflows
Add required output methods
2015-11-02 14:12:16 +11:00
Paul Riseborough 7bd61a484c AP_NavEKF2: Faster initial accel bias learning 2015-11-02 14:12:16 +11:00
Paul Riseborough b15bf3243e AP_NavEKF2: Remove potential for division by zero 2015-10-30 15:34:26 +09:00
Paul Riseborough 5533a9a149 AP_NavEKF2: Add improved health monitoring when using simple compass yaw fusion 2015-10-30 15:34:23 +09:00
Paul Riseborough f539b597a3 AP_NavEKF2: Improve initialisation of magnetic field learning
Use the more robust, but less accurate compass heading fusion up to 5m altitude
Wait for the magnetometer data fusion time offset to be correct before using data to reset states
Don't reset magnetic field states if the vehicle is rotating rapidly as timing offsets will produce large errors
When doing the yaw angle reset, apply the reset increment to all quaternions stored in the output buffer to avoid transients produced by yaw rotations and the 0.25 second fusion time horizon offset.
Only do the one yaw and mag reset at 5m, not two at 1.5 and 5.0m
Always re-do the yaw and mag reset when leaving the ground.
2015-10-30 15:34:20 +09:00
Paul Riseborough 844ed95718 AP_NavEKF2: Add method to rotate output quaternion history 2015-10-30 15:34:17 +09:00
Paul Riseborough a1e32d71ec AP_NavEKF: Prevent large rotation rates corrupting the in-flight mag reset 2015-10-30 15:34:14 +09:00
Lucas De Marchi 1ce03c53a6 AP_Curve: remove wrong comment about PSTR
Not being able to leave the instantiation in ther header is not because
of PSTR issues, but basically because the instantiation needs to be in a
compilation unit, not in the header itself.
2015-10-30 14:35:49 +09:00
Lucas De Marchi 9203e2b929 AP_Common: remove PSTR definition 2015-10-30 14:35:48 +09:00
Lucas De Marchi 92016e9229 AP_Progmem: remove dead code
The only thing from AP_Progmem that's still used are the pgm_read_*
function and there's no support for AVR anymore. So remove the dead code
and use a single header to contain that inline functions.
2015-10-30 14:35:47 +09:00
Lucas De Marchi 68bef1ec64 AP_Param: fix wrong printf format for printf
"%S" is used for wide string, but we are passing a char*. Use lowercase
in this case to remove warnings like this:

libraries/AP_InertialSensor/AP_InertialSensor.cpp: In member function
'bool AP_InertialSensor::calibrate_accel(AP_InertialSensor_UserInteract*, float&, float&)':
libraries/AP_InertialSensor/AP_InertialSensor.cpp:620:61: warning:
format '%S' expects argument of type 'wchar_t*', but argument 3 has type 'const char*' [-Wformat=]
                 "Place vehicle %S and press any key.\n", msg);
                                                             ^
2015-10-30 14:35:45 +09:00
Lucas De Marchi d2a259cef0 DataFlash: fix wrong printf format for printf
"%S" is used for wide string, but we are passing a char*. Use lowercase
in this case to remove warnings like this:

libraries/AP_InertialSensor/AP_InertialSensor.cpp: In member function
'bool AP_InertialSensor::calibrate_accel(AP_InertialSensor_UserInteract*, float&, float&)':
libraries/AP_InertialSensor/AP_InertialSensor.cpp:620:61: warning:
format '%S' expects argument of type 'wchar_t*', but argument 3 has type 'const char*' [-Wformat=]
                 "Place vehicle %S and press any key.\n", msg);
                                                             ^
2015-10-30 14:35:42 +09:00
Lucas De Marchi bdd1d5e9d4 AP_Menu: fix wrong printf format for printf
"%S" is used for wide string, but we are passing a char*. Use lowercase
in this case to remove warnings like this:

libraries/AP_InertialSensor/AP_InertialSensor.cpp: In member function
'bool AP_InertialSensor::calibrate_accel(AP_InertialSensor_UserInteract*, float&, float&)':
libraries/AP_InertialSensor/AP_InertialSensor.cpp:620:61: warning:
format '%S' expects argument of type 'wchar_t*', but argument 3 has type 'const char*' [-Wformat=]
                 "Place vehicle %S and press any key.\n", msg);
                                                             ^
2015-10-30 14:35:41 +09:00
Lucas De Marchi 62ba8266ef AP_InertialSensor: fix wrong printf format for printf
"%S" is used for wide string, but we are passing a char*. Use lowercase
in this case to remove warnings like this:

libraries/AP_InertialSensor/AP_InertialSensor.cpp: In member function
'bool AP_InertialSensor::calibrate_accel(AP_InertialSensor_UserInteract*, float&, float&)':
libraries/AP_InertialSensor/AP_InertialSensor.cpp:620:61: warning:
format '%S' expects argument of type 'wchar_t*', but argument 3 has type 'const char*' [-Wformat=]
                 "Place vehicle %S and press any key.\n", msg);
                                                             ^
2015-10-30 14:35:40 +09:00
Lucas De Marchi 5244559010 Minimize AP_Progmem.h includes
Most of AP_Progmem is already gone so we can stop including it in most
of the places. The only places that need it are the ones using
pgm_read_*() APIs.

In some cases the header needed to be added in the .cpp since it was
removed from the .h to reduce scope. In those cases the headers were
also reordered.
2015-10-30 14:35:32 +09:00
Lucas De Marchi a65c98485c AP_HAL: UARTDriver: remove _P() variants
They aren't used anymore so remove.
2015-10-30 14:35:31 +09:00
Lucas De Marchi 1b07dabeb7 Replace prog_char and prog_char_t with char
prog_char and prog_char_t are now the same as char on supported
platforms. So, just change all places that use them and prefer char
instead.

AVR-specific places were not changed.
2015-10-30 14:35:30 +09:00
Lucas De Marchi b52d1cfabb DataFlash: remove DataFlash.Log_Write_Message_P() 2015-10-30 14:35:29 +09:00
Lucas De Marchi 4ab9821624 Replace use of Log_Write_Message_P() with Log_Write_Message() 2015-10-30 14:35:28 +09:00
Lucas De Marchi 132303db4b AP_InertialSensor: use printf() rather than _printf_P() 2015-10-30 14:35:27 +09:00
Lucas De Marchi 2556fc8dbe BetterStream: use common macro for printf formatting
Since this needs an additional header, also put them in correct order.
2015-10-30 14:35:26 +09:00
Lucas De Marchi 20c6ffc5e3 Replace use of UARTDriver::printf_P() with UARTDriver::printf()
This also starts to show warnings on places that were already using
wrong printf format strings.
2015-10-30 14:35:25 +09:00
Lucas De Marchi 7ceffb1e2b Replace use of vprintf_P() with vprintf() 2015-10-30 14:35:23 +09:00
Lucas De Marchi 6f4904189b Replace use of println_P() with println() 2015-10-30 14:35:22 +09:00
Lucas De Marchi a964ac38ec Replace use of print_P() with print() 2015-10-30 14:35:21 +09:00
Lucas De Marchi 65e719ccc3 AP_Param: replace find_P() with find() 2015-10-30 14:35:19 +09:00
Lucas De Marchi af88ebf477 GCS_MAVLink: remove send_text_P() in favor of send_text() 2015-10-30 14:35:18 +09:00
Lucas De Marchi 831d8acca5 Remove use of PROGMEM
Now variables don't have to be declared with PROGMEM anymore, so remove
them. This was automated with:

    git grep -l -z PROGMEM | xargs -0 sed -i 's/ PROGMEM / /g'
    git grep -l -z PROGMEM | xargs -0 sed -i 's/PROGMEM//g'

The 2 commands were done so we don't leave behind spurious spaces.

AVR-specific places were not changed.
2015-10-30 14:35:16 +09:00
Lucas De Marchi d595e41003 Replace use of strncmp_P() with strncmp() 2015-10-30 14:35:14 +09:00
Lucas De Marchi 0aa117f65d Replace use of strnlen_P() with strnlen() 2015-10-30 14:35:13 +09:00
Lucas De Marchi 1336d621be Replace use of strcpy_P() with strcpy() 2015-10-30 14:35:12 +09:00
Lucas De Marchi e4b313d2ca Replace use of memcpy_P() with memcpy() 2015-10-30 14:35:11 +09:00
Lucas De Marchi f8f3f5a024 Replace use of strlen_P() with strlen() 2015-10-30 14:35:10 +09:00
Lucas De Marchi aa370fe758 Replace use of strcmp_P() with strcmp() 2015-10-30 14:35:09 +09:00
Lucas De Marchi 6f0db45b57 Replace use of strcasecmp_P() with strcasecmp() 2015-10-30 14:35:08 +09:00
Lucas De Marchi a8455aa4e3 AP_HAL: Remove Util::{v,}snprintf_P() 2015-10-30 14:35:06 +09:00
Lucas De Marchi 84d5fb006f Remove use of Util::{v,}snprintf_P()
These are now the same function as Util::snprintf().
2015-10-30 14:35:05 +09:00
Lucas De Marchi 2c38e31c93 Remove use of PSTR
The PSTR is already define as a NOP for all supported platforms. It's
only needed for AVR so here we remove all the uses throughout the
codebase.

This was automated with a simple python script so it also converts
places which spans to multiple lines, removing the matching parentheses.

AVR-specific places were not changed.
2015-10-30 14:35:04 +09:00
Randy Mackay 4d458833dc AP_NavEKF2: remove unnecessary PV_AidingMode check
Thanks to OXINARF for catching this
2015-10-30 12:52:49 +09:00
Paul Riseborough b459d937ad AP_NavEKF2: Clean up GPS fusion timeout logic and comments 2015-10-30 12:24:19 +09:00
Paul Riseborough 61d556afb1 DataFlash: Fix shorthand variable names for EKF position reset delta 2015-10-30 12:24:18 +09:00
Randy Mackay adee13d729 AC_WPNav: handle ekf position reset in Loiter and Brake 2015-10-30 12:24:17 +09:00
Randy Mackay 94adaba305 AP_NavEKF2: constify getLastPosNorthEastReset
Also constify getLastVelNorthEastReset
2015-10-30 12:24:16 +09:00
Randy Mackay 3f29365cae AP_NavEKF: constify getLastPosNorthEastReset 2015-10-30 12:24:15 +09:00
Randy Mackay 4e959ef6f9 AP_AHRS: constify getLastPosNorthEastReset
Also constify getLastVelNortEastReset
2015-10-30 12:24:13 +09:00
Randy Mackay 52ed075405 AP_NavEKF2: constify getLastYawResetAngle 2015-10-30 12:24:12 +09:00
Randy Mackay 758c5a7d7f AP_NavEKF: constify getLastYawResetAngle 2015-10-30 12:24:11 +09:00
Randy Mackay 7c20577ee0 AP_AHRS: constify getLastYawResetAngle 2015-10-30 12:24:10 +09:00
Randy Mackay 040ec481f4 AC_WPNav: loiter uses pos_control.shift_pos_xy_target 2015-10-30 12:24:09 +09:00
Randy Mackay 550ba478c9 AC_PosControl: add shift_pos_xy_target 2015-10-30 12:24:08 +09:00
Randy Mackay 16a0281c92 AC_PosControl: remove unused set_vel_target 2015-10-30 12:24:07 +09:00
Paul Riseborough 0b1a6a2157 AP_NavEKF2: Clean up GPS timeout logic 2015-10-30 12:24:06 +09:00
Paul Riseborough f67f6b01f4 AP_AHRS: Publish the EKF position and velocity reset deltas 2015-10-30 12:24:05 +09:00
Paul Riseborough 74da4d8e57 AP_NavEKF2: Remove GPS glitch offset logic
Correction for steps in position and velocity caused by resets following GPS glitches and other events are now handled by the control loops.
2015-10-30 12:24:04 +09:00
Paul Riseborough 4fdec67546 AP_NavEKF2: Publish the position and velocity state reset deltas
Used by the control loops to compensate for step changes in position and velocity when the EKF needs to do a reset of these states.
2015-10-30 12:24:02 +09:00
Paul Riseborough 7c40448bab AP_NavEKF: Remove GPS glitch offset logic
The correction for offsets due to position and velocity resets will now be handled in the control loops.
2015-10-30 12:24:01 +09:00
Paul Riseborough 5489ff9118 AP_NavEKF: publish position and velocity state reset data
Used by the control loops to compensate for steps in velocity and/or position resulting from state resets.
2015-10-30 12:24:00 +09:00
Tom Pittenger 0d36c4c07b GCS_MAVLink: version update after generate 2015-10-30 11:16:30 +09:00
Tom Pittenger bf9d4b5898 GCS_MAVLink: generate adds abort Alt label in MAV_CMD_NAV_LAND
code is already implemented and released
2015-10-30 11:15:50 +09:00
Randy Mackay c52f16b86f AC_WPNav: increase param description max for LOIT_JERK 2015-10-29 12:16:30 +09:00
Randy Mackay 49c4a133d7 AC_WPNav: set jerk separately for wpnav and loiter 2015-10-29 12:10:47 +09:00
Randy Mackay ee0abb1750 AC_PosControl: add set_jerk_xy 2015-10-29 12:10:44 +09:00
Jonathan Challinger 853f8bfaf4 AC_WPNav: stop gradually in loiter 2015-10-28 20:21:55 +09:00