Commit Graph

9846 Commits

Author SHA1 Message Date
Caio Marcelo de Oliveira Filho a348424551 AP_HAL: remove unused function
This was used by APM1/2 that were removed.
2015-11-18 11:50:56 +09:00
Andrew Tridgell 5561efde2b AP_NavEKF: we can assume get_sample_rate() returns a non-zero number
this fixes a build error with the previous patch
2015-11-18 11:48:50 +11:00
Paul Riseborough e32e6cfa67 AP_NavEKF: Protect against bad delta time from the INS library
Prevent arithmetic divide by zero exceptions and handle invalid delta time in a consistent way by setting invalid times to the average.
2015-11-18 11:43:40 +11:00
Paul Riseborough 2fb5a4489b AP_NavEKF2: Prevent airspeed faults from causing excessive loss of accuracy 2015-11-18 11:39:54 +11:00
Paul Riseborough fc6978e4d9 AP_NavEKF2: Fix error in parameter documentations 2015-11-18 11:39:54 +11:00
Paul Riseborough f9cadaf15c AP_NavEKF2: Increase resolution of innovation consistency gate parameters
Also adds protection against setting the gate to a number that would casue numerical errors.
2015-11-18 11:39:53 +11:00
Andrew Tridgell 08ef00b431 AP_NavEKF2: fixed build with IMU_BUFFER_LENGTH change 2015-11-18 11:33:51 +11:00
Paul Riseborough af3507ef3c AP_NavEKF2: Stop bad INS velocity spoiling height reset
We should reset the velocity as well as the height if a reasonable reset value is available.
2015-11-18 11:18:50 +11:00
Paul Riseborough 97799ef0b3 AP_NavEKF2: Ensure that GPS origin is set before using data for height 2015-11-18 11:18:50 +11:00
Paul Riseborough b8427e5d95 AP_NavEKF2: Only allow rangefinder height option during optical flow nav 2015-11-18 11:18:50 +11:00
Paul Riseborough c9eea98142 AP_NavEKF2: Improve terrain height estimation
The ad-hoc scaling of error growth has been replaced with a consistent method that uses the main nav filters published vertical velocity uncertainty and the terrain gradient assumption.
2015-11-18 11:18:46 +11:00
Paul Riseborough d820a538d5 AP_NavEKF2: Make magnetometer data available status global
This assists with debugging and makes it consistent with other measurements that are buffered
2015-11-18 11:18:46 +11:00
Paul Riseborough 04228e0b3b AP_NavEKF2: Rework selection of height measurements for fusion
GPS height has been added as a measurement option along with range finder and baro
Selection of the height measurement source has been moved into a separate function
Each height source is assigned its own measurement noise
If GPS or baro alt is not able to be used, it reverts to baro
When baro is not being used, an offset is continually calculated which enables a switch to baro without a height step.
2015-11-18 11:18:42 +11:00
Paul Riseborough 80bc64ee7a AP_NavEKF2: Update parameter documentation with GPS height source option 2015-11-18 11:18:18 +11:00
Paul Riseborough 4c72a14e22 AP_NavEKF2: Add function to LPF and spike filter baro data 2015-11-18 11:18:17 +11:00
Paul Riseborough 34311bedfa AP_NavEKF2: Add data buffers for range finder data 2015-11-18 11:18:17 +11:00
Andrew Tridgell 99da195e37 AP_NavEKF2: make IMU buffer length depend on main loop rate
this fixes a problem with Replay and baro data
2015-11-18 10:20:39 +11:00
Andrew Tridgell f36b2e415a AP_InertialSensor: fixed flymaple build 2015-11-17 08:52:49 +11:00
Andrew Tridgell 32ed0d58f3 AP_InertialSensor: fixed filter setup on 2nd accel/gyro 2015-11-16 17:57:36 +11:00
Andrew Tridgell e1cb9beeef SITL: expose update rate to HAL_SITL
and fixed dataflash reference loop
2015-11-16 17:57:36 +11:00
Andrew Tridgell 95ca0b39a8 HAL_SITL: moved virtual INS sensor to AP_InertialSensor_SITL 2015-11-16 17:57:35 +11:00
Andrew Tridgell 4a768d47f3 AP_InertialSensor: created a SITL specific backend 2015-11-16 17:57:35 +11:00
Andrew Tridgell 2675edcb96 HAL_SITL: removed unused variables 2015-11-16 17:57:35 +11:00
Andrew Tridgell ccd915eb67 AP_InertialSensor: moved raw gyro and accel logging to common code
this brings raw logging to non-PX4 ports
2015-11-16 17:57:35 +11:00
Andrew Tridgell 75ea8f3dc0 AP_InertialSensor: removed "have sample" logic from drivers
the frontend has all the information it needs, so we can simplify the
drivers some more
2015-11-16 17:57:35 +11:00
Andrew Tridgell 0e4bab74ba AP_InertialSensor: simplify sensor backends
use common code for filtering and update, allowing each sensor driver
to be simpler and more consistent
2015-11-16 17:57:35 +11:00
Randy Mackay 36c0beb918 GPS_UBlox: reorder init to resolve compiler warning
Also removed duplicate init of noReceivedHdop
2015-11-16 15:09:17 +09:00
Paul Riseborough 9b82b2200c AP_NavEKF2: Fix plane in-flight yaw reset
The copter method was being used for plane and the plane method was not being run due to the change in flight status not being detected.
The plane reset method did not trigger if the EKF had already dragged the velocity states along with the GPS or could align to an incorrect heading.
The method has been reworked so that it resets to the GPS course, but only if there are inconsistent angles and large innovations.
To stop a failed magnetometer causing a loss of yaw reference later in flight, if all available sensors have been tried in flight and timed out, then no further magnetoemter data will be used
2015-11-16 09:05:42 +11:00
Paul Riseborough e8706db382 AP_NavEKF2: Update IMU tuning parameter limits 2015-11-16 09:05:42 +11:00
Paul Riseborough 0562529729 AP_NavEKF2: Tuning changes to make attitude less sensitive to GPS and compass errors 2015-11-16 09:05:42 +11:00
Andrew Tridgell 3549c717db Filter: removed reference to old 'Desktop' build 2015-11-16 08:06:05 +11:00
Andrew Tridgell 8f4ce7f20b build: removed all nocore.inoflag files
these were APM2 specific
2015-11-16 08:05:17 +11:00
Andrew Tridgell 1ffe899a18 PID: fixed example build 2015-11-16 08:04:44 +11:00
Andrew Tridgell 9ea99cba29 HAL_Linux: fixed example build 2015-11-16 08:04:35 +11:00
Andrew Tridgell c81d4fa07b AP_Declination: fixed example build 2015-11-16 07:59:18 +11:00
Andrew Tridgell a9372ad5d7 Filter: fixed example builds 2015-11-16 07:58:55 +11:00
Andrew Tridgell 6cf5e582b9 AP_Common: fixed examples build 2015-11-16 07:58:13 +11:00
Michael Oborne 2f49fa1531 AP_GPS_GSOF: add second comport to base config 2015-11-15 14:56:49 +08:00
Andrew Tridgell 1a033f3b73 HAL_Linux: don't flood the link with errors on uninitialised perf counter
that could bring down the vehicle
2015-11-14 14:44:29 +11:00
Julien BERAUD 2f610a400a AP_HAL_Linux: fix perf
Fix warning (warning: declaration of 'perf_count' shadows a member of 'this')
and check that perf is not NULL before indirection
2015-11-14 14:44:29 +11:00
Julien BERAUD 259f5f07e8 AP_NavEKF_core: fix init of perf
_perf_FuseOptFlow  was used and not allocated
2015-11-14 14:44:29 +11:00
Julien BERAUD f8f2833c88 AP_HAL_Linux: use I2C_SLAVE_FORCE in case of error
When there is already a driver registered on an i2c bus, the I2C_SLAVE ioctl
returns an error.
When it happens, it is better to display a warning and try to force the address.
It is especially useful on the bebop when killing the regular autopilot that uses
iio drivers to access the imu because else we would need to manually unbind the
driver in an init procedure.

I have added a warning because this error can also be resulting of another cause.
If the error is not EBUSY, then panic

If the I2C_SLAVE_FORCE ioctl fails then we panic because one of the i2c devices
won't be working properly.
2015-11-13 21:20:13 +11:00
Andrew Tridgell cefb32566f GCS_MAVLink: fixed corner case in MAVLink routing
when a GCS sends a command to a system ID that isn't our system ID,
the GCS may use a non-advertised component ID such as
MAV_COMP_ID_SYSTEM_CONTROL. Those packets should be fowarded to the
target system even though the target system has not specifically
advertised that target sysid/compid tuple.
2015-11-13 13:38:53 +11:00
José Roberto de Souza 5ff67a41a1 AP_HAL_Linux: Implement perf API
Initial implementation of perf API on Linux, for now just saving
perf data, in a further patch this data will be exported.
2015-11-13 12:16:19 +11:00
mirkix f00d4f0b3e AP_HAL_Linux: Improve loading firmware 2015-11-12 21:25:17 +01:00
Robert Lefebvre 4f7246c432 SITL: Helicopter parameter updates 2015-11-12 19:37:38 +09:00
Robert Lefebvre b89b0d7f9e AP_MotorsHeli_Single: Move Servo_Test static variables to be class members 2015-11-12 19:37:37 +09:00
Robert Lefebvre 1bc13fb9c0 AC_AttitudeControl_Heli: Add Hover Roll Trim Scalar 2015-11-12 19:37:35 +09:00
Robert Lefebvre bb7f8c1999 AP_MotorsHeli: Create Servo Test functionality 2015-11-12 19:37:34 +09:00
Robert Lefebvre eeb544d098 AP_MotorsHeli: Create SV_MAN=5=Oscillate servo setup mode. 2015-11-12 19:37:33 +09:00
Robert Lefebvre 4443ca9602 AP_MotorsHeli: Yaw servo to move when using SV_MAN param for setup. 2015-11-12 19:37:32 +09:00
Robert Lefebvre c2dff8749e AP_MotorsHeli: Change SV_MAN=2=Center to output _col_mid_pwm instead of 0 collective 2015-11-12 19:37:31 +09:00
Fredrik Hedberg 212eb85ff2 AP_MotorsHeli: Add min and max collective to manual servo modes 2015-11-12 19:37:30 +09:00
Robert Lefebvre 22729e6927 AP_MotorsHeli: Change servo manual #defines into enum 2015-11-12 19:37:29 +09:00
Robert Lefebvre 750728fa1e AP_MotorsHeli_Single: Add motor enable aux output functionality 2015-11-12 19:37:28 +09:00
Robert Lefebvre 58e918341d RC_Channel: Add motor_run_enable aux function 2015-11-12 19:37:27 +09:00
Robert Lefebvre 0b33ef3862 AC_AttitudeControl: Add Hover Roll Trim functionality for helicopters. 2015-11-12 19:37:26 +09:00
Fredrik Hedberg 5fd7fe3e53 AP_Motors: Add manual servo override to center swash-plate for set-up in AP_MotorsHeli. 2015-11-12 19:37:25 +09:00
Jolyon Saunders ca28a49fa6 AP_Motors: Circular swash-plate limits for AP_MotorsHeli 2015-11-12 19:37:24 +09:00
Robert Lefebvre afcc304cbf AC_InputManager: Initial class creation 2015-11-12 19:37:21 +09:00
Robert Lefebvre c66af9b788 AC_HELI_PID: Add Leak-Min param and functionality. 2015-11-12 19:37:20 +09:00
Robert Lefebvre 62864c9e2b AC_AttitudeControl_Heli: Remove commented out Cyclic Cross-Coupling code. Will resurrect in future. 2015-11-12 19:37:19 +09:00
Robert Lefebvre b8ce23970d AC_AttitudeControl_Heli: Implement Pirouette Compensation 2015-11-12 19:37:18 +09:00
Robert Lefebvre f39ac7c900 AC_AttitudeControl_Heli: Add initialization of _flags_heli members 2015-11-12 19:37:17 +09:00
Paul Riseborough 6522fb2621 AP_NavEKF2: Allow user to relax pre-flight GPS checks 2015-11-12 20:39:15 +11:00
Randy Mackay d13b4c2dc3 AC_PrecLand: init members to resolve compile warning 2015-11-12 14:43:38 +09:00
Randy Mackay 175f5654c1 AC_PrecLand: fix backend compile error 2015-11-12 14:42:44 +09:00
Peter Barker fc05ad81eb DataFlash_File: cache oldest log to avoid directory scans when downloading 2015-11-12 12:23:46 +11:00
Paul Riseborough 0b653bb82b AP_NavEKF2: Update MAVLnk parameter documentation 2015-11-11 15:16:36 +11:00
José Roberto de Souza 17e105640e AP_InertialSensor: Add HAL_COMPASS_AK8963_MPU9250_I2C to _detect_backends() 2015-11-11 14:29:07 +11:00
José Roberto de Souza 6ece4d60aa AP_HAL: HAL_COMPASS_AK8963_MPU9250_I2C to the supported list 2015-11-11 14:29:07 +11:00
José Roberto de Souza bdc36349b4 AP_Compass: AK8963: Add support to use a AK8963 behind of a MPU9250 over I2C
To be able to use AK8963 connected to the auxiliary I2C bus of a
MPU9250 we need first initialize it.
2015-11-11 14:29:07 +11:00
José Roberto de Souza d1ff4286c2 AP_InertialSensor: Make detect_backends() public
This method will be used to initialize and configure I2C backends that
have an auxiliary I2C bus that can be connected to the main I2C bus,
like MPU6000 and MPU9250.
2015-11-11 14:29:07 +11:00
José Roberto de Souza 0cbe99a862 AP_InertialSensor: MPU9250 I2C: Connect the auxiliary I2C bus to the main bus
Using MPU9250 over I2C we can connect the auxiliary bus where there is
a AK8963 and connect this bus to the main one, this way we don't need
any AuxiliaryBus infrastructure as we need with SPI and we can talk
with AK8963 as we would talk with a standalone AK8963.
2015-11-11 14:29:07 +11:00
José Roberto de Souza b3322ed1ae AP_InertialSensor: Add MPU9250 over I2C to detect_backends() 2015-11-11 14:29:07 +11:00
José Roberto de Souza b3f030f650 AP_HAL: Add MPU9250 over I2C 2015-11-11 14:29:07 +11:00
José Roberto de Souza 607ab5b005 AP_InertialSensor: MPU9250: Add I2C support 2015-11-11 14:29:07 +11:00
José Roberto de Souza c3dae6fcec AP_InertialSensor: MPU9250: Remove methods not used anymore
Those methods were used by AK8963 before it started to use auxiliary bus.
2015-11-11 14:29:06 +11:00
José Roberto de Souza 1fc29a2654 AP_Compass: AK8963: Use MPU9250 auxiliary bus 2015-11-11 14:29:06 +11:00
José Roberto de Souza 588df53429 AP_InertialSensor: Add support to get auxiliary bus of multiple instances of the same sensor 2015-11-11 14:29:06 +11:00
José Roberto de Souza 3e1b974fd2 AP_InertialSensor: MPU9250: Export auxiliary bus 2015-11-11 14:29:06 +11:00
José Roberto de Souza 206f0fb773 AP_InertialSensor: MPU9250: Add BusDriver abstraction
This adds a similar abstraction to the one in MPU60XX so it's possible to use
MPU9250 in other bus. The I2C implementation will come later.
2015-11-11 14:29:06 +11:00
Lucas De Marchi 977f6aaf15 AP_Baro: MS5611: remove empty statement 2015-11-11 13:48:48 +11:00
Lucas De Marchi 94d01934f7 AP_Baro: MS5611: reduce OSR to 1024
This is the same change as done in PX4:

	This reduces self-heating of the sensor which reduces the amount
	of altitude change when warming up. Apparently some individual
	sensors are severely affected by this.

	Unfortunately it raises the noise level, but Paul is confident
	it won't be a significant issue.
2015-11-11 13:48:48 +11:00
Andrew Tridgell ea5cd99651 RC_Channel: use is_bounded_int32() 2015-11-11 13:45:09 +11:00
Andrew Tridgell 090c02e6bd AP_Common: rename is_bounded() to is_bounded_int32() and make inclusive
we will probably want float versions in future, and inclusive is
better for the RC_Channel case
2015-11-11 13:45:05 +11:00
Grant Morphett ba8dbf6696 AP_Common: Added a new is_bounded global function. 2015-11-11 13:39:39 +11:00
Grant Morphett 7edf8c0e0a RC_Channel: New method to detect if channel is in trim location
This is a new method which will return true if an RC_Channel has a PWM
value that is at its TRIM value plus or minus the allowed dead zone
around the TRIM.
2015-11-11 13:39:38 +11:00
Lucas De Marchi 1d51e60571 AP_HAL_Linux: move Util instantiation
The util object may be used by all other objects so we need to
instantiate it as earlier as possible.
2015-11-11 08:02:41 +11:00
Paul Riseborough ca31ced2b4 AP_NavEKF2: Fix bug preventing use of optical flow with multiple IMU's 2015-11-10 18:17:16 +11:00
José Roberto de Souza 01766e7069 AP_HAL_Linux: RCOutput: Add LinuxRCOutput_Sysfs
This RCOutput works over Linux PWM sysfs interface.
2015-11-10 17:05:34 +11:00
Lucas De Marchi 392879112e AP_HAL_Linux: document functions to write file
Document function and add attributes to mark then as printf- and
scanf-like functions.
2015-11-10 17:05:34 +11:00
Lucas De Marchi 821814007e AP_Common: add scanf format macro
Add a macro to annotate functions that act like scanf.  Calling the
printf format macro as FORMAT was bad as can be seen now. Later we need
to rename it to FMT_PRINTF.
2015-11-10 17:05:34 +11:00
Lucas De Marchi c66c61180a AP_HAL_Linux: rework PWM_Sysfs
This include some minor changes on all methods of PWM_Sysfs:

  - Sort headers
  - Add code inside Linux namespace rather than just use the namespace
  - Declare a union pwm_params, that's only used to calculate at compile
    time the maximum stack space we need in our methods: this is a bit
    safer for future extensions
  - Standardize error messages to include the useful params first and
    then the error message
  - Remove log message from hot path
  - Don't abuse macros for checking error - convert the SNPRINTF_CHECK
    macro into proper code, ignoring errors for not enough space since
    they can't happen
  - Fix call to read_file() passing uint8_t for "%u" in get_period()
  - Fix passing char** instead of char* to write_file() in set_polarity()
  - Use strncmp() instead of strncasecmp() since the kernel API uses
    lowercase.
  - Add comments on the 2 main methods of this class
2015-11-10 17:05:34 +11:00
José Roberto de Souza 39bd5fa80e AP_HAL_Linux: Add PWM_Sysfs
This class makes easy to use Linux PWM sysfs interface, available since
Linux 3.10.

More information https://www.kernel.org/doc/Documentation/pwm.txt
2015-11-10 17:05:34 +11:00
José Roberto de Souza d53911e3f6 AP_Math: Add functions to convert microseconds to/from nanoseconds 2015-11-10 17:05:34 +11:00
José Roberto de Souza ca533a9d94 AP_Math: Add functions to convert frequency to/from nanoseconds 2015-11-10 17:05:34 +11:00
Paul Riseborough 577670ccee AP_NavEKF2: Reduce memory required by 6KB when running at 400Hz
Down-sample the IMU and output observer state data to 100Hz for storage in the buffer.
This reduces storage requirements for Copter by 75% or 6KB
It does not affect memory required by plane which already uses short buffers due to its 50Hz execution rate.
This means that the EKF filter operations operate at a maximum rate of 100Hz.
The output observer continues to operate at 400Hz and coning and sculling corrections are applied during the down-sampling so there is no loss of accuracy.
2015-11-10 15:51:18 +11:00
Siddharth Bharat Purohit 5e2382ea09 AP_GPS:UBLOX: send save cfg msg once per 5s and 5 times only 2015-11-10 15:16:55 +11:00
Siddharth Bharat Purohit 360c09f9bd AP_GPS_UBLOX: send cfg save msg only once every 1 second 2015-11-10 15:16:55 +11:00
Jonathan Challinger bc708f9808 AP_GPS: add SAVE_CFG parameter make ublox config saving optional 2015-11-10 15:16:55 +11:00
Jonathan Challinger e82df48631 AP_GPS: save configuration to non-volatile memory in UBlox GPS 2015-11-10 15:16:55 +11:00
lvale 89b593b1f4 APM_OBC: status text severity to INFO or ERROR 2015-11-10 13:11:38 +09:00
lvale b601ef2f9e AP_Arming: status text severity to INFO 2015-11-10 13:11:36 +09:00
lvale 9d88508cc3 GCS_MAVLink: handle_mission_item text severity to info 2015-11-10 13:11:34 +09:00
Jonathan Challinger 6784fd8625 AC_AttitudeControl: reserve parameter IDs 2015-11-10 12:56:52 +09:00
Lucas De Marchi 825d10c81a Filter: remove filter with double type
We are currently not using LowPassFilter2p<double> and it just generates
a lot of warnings on PX4 while instantiating it due to implicitly
promoting float to double:

libraries/Filter/LowPassFilter2p.cpp: In instantiation of
	'T DigitalBiquadFilter<T>::apply(const T&, const DigitalBiquadFilter<T>::biquad_params&) [with T = double]':
libraries/Filter/LowPassFilter2p.cpp:86:41:   required from 'T LowPassFilter2p<T>::apply(const T&) [with T = double]'
libraries/Filter/LowPassFilter2p.cpp:98:16:   required from here
libraries/Filter/LowPassFilter2p.cpp:20:82: warning: implicit conversion from 'float' to 'double' to match other
	operand of binary expression [-Wdouble-promotion]
     T delay_element_0 = sample - _delay_element_1 * params.a1 - _delay_element_2 * params.a2;
                                                                                  ^
2015-11-10 12:43:21 +09:00
Paul Riseborough e33aa7898a AP_NavEKF2: Prevent return of uninitialised variable 2015-11-09 22:30:38 +11:00
Paul Riseborough 3d8e74df26 AP_NavEKF2: Don't switch magnetometers when on the ground or just started
Large magnetometer innovations on the ground could be caused by factors that will disappear when flying, eg:

a) Bad initial gyro bias
b) External magnetic field disturbances (adjacent metal structures, placement of hatches with magnets, etc)

To avoid unnecessary switches, we inhibit switching until off-ground and when sufficient time has lapsed from power on to learn gyro bias offsets.
2015-11-09 22:07:10 +11:00
Paul Riseborough 3099d94e78 AP_NavEKF2: Retrieve correct time-stamp for active compass 2015-11-09 22:07:10 +11:00
Paul Riseborough 6698d4379d AP_Compass: Enable usec timestamps to be retrieved for specified instance 2015-11-09 22:07:10 +11:00
Paul Riseborough 42b47acdfc DataFlash: Fix logging error for EKF second instance 2015-11-09 22:07:10 +11:00
Paul Riseborough 5d2f78996a AP_NavEKF2: Remove un-used data in IMU buffer
Recovers 416 Bytes of memory per EKF2 instance for Copter
2015-11-09 22:07:10 +11:00
Paul Riseborough 88cc1e2ffe DataFlash: Publish the EKF2 magnetometer selection index 2015-11-09 22:07:10 +11:00
Paul Riseborough f00b1ff22d AP_NavEKF2: Publish the magnetometer selection index 2015-11-09 22:07:10 +11:00
Paul Riseborough 7294c8004b AP_NavEKF2: Enable use of backup magnetometers after a timeout
If the magnetometer fails innovation consistency checks for too long (currently 10 sec), then the next available sensor approved for yaw measurement will be used.
2015-11-09 22:07:09 +11:00
Paul Riseborough 6deabe28c2 AP_NavEKF2: Require all magnetometer axes to pass innovation test
The original design intent was to require all axes to pass because severe errors are rarely constrained to a single axis.
This was not achieved with the previous implementation.
These changes move the innovation consistency checks for all three axes to the top before any axes are fused.
Unnecessary performance timers have been removed.
2015-11-09 22:07:09 +11:00
Paul Riseborough afeadfca51 AP_NavEKF2: Don't attempt to compensate for external mag calibration
This was problematic to implement with magnetometer switching. It is likely that slow magnetometer learning can still be performed externally (eg plane) but this will need to be monitored to see if it causes issues.
2015-11-09 22:07:09 +11:00
Paul Riseborough e8305c5653 AP_NavEKF: Prevent front-end from returning uninitialised data (garbage) 2015-11-09 15:56:45 +11:00
Andrew Tridgell 840c9e65bb AP_Baro: don't notify the GCS of new pressure reference too often 2015-11-09 14:34:07 +11:00
Andrew Tridgell e873ff1e5f AP_Param: copter with vectors when sending parameters 2015-11-09 14:28:20 +11:00
Peter Barker 1b13315092 AP_Baro: notify GCS of calibration 2015-11-09 09:23:20 +11:00
Peter Barker 5f9b1c5f4e AP_Param: provide facility to notify GCS of param set 2015-11-09 09:23:20 +11:00
Peter Barker 046b008889 AP_Param: send saved param values to all GCS 2015-11-09 09:23:20 +11:00
Peter Barker 368363531f GCS_MAVLink: provide facilities to send param values to all GCS 2015-11-09 09:23:20 +11:00
Tom Pittenger 73c5234633 AP_Terrain: cache status
instead of computing the terrain status on-demand, assign it in update() and cache the result. Then external tasks that check the status won't be doing terrain intensive calculations in their thread. All the calculations needed for the status were being performed in update already so this is an optimization.
2015-11-09 08:36:41 +11:00
Paul Riseborough f08a4af751 AP_NavEKF2: Remove redundant if statement
Thank you to OXINARF for picking up this one
2015-11-08 17:06:57 +11:00
Paul Riseborough 0f8cfa02ab AP_NavEKF: Remove redundant if statement
Thank you to OXINARF for picking up this one
2015-11-08 17:06:57 +11:00
Paul Riseborough 2243f95074 AP_NavEKF: Enable clean entry into GPS aiding whilst in-flight
Ensures that the latest GPS data is used to reset the states.
Separates the logic used to set the origin from the logic used to determine when to reset states and commence GPS aiding
2015-11-08 17:06:49 +11:00
Paul Riseborough 9efc2152fc AP_NavEKF2: Fix comment 2015-11-08 16:26:04 +11:00
Paul Riseborough a8983d075f AP_NavEKF2: Enable clean entry into GPS aiding in-flight
The setting of the EKF origin and the entry into GPS aiding mode have been separated to make the logic clear.
The order of operations has been changed to ensure that when a reset to GPS is performed, a valid GPS measurement is available in the buffer
Declaration of GPS availability is not made unless the GPS data has been entered into the buffer
2015-11-08 16:26:04 +11:00
Paul Riseborough f99dbc70f9 AP_NavEKF2: Don't return ready to use GPS true if user has inhibited GPS 2015-11-08 16:26:04 +11:00
Paul Riseborough d6f7156f4e AP_NavEKF2: Fix timing offset in position reset calculation
the correction for GPS latency now uses the correct time for that observation
2015-11-08 16:26:04 +11:00
Paul Riseborough 803817821d AP_AHRS: Support changes to EKF2 interfaces that specify the instance
An instance of -1 is specified which causes data for the primary instance to be returned.
2015-11-08 15:37:28 +11:00
Paul Riseborough 138315af21 DataFlash: Add logging for second NKF instance 2015-11-08 15:37:28 +11:00
Paul Riseborough 0b64ad0123 AP_NavEKF2: Enable EKF instance to be specified when requesting public data
Only applied to interfaces required for data logging.
If an invalid instance is requested, the data for the primary instance is returned. This allows the primary data to be returned by calling with a -1 instance value.
2015-11-08 15:37:28 +11:00
Paul Riseborough dfdacf2ddc GCS_MAVLink: Accommodate change to EKF2 interface
Return euler angles for primary instance
2015-11-08 15:37:28 +11:00
Paul Riseborough 5b1d6f2aa2 DataFlash: accomodate change in EKF2 interface 2015-11-08 15:37:28 +11:00
Paul Riseborough 243888e923 GCS_MAVLink: accomodate change in EKF2 interface 2015-11-08 15:37:28 +11:00
Paul Riseborough 6c2dc3ccf8 AP_NavEKF2: Publish the number of instances 2015-11-08 15:37:27 +11:00
Paul Riseborough 46e4c45537 DataFlash: Only log EKF messages when enabled 2015-11-08 15:37:27 +11:00
Paul Riseborough 624f169b9b AP_NavEKF: Publish enabled status 2015-11-08 15:37:27 +11:00
Paul Riseborough 65e4a4ab94 AP_NavEKF2: Use correct casting of integers when printing
Changes in response to review comments
2015-11-08 15:37:27 +11:00
Paul Riseborough 987d261109 DataFlash: Update logging of EKF2 primary core index
Changes made in response to review comments
2015-11-08 15:37:27 +11:00
Paul Riseborough 2dcaeb0304 AP_NavEKF2: Update publishing of primary core index
Changes made in response to review comments
2015-11-08 15:37:27 +11:00
Paul Riseborough 1858da8307 AP_NavEKF2: Better switching in response to faults
Make selection sticky
If fault detected or unhealthy, then switch to healthy core with lowest fault score.
If no healthy core found, do not switch.
2015-11-08 15:37:27 +11:00
Paul Riseborough 5f6d1d8d25 AP_NavEKF2: Add fault score calculation 2015-11-08 15:37:27 +11:00
Paul Riseborough 4884b2d38a DataFlash: Log the primary EKF2 index 2015-11-08 15:37:27 +11:00
Paul Riseborough b24507d33c AP_NavEKF2: Publish the primary EKF index 2015-11-08 15:37:27 +11:00
Paul Riseborough 04165a60a7 AP_NavEKF2: Reduce false positive on EKF health check
Apply filtering to baro innovation check and and don't apply innovation checks once aiding has commenced because GPS and baro disturbances on the ground and during launch could generate a false positive
2015-11-08 15:37:27 +11:00
Paul Riseborough 49f9ea317c AP_NavEKF: Update console message and param descriptions for multiple EKF's 2015-11-08 15:37:26 +11:00
Paul Riseborough 2340e18fdc AP_NavEKF2: Offset the fusion time horizon between multiple instances
Prevents frame over-runs due to simultaneous fusion of measurements on each instance.
The offset is only applied if less than 5msec available between frames
2015-11-08 15:37:26 +11:00
Paul Riseborough 3eeff8dbc6 AP_NavEKF2: Remove unused code
This method of correcting for the fusion time horizon delay was too computationally expensive for our application and did not smooth fusion noise.
2015-11-08 15:37:26 +11:00
Paul Riseborough d48454ee2d AP_NavEKF2: Use nominated IMU unless unavailable
We now run a separate instance of the EKF for each IMU, so input data fusion of IMU's is no longer required.
2015-11-08 15:37:26 +11:00
Siddharth Bharat Purohit 392fce76b2 AP_NavEKF: define getGpsGlitchStatus function 2015-11-08 12:55:58 +09:00
Andrew Tridgell 2ffabe9e05 AP_BoardConfig: fixed PX4v1 build 2015-11-06 17:10:08 +11:00
Andrew Tridgell d52279af27 AP_NavEKF2: don't try to allocate last bytes of memory to EKF2 2015-11-06 10:42:58 +11:00
Andrew Tridgell ee78e2d618 AP_NavEKF2: set primary to first healthy core 2015-11-06 10:42:58 +11:00
Andrew Tridgell 2ab2afc86a AP_NavEKF2: added EK2_IMU_MASK for multiple IMUs
no voting between multiple IMUs yet
2015-11-06 10:42:58 +11:00
Andrew Tridgell 56909ce973 AP_NavEKF: split EKF1 into frontend and backend
this allows the primary EKF to be allocated dynamically, allowing for
experiments with EKF2 with multi-IMU support
2015-11-06 10:42:57 +11:00
Andrew Tridgell c334bd0ddf AP_BoardConfig: added BRD_CAN_ENABLE option
this allows uavcan to be enabled/disabled at boot. When it is disabled
we save about 25k of memory, allowing for more options for things like
multiple EKF
2015-11-06 10:23:37 +11:00
Lucas De Marchi e9c6702269 AP_HAL_VRBRAIN: fix typo using comma operator
We want to return mallinfo().fordblks, not the struct using the comma
operator with a non-existing fordblks variable.
2015-11-05 15:48:32 -02:00
Lucas De Marchi 0d95a9c41d AP_OpticalFlow: reduce lock region
Release the lock as soon as we can.
2015-11-05 16:12:03 +09:00
Lucas De Marchi 70edf31ca6 AP_OpticalFlow: make error path common 2015-11-05 16:12:00 +09:00
Lucas De Marchi 7b726d824d AP_OpticalFlow: remove num_errors increment due to busy bus
num_errors should be used to detect bad bus transfers, not if we
actually read something. Since we are using i2c_sem->take_nonblocking()
failing here is more likely if the bus is shared.
2015-11-05 16:11:58 +09:00
Lucas De Marchi 41ddb67712 AP_OpticalFlow: pack struct passed to I2C layer
We pass "sizeof(i2c_integral_frame)" to hal.i2c->readRegisters(). Since
we have a padding in i2c_integral_frame we actually read 3 bytes more
than we should. Add PACKED to the struct so this is fixed.

i2c_frame doesn't have a padding (or hole) so there isn't this problem,
but since it's also used to calculate the frame size, use PACKED there
too.
2015-11-05 16:11:56 +09:00
Andrew Tridgell 49799257ea GCS_MAVLink: handle available memory of over 64k in mavlink 2015-11-05 16:09:00 +11:00
Andrew Tridgell 883ac59e4a HAL_Linux: always report 256k of available memory 2015-11-05 16:09:00 +11:00
Andrew Tridgell 567ea0e420 HAL_VRBRAIN: make available_memory() uint32_t 2015-11-05 16:09:00 +11:00
Andrew Tridgell 81e34006a5 HAL_SITL: make available_memory() uint32_t 2015-11-05 16:09:00 +11:00
Andrew Tridgell ac1c0bba15 HAL_PX4: make available_memory() uint32_t 2015-11-05 16:09:00 +11:00
Andrew Tridgell 8a4c0593f2 AP_HAL: make available_memory() uint32_t 2015-11-05 16:09:00 +11:00
Andrew Tridgell a3ca732403 AP_Airspeed: show health status in examples 2015-11-05 16:09:00 +11:00
Andrew Tridgell 75d2aed6e1 HAL_SITL: added help for uart command line checks 2015-11-04 14:26:55 +11:00
Víctor Mayoral Vilches d5d1bfae8c AP_HAL_Linux: Adapt code to common RPI layer 2015-11-04 13:58:25 +11:00
Víctor Mayoral Vilches b1a53c383c AP_HAL_Linux: Add AnalogIn_ADS1115, common code
This commit provides a single abstraction for both
Erle-Brain 2 and Navio boards.
2015-11-04 13:58:24 +11:00
Víctor Mayoral Vilches 47d43c64ef AP_HAL_Linux: Add RCInput_RPI, merge common code 2015-11-04 13:58:24 +11:00
Víctor Mayoral Vilches 4a2fe12652 AP_Notify: Add support for Erle-Brain 2 2015-11-04 13:58:24 +11:00
Víctor Mayoral Vilches b54b8aa8af AP_HAL_Linux: AP_BoardLED add support for Erle-Brain 2 2015-11-04 13:58:24 +11:00
Víctor Mayoral Vilches 30faf7e92a AP_InertialSensor: Add Erle-Brain 2 support 2015-11-04 13:58:24 +11:00
Víctor Mayoral Vilches 739fc0df35 AP_HAL_Linux: UtilRPI, add Erle-Brain 2 2015-11-04 13:58:24 +11:00
Víctor Mayoral Vilches 30153b6eac AP_HAL_Linux: Scheduler, add Erle-Brain 2 2015-11-04 13:58:24 +11:00
Víctor Mayoral Vilches 8ae8f47538 AP_HAL_Linux: SPIDriver, add Erle-Brain 2 2015-11-04 13:58:24 +11:00
Víctor Mayoral Vilches 68c92eab25 AP_HAL_Linux: GPIO, add Erle-Brain 2 2015-11-04 13:58:24 +11:00
Víctor Mayoral Vilches 90a00553cb AP_HAL: Boards, add Erle-Brain 2 2015-11-04 13:58:24 +11:00
Lucas De Marchi dd784189a1 AP_AHRS: remove comment about avr-libc 2015-11-04 12:14:16 +11:00
Lucas De Marchi 1a9b57da1f AP_GPS: remove check for GPS_SKIP_SIRF_NMEA 2015-11-04 12:14:15 +11:00
Lucas De Marchi c32d323cd6 GCS_MAVLink: remove check for GPS_RTK_AVAILABLE 2015-11-04 12:14:15 +11:00
Lucas De Marchi e31595c60c AP_GPS: remove check for GPS_RTK_AVAILABLE 2015-11-04 12:14:15 +11:00
Lucas De Marchi c75c1d84d9 AP_GPS: remove check for GPS_MAX_INSTANCES
All supported boards may have more than 1 GPS instance.
2015-11-04 12:14:15 +11:00
Lucas De Marchi c74b1a660d DataFlash: remove DATAFLASH_NO_CLI
This is not used anymore since the removal of AVR CPUs.
2015-11-04 12:14:15 +11:00
Lucas De Marchi 2a91d2169e RC_Channel: remove check for AVR CPUs
Remove the checks for HAL_CPU_CLASS > HAL_CPU_CLASS_16 and
HAL_CPU_CLASS >= HAL_CPU_CLASS_75. Corresponding dead code will be
removed on separate commits.
2015-11-04 12:14:14 +11:00
Lucas De Marchi 45c472205b GCS_MAVLink: remove check for AVR CPUs
Remove the checks for HAL_CPU_CLASS > HAL_CPU_CLASS_16 and
HAL_CPU_CLASS >= HAL_CPU_CLASS_75. Corresponding dead code will be
removed on separate commits.
2015-11-04 12:14:14 +11:00
Lucas De Marchi 1e839f97ed DataFlash: remove check for AVR CPUs
Remove the checks for HAL_CPU_CLASS > HAL_CPU_CLASS_16 and
HAL_CPU_CLASS >= HAL_CPU_CLASS_75. Corresponding dead code will be
removed on separate commits.
2015-11-04 12:14:14 +11:00
Lucas De Marchi ca4ae1c9e0 AP_Motors: remove check for AVR CPUs
Remove the checks for HAL_CPU_CLASS > HAL_CPU_CLASS_16 and
HAL_CPU_CLASS >= HAL_CPU_CLASS_75. Corresponding dead code will be
removed on separate commits.
2015-11-04 12:14:14 +11:00
Lucas De Marchi fb28f426da AP_Math: remove check for AVR CPUs
Remove the checks for HAL_CPU_CLASS > HAL_CPU_CLASS_16 and
HAL_CPU_CLASS >= HAL_CPU_CLASS_75. Corresponding dead code will be
removed on separate commits.
2015-11-04 12:14:14 +11:00
Lucas De Marchi 255e04a841 AP_HAL: remove check for AVR CPUs
Remove the checks for HAL_CPU_CLASS > HAL_CPU_CLASS_16 and
HAL_CPU_CLASS >= HAL_CPU_CLASS_75. Corresponding dead code will be
removed on separate commits.
2015-11-04 12:14:14 +11:00
Lucas De Marchi 4cef751aef AP_GPS: remove check for AVR CPUs
Remove the checks for HAL_CPU_CLASS > HAL_CPU_CLASS_16 and
HAL_CPU_CLASS >= HAL_CPU_CLASS_75. Corresponding dead code will be
removed on separate commits.
2015-11-04 12:14:14 +11:00
Lucas De Marchi 8eef58a8c2 AP_Baro: remove check for AVR CPUs
Remove the checks for HAL_CPU_CLASS > HAL_CPU_CLASS_16 and
HAL_CPU_CLASS >= HAL_CPU_CLASS_75. Corresponding dead code will be
removed on separate commits.
2015-11-04 12:14:14 +11:00
Lucas De Marchi da86e29c27 AP_AHRS: remove check for AVR CPUs
Remove the checks for HAL_CPU_CLASS > HAL_CPU_CLASS_16 and
HAL_CPU_CLASS >= HAL_CPU_CLASS_75. Corresponding dead code will be
removed on separate commits.
2015-11-04 12:14:14 +11:00