Commit Graph

9334 Commits

Author SHA1 Message Date
Caio Marcelo de Oliveira Filho 49a42dc985 SITL: use a SITL namespace 2015-10-22 11:04:42 -02:00
Gustavo Jose de Sousa be8070e335 AP_InertialSensor: MPU9250: publish gyro raw sample rate
So that delta angle calculation is enabled.
2015-10-22 16:53:12 +11:00
Gustavo Jose de Sousa 887f81274d AP_InertialSensor: MPU6000: publish gyro raw sample rate
So that delta angle calculation is enabled.
2015-10-22 16:53:11 +11:00
Gustavo Jose de Sousa 31a49d318c AP_InertialSensor: PX4: publish gyro raw sample rate
That enables delta angle calculation.
2015-10-22 16:53:11 +11:00
Gustavo Jose de Sousa 25a499a41f AP_InertialSensor: use raw sample rate terminology
In order to avoid confusion between sample rate from sensor and sample rate
from the frontend class (AP_InertialSensor), use "raw sample rate" to refer to
the former.

The changes in the code were basically done with the following commands:

git grep -wl _accel_sample_rates | xargs sed -i "s,\<_accel_sample_rates\>,_accel_raw_sample_rates,g"
git grep -wl _set_accel_sample_rate | xargs sed -i "s,\<_set_accel_sample_rate\>,_set_accel_raw_sample_rate,g"
git grep -wl _accel_sample_rate | xargs sed -i "s,\<_accel_sample_rate\>,_accel_raw_sample_rate,g"

git grep -wl _gyro_sample_rates | xargs sed -i "s,\<_gyro_sample_rates\>,_gyro_raw_sample_rates,g"
git grep -wl _set_gyro_sample_rate | xargs sed -i "s,\<_set_gyro_sample_rate\>,_set_gyro_raw_sample_rate,g"
git grep -wl _gyro_sample_rate | xargs sed -i "s,\<_gyro_sample_rate\>,_gyro_raw_sample_rate,g"

And also with minor changes on indentation and comments.
2015-10-22 16:53:11 +11:00
Gustavo Jose de Sousa 6feea5f64f AP_InertialSensor: Backend: remove function _publish_delta_angle()
Delta angle calculation is now unified, so there is no need for such a method.
That also avoids developers thinking they need that method being called
somewhere in their new drivers.
2015-10-22 16:53:11 +11:00
Gustavo Jose de Sousa 7fef515555 AP_InertialSensor: unify delta angle calculation
This commit basically moves delta angle calculation that was previously done in
AP_InertialSensor_PX4 to a common place. Instances must publish their gyro raw
sample rate to enable delta angle calculation.
2015-10-22 16:53:11 +11:00
Gustavo Jose de Sousa 4e83f7b02c AP_InertialSensor: PX4: don't calculate delta angle
Delta angle calculation will be unified.
2015-10-22 16:53:11 +11:00
Gustavo Jose de Sousa 9e05041234 AP_InertialSensor: allow publishing gyro raw sample rate to frontend
That information will be used for a unified delta angle calculation.
2015-10-22 16:53:11 +11:00
Gustavo Jose de Sousa dfd671c54e AP_InertialSensor: Backend: add hook for new gyro sample arrival
That hook will do common tasks for when new gyro raw sample is available.
2015-10-22 16:53:10 +11:00
Gustavo Jose de Sousa a3e2c82491 AP_InertialSensor: Backend: remove function _publish_delta_velocity()
The delta velocity calculation is now unified, so there is no need for such a
method. That also avoids delevopers thinking they need that method being called
somewhere in their new drivers.
2015-10-22 16:53:10 +11:00
Gustavo Jose de Sousa 75fdac648f AP_InertialSensor: unify delta velocity calculation
This commit basically moves delta velocity calculation that was previously done
in AP_InertialSensor_PX4 to a common place. Instances must publish their accel
raw sample rate to enable delta velocity calculation.
2015-10-22 16:53:10 +11:00
Gustavo Jose de Sousa f769a39449 AP_InertialSensor: PX4: don't calculate delta velocity
Delta velocity calculation will be unified.
2015-10-22 16:31:07 +11:00
Paul Riseborough 44f42fe72d AP_NavEK: Reduce settling time after start-up disturbance
Now that we are using  a consistent 50Hz minimum update rate for the covariance prediction we do not need a different initial gyro bias uncertainty for plane and copter to maintain filter stability margins.
The default value of 0.1 rad/s was too high and gave excessive settling time of the filter attitude after startup.
The initial attitude uncertainty has been increased to allow for some movement during startup.
2015-10-22 16:23:14 +11:00
Lucas De Marchi cdaf67b749 AP_HAL_Linux: use PCA9685 for output in minlure 2015-10-22 12:04:53 +11:00
Lucas De Marchi b75524a152 AP_HAL_Linux: use UART RC input for minlure 2015-10-22 12:04:53 +11:00
Lucas De Marchi f915d2ff6f AP_Notify: don't define devices for minlure
It still doesn't have a notify device.
2015-10-22 12:04:53 +11:00
Lucas De Marchi f72a5614d5 AP_HAL_Linux: add I2C buses for minlure 2015-10-22 12:04:53 +11:00
Lucas De Marchi 959e061514 AP_HAL_Linux: add spi device for minlure 2015-10-22 12:04:53 +11:00
Lucas De Marchi ed36ae9ef7 AP_InertialSensor: MPU6000: add rotation for minlure 2015-10-22 12:04:52 +11:00
Lucas De Marchi 386547427d AP_Baro: support MS5611 on second i2c bus 2015-10-22 12:04:52 +11:00
Lucas De Marchi e6b942ffb0 AP_Compass: use HMC5843 behind MPU6000 for minlure 2015-10-22 12:04:52 +11:00
Lucas De Marchi 4992375bab AP_HAL_Linux: add GPIO definitions for minlure 2015-10-22 12:04:52 +11:00
Lucas De Marchi 8153f57f06 AP_HAL: add board definitions for minlure 2015-10-22 12:04:52 +11:00
Gustavo Jose de Sousa 7daa3201fd AP_HAL_Linux: add test for GPIO 2015-10-22 12:04:52 +11:00
Gustavo Jose de Sousa cdf70f6fe5 AP_HAL_Linux: add GPIO_Sysfs
This commit adds the class Linux::GPIO_Sysfs. This class provides a generic
implementation of AP_HAL::GPIO on Linux by using GPIO Sysfs Interface
(https://www.kernel.org/doc/Documentation/gpio/sysfs.txt).

The channel() interface should be preferred in places that need to be
fast. Since it maintains the file descriptor open this is much faster
than opening and closing it.
2015-10-22 12:04:52 +11:00
Gustavo Jose de Sousa 88146f1f02 AP_HAL_Linux: make board specific GPIO inclusions last
Board specific inclusions should be the last inclusions so that any
eventual dependency may be fulfilled.
2015-10-22 12:04:52 +11:00
Fabio Mello 20e209120f AP_HAL_Linux: add support for RCInput through UART
We are using a microcontroller to read the PWM input from RC. The read
values are sent to our board using a simple serial protocol through the
UART interface.

This patch interprets these values and passes them forward to the APM.
2015-10-22 12:04:52 +11:00
Paul Riseborough 6c017ffcb5 AP_NavEKF: Predict covariance more often to prevent instability on startup
If the baro data and magnetometer data are interleaved (arriving every 100 msec and offset by 50 msec), then the filter will go unstable during startup and fail to complete checks.
2015-10-22 09:57:38 +09:00
Gustavo Jose de Sousa 63b42e0632 AP_Compass: Calibrator: make calculations for theta only once
Additionally, format comment on sample acceptance formulas nicely.
2015-10-22 08:19:35 +11:00
Gustavo Jose de Sousa f8433f82e6 AP_Compass: simplify calibration transition to COMPASS_CAL_RUNNING_STEP_ONE 2015-10-22 08:19:35 +11:00
Lucas De Marchi f21ee7694a AP_HAL_Linux: don't use relative includes
Use brackets to include from AP_HAL and reorder headers.
2015-10-21 15:54:27 -02:00
Lucas De Marchi eef4d5819f AP_HAL: HAL: don't use relative includes
Includes in the same dir should not be relative. Also sort them
alphabetically.
2015-10-21 15:54:27 -02:00
Lucas De Marchi 74ccbdb6f7 AP_HAL: AnalogIn: add missing include
Since we are using uint8_t and uint16_t types we need to include the
correspondent system header. Otherwise it would depend on the include
order of who is including this particular header, causing failures as we
move headers around.
2015-10-21 15:54:27 -02:00
Andrew Tridgell 6b048b4045 HAL_SITL: use SimRover 2015-10-21 22:04:21 +11:00
Andrew Tridgell 05876b7e1b SITL: Changed Rover to SimRover
this avoids the rover crash in master
2015-10-21 22:04:19 +11:00
Paul Riseborough b08817554e AP_NavEKF2: Ensure consistent position and velocity fusion rates when not using GPS
This sets the fusion of the synthetic position and velocity to occur at the same time as the barometer

This makes filter tuning more consistent between GPS and non-GPS useage
2015-10-21 17:27:00 +11:00
Paul Riseborough 1c347e8859 AP_NavEKF: Prevent high measurement data rates from overflowing buffers
High measurement data rates can fill buffers with data that is always new and never fused because it is over-written before it falls behind the measurement time horizon.
2015-10-21 17:27:00 +11:00
Paul Riseborough d1a090dda8 AP_NavEKF: Fix bug fetching data from measurement buffers
This bug can result in valid data being rejected and fused at the wrong time horizon.
2015-10-21 17:27:00 +11:00
Paul Riseborough aabb9b4e02 AP_NavEKF2: handle uncertain build type 2015-10-21 17:27:00 +11:00
Paul Riseborough e6312d91ce AP_NavEKF2: Correct variable name 2015-10-21 17:27:00 +11:00
Paul Riseborough 4640673cb1 AP_NavEKF2: Fix bug causing incorrect fusion timing 2015-10-21 17:27:00 +11:00
Andrew Tridgell 4a8a24a1a2 AP_Compass: don't update last_update_usec for raw fields
this fixes a problem where the EKF gets compass samples at 50Hz
instead of the expected 10Hz
2015-10-21 13:22:24 +11:00
Tom Pittenger 695efb8df3 AP_L1_Control: added integrator to help xtrack error converge to zero
new param: NAVL1_XTRACK_I
    // @Description: Crosstrack error integrator gain. This gain is applied to the crosstrack error to ensure it converges to zero. Set to zero to disable. Smaller values converge slower, higher values will cause crosstrack error oscillation.
fixes https://github.com/diydrones/ardupilot/issues/2650

when param is changed the integrator is set to zero. This makes for easier tuning by seeing it converge to zero on each change.
2015-10-21 12:49:43 +11:00
Caio Marcelo de Oliveira Filho f7c73fbb13 AP_AHRS: remove AHRS_EKF_USE_ALWAYS define
This option now is passed when instantiating the code in ArduCopter, so
selecting the default value at compile time is not necessary anymore.

The motivation is to move vehicle specifc code out of the general
libraries. This patch shouldn't change behavior.
2015-10-21 11:01:11 +11:00
Caio Marcelo de Oliveira Filho 9d2e3157fe AP_AHRS: add a runtime flag for always using EKF
The AHRS_EKF_USE_ALWAYS define is used to force EKF to be always
used. It is defined only for building ArduCopter. Change it to be a
runtime flag. Keep its default value still based on the original define,
once the Copter uses it the define will be removed.

The motivation is to move vehicle specifc code out of the general
libraries. This patch shouldn't change behavior.
2015-10-21 11:01:10 +11:00
Caio Marcelo de Oliveira Filho e87db31149 AP_AHRS: remove unused define
AHRS_EKF_USE_DEFAULT is not used since commit
7ba45444a2 "AP_AHRS: added selection of
EKF type using AHRS_EKF_TYPE".
2015-10-21 11:01:10 +11:00
Peter Barker 38ca9dee03 GCS_MAVLink: use simple log entry number to reference df logs 2015-10-21 10:50:32 +11:00
Peter Barker e481497574 DataFlash: delete oldest file rather than the lowest-numbered file
Also reference log numbers by their list index to accomodate log number
wrapping in DataFlash_File
2015-10-21 10:50:32 +11:00
wsilva32 ab7148386c AP_HAL_AVR_SITL: Limit SITL compass reports to 100Hz
Similarly to how the SITL baro currently works, setHIL is only called at 100Hz.
2015-10-21 10:39:27 +11:00