Commit Graph

11354 Commits

Author SHA1 Message Date
Peter Barker 8d5ceda534 AP_HAL_SITL: ensure specified SITL model is found
Without this check we get a null pointer exception the first time we attempt
to use the model object
2016-05-16 13:04:15 -03:00
Andrew Tridgell c6620b03b4 HAL_SITL: added --rtscts option to SITL
useful for radio testing
2016-05-16 16:51:26 +10:00
Rustom Jehangir 39fc17f384 DataFlash: Fix parameter description for param_parse.py 2016-05-16 11:09:31 +10:00
Andrew Tridgell 8571202199 AP_RPM: allow for low RPM measurements on PX4
this automatically adjusts the timer resolution to allow for low RPM
measurements on PX4
2016-05-14 18:05:13 +10:00
Tom Pittenger 38b7d7e1c6 DataFlash: log baro drift offset 2016-05-13 17:22:12 -07:00
Tom Pittenger f1f58e2026 AP_Baro: created baro drift offset accessor 2016-05-13 17:22:11 -07:00
Tom Pittenger f1186b8b5c AP_Mission: store previous nav cmd id 2016-05-13 17:22:03 -07:00
Tom Pittenger d900988a23 DataFlash: Log airspeed.Use 2016-05-13 17:22:02 -07:00
Jonathan Challinger 0281b948df AP_Arming: loosen accelerometer consistency check on Z axis
Original author @jschall via 88f5d9f858
2016-05-13 17:16:12 -07:00
Tom Pittenger d55050e5e3 AP_Baro: slow down the LPF for slewing to a new GND_ALT_OFFSET
Instead of a couple seconds, make it about 15sec. This makes TECS happy by not glitching the height demand as much. When applied too fast the TECS height demand causes a large single oscillation as it chases the filter lag.
2016-05-13 17:15:53 -07:00
Tom Pittenger 37ee3b44d2 AP_Baro: add accessor for baro drift 2016-05-13 17:15:41 -07:00
Tom Pittenger 2e1eef7cf0 AP_Airspeed: airspeed healthy should also check if enabled 2016-05-13 17:14:55 -07:00
Andrew Tridgell e3107a7e10 AP_HAL: fixed optflow typos 2016-05-14 08:26:10 +10:00
Andrew Tridgell 1b7830c577 AP_SpdHgtControl: update for changed API 2016-05-14 08:26:10 +10:00
Andrew Tridgell 98a86bd205 AP_TECS: create TEC2 log message for detailed energy internals 2016-05-14 08:26:10 +10:00
Andrew Tridgell ff97f52555 AP_TECS: removed log_tuning structure 2016-05-14 08:26:10 +10:00
Andrew Tridgell bc911d15d1 AP_TECS: convert to using Log_Write
preparation for a TEC2 message
2016-05-14 08:26:10 +10:00
Andrew Tridgell 9a6ac77c64 AP_TECS: prevent large glitches in the specific energy integrator
this tries to prevent problems like in issue#4066, or at least
reducing the impact when it happens
2016-05-14 08:26:10 +10:00
Andrew Tridgell c52451b01b AP_TECS: rename some variables to make them clearer 2016-05-14 08:26:09 +10:00
Andrew Tridgell e698d1f47e AP_TECS: use 64 bit micros
prevent possible wrap if TECS is not run for a long time
2016-05-14 08:26:09 +10:00
Ricardo de Almeida Gonzaga 64d14356b9 AP_NavEKF2: Fix typos 2016-05-13 19:20:06 -03:00
Ricardo de Almeida Gonzaga 2f88e32657 AP_HAL_FLYMAPLE: Fix typos 2016-05-13 19:20:06 -03:00
Ricardo de Almeida Gonzaga 2236640f66 AP_HAL_Linux: Fix typos 2016-05-13 19:20:06 -03:00
Ricardo de Almeida Gonzaga 267a74ebb2 AP_NavEKF: Fix typos 2016-05-13 19:20:06 -03:00
Ricardo de Almeida Gonzaga 4047fb63fc AP_GPS: Fix typos 2016-05-13 19:20:06 -03:00
Ricardo de Almeida Gonzaga 481e3a2af6 AP_Math: Fix typos 2016-05-13 19:20:06 -03:00
Ricardo de Almeida Gonzaga 00b1915034 AP_HAL_Empty: Fix typos 2016-05-13 19:20:06 -03:00
Ricardo de Almeida Gonzaga 892cc2ea6f AP_HAL_PX4: Fix typos 2016-05-13 19:20:06 -03:00
Ricardo de Almeida Gonzaga 1efa4a4115 doc: Fix typos 2016-05-13 19:20:06 -03:00
Ricardo de Almeida Gonzaga 2bf9aa94ad AP_AHRS: Fix typos 2016-05-13 19:20:06 -03:00
Ricardo de Almeida Gonzaga 2802775e7d AP_Motors: Fix typos 2016-05-13 19:20:06 -03:00
Ricardo de Almeida Gonzaga dfe38b61de AP_Mission: Fix typos 2016-05-13 19:20:06 -03:00
Ricardo de Almeida Gonzaga 91e9dd10ba AP_HAL_SITL: Fix typos 2016-05-13 19:20:06 -03:00
Ricardo de Almeida Gonzaga eb418f54ee AP_HAL: Fix typos 2016-05-13 19:20:06 -03:00
Ricardo de Almeida Gonzaga aa4b66509f AP_AccelCal: Fix typos 2016-05-13 19:20:06 -03:00
Ricardo de Almeida Gonzaga fcbed13533 AP_Mount: Fix typos 2016-05-13 19:20:06 -03:00
Ricardo de Almeida Gonzaga af13e2cca4 AP_Declination: Fix typos 2016-05-13 19:20:05 -03:00
Ricardo de Almeida Gonzaga e6564c2efa AP_BoardConfig: Fix typos 2016-05-13 19:20:05 -03:00
Ricardo de Almeida Gonzaga 2e58653983 AP_Compass: Fix typos 2016-05-13 19:20:05 -03:00
Ricardo de Almeida Gonzaga 5237c86bca AP_BattMonitor: Fix typos 2016-05-13 19:20:05 -03:00
Ricardo de Almeida Gonzaga d5a2c57c5e AP_InertialSensor: Fix typos 2016-05-13 19:20:05 -03:00
Ricardo de Almeida Gonzaga 08a022fa6a AP_Frsky_Telem: Fix typos 2016-05-13 19:20:05 -03:00
Ricardo de Almeida Gonzaga 8d6cc587c5 APM_Control: Fix typos 2016-05-13 19:20:05 -03:00
Ricardo de Almeida Gonzaga 3033c53834 AC_WPNav: Fix typos 2016-05-13 19:20:05 -03:00
Ricardo de Almeida Gonzaga a8889e5765 AP_Common: Fix typos 2016-05-13 19:20:05 -03:00
Ricardo de Almeida Gonzaga f6ad89103c AP_Arming: Fix typos 2016-05-13 19:20:05 -03:00
Ricardo de Almeida Gonzaga 3f92a64b99 GCS_MAVLink: Fix typos 2016-05-13 19:20:05 -03:00
Ricardo de Almeida Gonzaga e31a37e7a8 AP_Notify: Fix typos 2016-05-13 19:20:05 -03:00
Ricardo de Almeida Gonzaga 287eb69502 PID: Fix typos 2016-05-13 19:20:05 -03:00
Ricardo de Almeida Gonzaga dc7acdf03f DataFlash: Fix typos 2016-05-13 19:20:05 -03:00
Ricardo de Almeida Gonzaga 2ee6a85e67 AP_RangeFinder: Fix typos 2016-05-13 19:20:05 -03:00
Ricardo de Almeida Gonzaga 099fc69032 RC_Channel: Fix typos 2016-05-13 19:20:05 -03:00
Lucas De Marchi 388a6683ad AP_OpticalFlow: fix optical flow initialization
This fixes the initialization for Linux boards using the PX4Flow module.
The problem is that after the conversion to use I2CDevice we now need to
use I2CDeviceManager, which is statically constructed after the vehicle
object.

So, if we try to call hal.i2c_mgr->get_device(), it will call the
get_device() method before the constructor is called and receive a
SIGSEGV:

Program received signal SIGSEGV, Segmentation fault.
0x000b06c0 in OpticalFlow::OpticalFlow (this=0x140914 <copter+4980>, ahrs=...)
    at ../../libraries/AP_OpticalFlow/OpticalFlow.cpp:54
54      ../../libraries/AP_OpticalFlow/OpticalFlow.cpp: No such file or directory.
2016-05-13 11:22:12 -03:00
Lucas De Marchi 37f6b51746 AP_HAL_Linux: Scheduler: set stack sizes to 256k
Running the vehicles we check the stack size doesn't grow too much by
enabling the DEBUG_STACK in the scheduler. Even on 64bit boards the
stack is consistent around 4k. Just to be a little conservative, let it
be a little bit more that that: 256kB.

Since we have RT prio and we call mlock(), the memory for the stack of
each thread is locked in memory. This means we are effectively taking
that much memory. The default stack size varies per distro, but it's
common to have 8MB for 64 bit boards and 4MB for 32 bit boards. Here is
the output of ps -L -o 'comm,rtprio,rss $(pidof arducopter-quad)', showing the
RSS of arducopter-quad before and after this change:

Before:
	COMMAND         RTPRIO   RSS
	arducopter-quad     12 46960
	sched-timer         15 46960
	sched-uart          14 46960
	sched-rcin          13 46960
	sched-tonealarm     11 46960
	sched-io            10 46960

After:
	COMMAND         RTPRIO   RSS
	arducopter-quad     12  7320
	sched-timer         15  7320
	sched-uart          14  7320
	sched-rcin          13  7320
	sched-tonealarm     11  7320
	sched-io            10  7320
2016-05-12 13:35:23 -03:00
Lucas De Marchi b2d4da4b0a AP_HAL_Linux: Thread: allow to set stack size
This allows the code that is creating the thread to set the size of the
stack.
2016-05-12 13:35:23 -03:00
Lucas De Marchi d970451331 AP_HAL_Linux: Scheduler: debug stack usage 2016-05-12 13:35:23 -03:00
Lucas De Marchi f5f4aa7c21 AP_HAL_Linux: Thread: allow to debug stack usage 2016-05-12 13:35:23 -03:00
proficnc 20a569a4d5 AP_Mount: block forwarding of MAVlink by bitmask 2016-05-12 17:44:09 +10:00
proficnc c8b3c527f9 GCS_MAVLink: add route mask for blocking MAVlink forwading 2016-05-12 17:44:06 +10:00
Andrew Tridgell 9bf0ada875 AC_AttitudeControl: removed use of AFF for tail control in heli 2016-05-12 17:37:22 +10:00
Andrew Tridgell a6404cf1ea AC_PID: removed AFF from heli PID
this is not used any more. Discussed with Rob on dev call
2016-05-12 17:37:01 +10:00
Andrew Tridgell cf08c46f30 AC_PID: fixed default leak min for heli 2016-05-12 17:34:23 +10:00
Lucas De Marchi aa974399d0 AP_Math: use inline wrappers for constrain_* functions
This avoids some warnings about "constrain_float defined but not used"
in some compilers.
2016-05-11 22:51:19 -03:00
Vinicius Juvinski 3bae8373e6 AP_Notify: play vehicle lost tone 2016-05-11 22:49:52 -03:00
Vinicius Juvinski c1dd3cb921 AP_Notify: add support for for Buzzer on BBBMini
Use GPIO P8_31 for buzzer in BBBMini
2016-05-11 22:49:52 -03:00
Peter Barker 7510e4d0a7 SITL: setsid() when starting JSBSim so Ctrl-C doesn't kill it in GDB 2016-05-11 14:10:48 +10:00
Andrew Tridgell eeef28be5e AP_HAL_PX4: fixed hexacopter on Pixracer
the _servo_count was 4 as we didn't re-fetch the count after applying
changes in AP_BoardConfig from BRD_PWM_COUNT
2016-05-11 13:01:15 +10:00
Andrew Tridgell 8a7627474f Revert "AP_HAL_PX4: use new I2CDevice interface"
This reverts commit f767918e0e.

These commits broke startup on PX4
2016-05-11 12:19:00 +10:00
Andrew Tridgell 8c06e6cddc Revert "AP_HAL_PX4: embed PX4_I2C object into I2CDevice"
This reverts commit 54fd3702c3.

These commits broke startup on PX4
2016-05-11 12:18:45 +10:00
Staroselskii Georgii a2ae662b3e AP_Compass: add an extra rotation for internal LSM9DS1 on Navio2
In order not to force users to set rotation themselves, we need this
hack to make an extra rotation needed for a second compass.
2016-05-10 17:24:43 -03:00
Staroselskii Georgii 2e5cfc2849 AP_Compass: added external compass autodetection on Navio 2016-05-10 17:24:43 -03:00
Staroselskii Georgii 62f2695e83 AP_Compass: added several compasses' autodetection on Navio 2 2016-05-10 17:24:43 -03:00
Staroselskii Georgii 8be5ef1642 AP_HAL: added possibility to use several compassed on Navio 2 2016-05-10 17:24:43 -03:00
Staroselskii Georgii 71736a0ecc AP_Compass: enable LSM9DS1 magnetometer for boards without default one 2016-05-10 17:24:43 -03:00
Staroselskii Georgii f7846403e1 AP_HAL_Linux: enabled SPI-driven LSM9DS1 for Navio 2 2016-05-10 17:24:43 -03:00
Staroselskii Georgii b677f975e7 AP_Compass: added LSM9DS1 magnetometer support 2016-05-10 17:24:43 -03:00
Andrew Tridgell 88b910c13d SITL: changed firefly motors to be suitable for a pixhawk
get channel groupings right
2016-05-11 05:55:25 +10:00
Andrew Tridgell 3e1cad5df2 SITL: adjust tricopter so default yaw servo values will work 2016-05-11 05:55:24 +10:00
Andrew Tridgell 48ca1a8d92 SITL: increase the mass of the plane to 2kg
less wafty in the air
2016-05-11 05:55:24 +10:00
Andrew Tridgell 9c90709872 SITL: fixed namespace of SITL classes 2016-05-11 05:55:23 +10:00
Andrew Tridgell 91abc636f4 SITL: fixed quadplanes with elevons 2016-05-11 05:55:23 +10:00
Andrew Tridgell a41ffc176c RC_Channel: added motor tilt auxillary channel 2016-05-11 05:55:23 +10:00
Andrew Tridgell 2d47ca8095 SITL: fixed moment of rotated motors 2016-05-11 05:55:23 +10:00
Andrew Tridgell 60b3625950 AP_Motors: added hook for vehicle based thrust compensation
allow vehicle code to compensate for thrust effectiveness changes due
to properties outside the scope of AP_Motors. This allows for
compensation in tiltrotors and tiltwings.
2016-05-11 05:55:23 +10:00
Andrew Tridgell 37d6b5fdaf AP_Motors: added output_motor_mask()
this will be used for tiltrotors in forward flight
2016-05-11 05:55:23 +10:00
Andrew Tridgell bd8cd71745 SITL: fixed fwd motor angles for tri and y6 frames
should be 60 degrees to have motors evenly spaced around frame for
equal lift per motor when level
2016-05-11 05:55:23 +10:00
Andrew Tridgell 125a9feb3d SITL: added tilttri frame type
tiltrotor tricopter
2016-05-11 05:55:22 +10:00
Lucas De Marchi 68ae619448 AP_Compass: detect compasses for minlure
Minlure has an onboard compass (HMC5883L) as slave of MPU-6000, but also
allows the use of an external HMC5883L compass, which should be
connected to the lure's I2C port.
2016-05-10 16:08:39 -03:00
Lucas De Marchi 424434e31e AP_HAL: allow to build without HAL_COMPASS_DEFAULT
Otherwise we need to change the ifdef chain adding HAL_COMPASS_<BOARD>
definitions.
2016-05-10 16:07:23 -03:00
Lucas De Marchi 3315f46800 AP_HAL_Linux: inline I2C bus options for minlure
We don't need all the comments in the array declaration and we can
inline its declaration in the function call. This makes it easier to
copy it to other places.
2016-05-10 16:06:53 -03:00
Gustavo Jose de Sousa 91246ad8af AP_Compass: HMC5843: apply HMC5883L "arrow" rotation only if external
That rotation is done because of the "arrow" pointing the sensor direction in
3DR GPS+Compass kit (which isn't natural to the sensor orientation, by the
way). Thus, do that rotation only for external HMC5883L compasses.
2016-05-10 16:05:29 -03:00
Gustavo Jose de Sousa 35cddc7af0 AP_Compass: HMC5843: move hardcoded rotation to before call to rotate_field()
That rotation is set for AP_COMPASS_TYPE_HMC5883L, because it's usually
the compass from 3DR GPS+Compass kit, which has an arrow pointing the
"correct" direction. That rotation should be done before rotate_field()
as it represents the "standard" position for the kit.

This patch also makes published values consistent with respect to rotation.
Before this, raw fields used in calibration were published with a
rotation different from the filtered field when _product_id is
AP_COMPASS_TYPE_HMC5883L.
2016-05-10 15:56:38 -03:00
Gustavo Jose de Sousa ad91a810b3 AP_Compass: Backend: add method is_external() 2016-05-10 15:55:58 -03:00
Gustavo Jose de Sousa 670b0071f9 AP_Compass: HMC5843: add parameter force_external to constructor
And to the detection probe() method. That way we don't need to use a board
`#ifdef` inside the class code.  Additionally, we make raspilot board use it.
2016-05-10 15:52:54 -03:00
Lucas De Marchi 54fd3702c3 AP_HAL_PX4: embed PX4_I2C object into I2CDevice
Otherwise we would destroy PX4_I2C object after returning from
I2CDeviceManager::get_device(). Since this implementation is very
simple, just make PX4_I2C as an internal class and embed it into the
I2CDevice object.
2016-05-10 15:39:24 -03:00
Luiz Ywata f767918e0e AP_HAL_PX4: use new I2CDevice interface 2016-05-10 15:12:30 -03:00
Lucas De Marchi 3c7d80a270 AP_Baro: BMP085: use a moving average of 10 samples in BMP085
Instead of depending on the frequency accumulate() is called, use
AverageIntegralFilter with 10 samples. The data obtained by BMP085 is
too noisy with any value of OVERSAMPLING so use twice the number of
samples as currently used. Besides that now we are sure there's always
10 samples used in the average.
2016-05-10 14:24:59 -03:00
Lucas De Marchi 18f1f8bea8 Filter: add AverageFilter variant to save current sum
When the the variable in which we are saving the current sum is of
integral type we can use a much more optimized apply() method: instead
of looping the entire number of samples adding them up, we always keep
the current sum in a member.  It also allows the caller to decide the
type it wants to use to get the average: this may be dictated by another
interface it uses or it may want to avoid the implicit truncate in the
return of apply().
2016-05-10 14:24:59 -03:00
Lucas De Marchi 8da5275b03 AP_Baro: BMP085: don't average temperature in BMP085
The temperature readings is not subject to white noise so there's no
point in averaging its reading. Moreover since for a normal 50Hz
accumulate() / 10Hz update() it would read temperature only once per
update(), it's pointless to keep averaging and introducing rounding
error.

The temperature doesn't need to be checked as frequent as pressure, too.
The datasheet even suggests on section 3.3, page 10 to enable standard
mode and read the temperature at 1Hz. Here we reduce it to 2Hz
(considering the accumulate() function being called at 50Hz).
2016-05-10 14:24:59 -03:00
Lucas De Marchi c5c52076ca AP_Baro: BMP085: rename private member 2016-05-10 14:24:58 -03:00