Commit Graph

10581 Commits

Author SHA1 Message Date
Andrew Tridgell
a3d781bf3f GCS_MAVLink: fixed a valgrind error 2016-01-06 19:54:00 +11:00
Andrew Tridgell
0e8dbe92f0 GCS_MAVLink: fixed string overrun found by asan 2016-01-06 19:53:14 +11:00
Andrew Tridgell
519afc7a06 HAL_PX4: debug code for FRAM corruption 2016-01-06 19:16:16 +11:00
Andrew Tridgell
9941c91d36 RC_Channel: prevent a warning message for assigned RC channels 2016-01-06 19:16:12 +11:00
Andrew Tridgell
6c064ae8bd HAL_SITL: flow control is enabled on SITL
faster parameter download
2016-01-06 19:16:08 +11:00
Andrew Tridgell
68a46bc1ff GCS_MAVLink: use AP_Param::count_parameters() 2016-01-06 14:44:37 +11:00
Andrew Tridgell
93f0707679 AP_Param: added count_parameters() API
this auto-clears when an ENABLE parameter changes
2016-01-06 14:44:34 +11:00
Peter Barker
ff8008d81a DataFlash: remove unused callbacks, unimplemented functions
Closes #3269
2016-01-05 17:08:07 -02:00
Víctor Mayoral Vilches
d73fc4c0b2 AP_Notify: Add PXFmini support 2016-01-05 15:35:56 -02:00
Víctor Mayoral Vilches
fa3dad928b HAL_Linux: Add PXFmini to Linux_Class 2016-01-05 15:35:56 -02:00
Víctor Mayoral Vilches
e1de1f5f80 HAL_Linux: Util, add PXFmini support 2016-01-05 15:35:56 -02:00
Víctor Mayoral Vilches
e493bfcae4 AP_InertialSensor: add PXFmini support 2016-01-05 15:35:56 -02:00
Víctor Mayoral Vilches
a0b9181198 HAL_Linux: Scheduler add PXFmini support 2016-01-05 15:35:55 -02:00
Víctor Mayoral Vilches
1c49b086eb HAL_Linux: SPIDriver add PXFmini support 2016-01-05 15:35:55 -02:00
Lucas De Marchi
e0d19dc87d AP_HAL_Linux: RCInput_RPI: fix coding style 2016-01-05 15:35:34 -02:00
Víctor Mayoral Vilches
fdf490dad1 HAL_Linux: RCInput support for PXFmini 2016-01-05 15:34:50 -02:00
Lucas De Marchi
4e883e033f AP_HAL_Linux: GPIO: remove ifdef comment
It just clutters the source code and review process when a new similar
board is added.
2016-01-05 15:34:49 -02:00
Víctor Mayoral Vilches
8ce8045033 HAL_Linux: GPIO, add support for PXFmini 2016-01-05 15:31:43 -02:00
Víctor Mayoral Vilches
0aee50b99e HAL: Add PXFmini board 2016-01-05 15:31:43 -02:00
Andrew Tridgell
ea823a818c AP_AHRS: enable EKF2 by default in AHRS 2016-01-05 16:42:01 +11:00
Andrew Tridgell
a0a4b698f6 AP_NavEKF: disable EKF1 by default
use EKF2 instead
2016-01-05 16:41:48 +11:00
Andrew Tridgell
c34626ec4e AP_NavEKF2: automatically cut back EK2_IMU_MASK to suit number of IMUs 2016-01-05 16:40:43 +11:00
Andrew Tridgell
cc25575b3a AP_Scheduler: prevent a startup crash in autotest for Rover 2016-01-05 16:31:06 +11:00
Andrew Tridgell
62b2a2117d SITL: only report ground contact at most once per second 2016-01-05 09:47:58 +11:00
Andrew Tridgell
dd07ffce08 HAL_SITL: enable debug of rcoutput channel enable and frequency 2016-01-05 09:47:55 +11:00
Andrew Tridgell
526fb65dd1 HAL_PX4: fixed setting of rcout frequency on alt channels 2016-01-05 09:47:52 +11:00
Andrew Tridgell
224b2e2dda AP_Param: allow group entries as duplicates
otherwise this breaks heli attitude control object
2016-01-05 07:50:23 +11:00
Andrew Tridgell
b6155d2cb6 RC_Channel: fixed output for k_motor* 2016-01-05 06:41:51 +11:00
Andrew Tridgell
1b682e3c8f AP_Motors: swash servos are output only 2016-01-05 06:41:51 +11:00
Andrew Tridgell
238e912000 RC_Channel: allow find_channel() to be called early
and fix a bug!
2016-01-05 06:40:48 +11:00
Lucas De Marchi
47f25a0aa0 AP_HAL_Linux: remove _export_pins() method
The initial idea was to export all pins to be used at once, so we
created _export_pins() to take all of them and a wrapper method,
_export_pin() to export a single one. However we never export more than
one pin at once.
2016-01-04 15:12:49 -02:00
José Roberto de Souza
ba0ed84039 AP_HAL_Linux: Refactor GPIO_Sysfs
- Replaced PATH_MAX by the maximum stack memory it will use for GPIO
  paths
- Added more information to error logs
- Removed the '/n' when writing to GPIO sysfs files
- Using Linux Util write_file() on _pinMode()
2016-01-04 15:12:49 -02:00
José Roberto de Souza
0c0d595b55 AP_HAL_Linux: Export GPIO pin inside of pinMode()
Make sure pinMode() method exports the pin before using it. Otherwise
the export method would need to be called, differently from other GPIO
implementations.

Since now export_pin and export_pins are called only internally, reduce
their visibility to protected.
2016-01-04 15:12:49 -02:00
Ricardo de Almeida Gonzaga
7033e4d8ed AP_HAL_Linux: OpticalFlow swap crop and scale order
In order to be easier to understand the image manipulation for the ones
who read this part, since the order makes no difference in this stage.
2016-01-04 09:24:01 -02:00
Ricardo de Almeida Gonzaga
cbb313ec2c AP_HAL_Linux: Fix OpticalFlow crop calculation
'left' value should be the lateral edges size
2016-01-04 09:24:01 -02:00
Andrew Tridgell
9123ef9f38 RC_Channel: added find_channel() and channel numbers 2016-01-04 17:06:57 +11:00
Andrew Tridgell
d31ba2b380 AP_Motors: added rc_write function
this is intended to make remapping motors and rescaling output easier
2016-01-04 16:56:54 +11:00
Andrew Tridgell
79c90d37f6 AP_Motors: apply HELI_RSC output type if available 2016-01-04 16:14:09 +11:00
Andrew Tridgell
6a58264c6b RC_Channel: added set_aux_channel_default() API
this will allow for a default channel for aux functions. Also adds
heli_rsc and heli_tail_rsc functions
2016-01-04 16:14:09 +11:00
Randy Mackay
ccd3725f63 AP_Mount_Servo: remove out of date comment 2016-01-04 11:23:41 +09:00
Andrew Tridgell
e1f4814068 AP_Motors: only set output side of range for RSC 2016-01-04 11:23:38 +09:00
Andrew Tridgell
7cc53b6449 RC_Channel: setup only in or out part of channels for aux channels
this allows separate use of input and output
2016-01-04 11:23:36 +09:00
Andrew Tridgell
48b774bc63 RC_Channel: allow more complete separation of input and output of channels
this allows for the type and range of channels to be different on
input and output
2016-01-04 11:23:30 +09:00
Andrew Tridgell
0ef61b1637 AP_NavEKF: moved ENABLE param to front of list
and mark as FLAG_ENABLE. This removes the EKF_* parameters when
EKF_ENABLE is 0
2016-01-04 11:14:43 +11:00
Andrew Tridgell
ac64effc74 AP_Param: allow group entries in any order
this will make the ENABLE flag more useful
2016-01-04 11:14:43 +11:00
Andrew Tridgell
57f580fdfc AP_Param: enable param debug by default 2016-01-04 11:14:43 +11:00
Andrew Tridgell
60af7a6087 AP_Math: removed matrix3 parameter support 2016-01-04 11:14:43 +11:00
Andrew Tridgell
1b8cf84801 AP_Param: allow for up to 512 top level vehicle parameters
this will make life a bit easier for copter
2016-01-04 11:14:43 +11:00
Andrew Tridgell
0831661b3c AP_NavEKF2: mark EK2_ENABLE as an ENABLE parameter 2016-01-04 11:14:42 +11:00
Andrew Tridgell
29cb0dcf2c AP_Param: enable variables to be marked as enable variables
used to hide unused subtrees of variables
2016-01-04 11:14:42 +11:00
Andrew Tridgell
37b2e23322 AP_Param: allow objects containing parameters to be dynamically loaded
this makes it possible for objects containing parameters to be
dynamically loaded.
2016-01-04 11:14:42 +11:00
Andrew Tridgell
2dd8a0af74 HAL_SITL: allow visualisation of quad motor speeds in flightgear 2016-01-04 11:09:27 +11:00
Andrew Tridgell
c3829dfb64 AP_Scheduler: allow for arbitrary loop rates
it turns out 300Hz is pretty useful as it allows for triple EKF on
pixhawk
2016-01-04 08:37:31 +11:00
Andrew Tridgell
27b43f4036 AC_PID: fixed example build warning 2016-01-04 08:22:17 +11:00
Andrew Tridgell
1450f33b51 HAL_SITL: support 16 RC input channels in SITL 2016-01-04 08:22:02 +11:00
Andrew Tridgell
0966398d8d SITL: improved realism of fixed wing sim somewhat
still not good, but a bit better for manual flight
2016-01-04 08:03:46 +11:00
Andrew Tridgell
83c8505b3c HAL_SITL: send state to flightgear viewer 2016-01-04 08:02:37 +11:00
Lucas De Marchi
f3ee7a9a85 AP_AccelCal: use union instead of reference
The current approach to access the same memory location by using a
reference is giving this warning:

	../libraries/AP_AccelCal/AccelCalibrator.cpp: In constructor ‘AccelCalibrator::AccelCalibrator()’:
	../libraries/AP_AccelCal/AccelCalibrator.cpp:34:64: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
	 _param_struct(*reinterpret_cast<struct param_t *>(&_param_array))
									^
	../libraries/AP_AccelCal/AccelCalibrator.cpp: In member function ‘void AccelCalibrator::run_fit(uint8_t, float&)’:
	../libraries/AP_AccelCal/AccelCalibrator.cpp:336:79: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
	     struct param_t &fit_param(*reinterpret_cast<struct param_t *>(&param_array));
                                                                               ^
Using a union allows us to get rid of the warning, make sure the sizes of the
different structs match and have a more elegant solution.
2016-01-02 10:04:16 +11:00
Tom Pittenger
841f34effa AP_Arming: add param for accel error threshold
This is the threshold error to determine inconsistent accelerometers.
2016-01-02 10:01:46 +11:00
Andrew Tridgell
b2745bb545 AP_InertialSensor: we only need peak hold for negative X for now 2016-01-02 09:58:32 +11:00
Tom Pittenger
3aaf2b1d2b AP_InertialSensor: add pos/neg peak detector
new functions that get a filtered min/max accel peaks on each axis with fixed 500ms timeout:
    Vector3f get_accel_peak_hold_pos()
    Vector3f get_accel_peak_hold_neg()

This allows slower mechanisms, such as is_flying, to detect accel spikes which would indicate ground or object impacts. Vibe is too filtered. Independent positive and negative peaks are available
2016-01-02 09:58:31 +11:00
Andrew Tridgell
b052959c61 GCS_MAVLink: re-generated headers 2016-01-02 08:44:49 +11:00
Jonathan Challinger
c2b4235662 GCS_MAVLink: merge mavlink-solo 2016-01-02 08:42:33 +11:00
Jonathan Challinger
41c881cc9e GCS_MAVLink: temporarily remove GIMBAL_ and GOPRO_ messages pending solo sync 2016-01-02 08:42:33 +11:00
Jonathan Challinger
2a3fe35731 GCS_MAVLink: run xmlpretty.py on ardupilotmega.xml 2016-01-02 08:42:33 +11:00
Andrew Tridgell
22873ee687 SITL: reduced drag in plane model 2016-01-01 18:40:22 +11:00
Andrew Tridgell
619a4c0925 SITL: use common dynamics code for QuadPlane 2016-01-01 17:20:30 +11:00
Andrew Tridgell
33998a58ac SITL: prevent aircraft going below ground level 2016-01-01 17:01:23 +11:00
Andrew Tridgell
d425965f6d SITL: expose home yaw to FDMs 2016-01-01 17:00:57 +11:00
Andrew Tridgell
630d4410d4 SITL: removed debug code from QuadPlane 2016-01-01 15:48:56 +11:00
Andrew Tridgell
8a98ce427c SITL: moved to common code for attitude/pos update 2016-01-01 15:12:33 +11:00
Andrew Tridgell
e6555aae6d HAL_SITL: added quadplane model 2016-01-01 14:35:15 +11:00
Andrew Tridgell
d0896a1fb2 HAL_SITL: fixed init of channel 8 out in plane and rover
should be low
2016-01-01 14:35:15 +11:00
Andrew Tridgell
f2c8193f8b SITL: added a QuadPlane model 2016-01-01 14:35:15 +11:00
Andrew Tridgell
6f9e9d761f SITL: move calculations into multicopter frame class
this will enable a QuadPlane model
2016-01-01 14:35:15 +11:00
Andrew Tridgell
c6b6d7137d HAL_SITL: added plane simulator 2016-01-01 12:41:06 +11:00
Andrew Tridgell
16e0a6d7b0 AP_Math: fixed angle between two vector3s 2016-01-01 12:41:05 +11:00
Andrew Tridgell
fcfd11ef53 SITL: very simple fixed wing simulator
useful for debugging
2016-01-01 12:41:05 +11:00
Randy Mackay
bea69521c8 AC_PrecLand: velocity PI controller into parent class 2015-12-31 15:30:33 +09:00
Andrew Tridgell
8e4586b4a2 AP_Param: allow for nested groups without subclassing
this allows for param tables containing other unrelated objects
2015-12-31 15:30:31 +09:00
Tom Pittenger
4e4c1831f0 AP_ADSB: added guided mode handling 2015-12-31 15:36:49 +11:00
Randy Mackay
4e9f82a0e7 Notify: fix parameter description 2015-12-31 11:33:02 +09:00
pepevalbe
0d5e59eaa3 AP_Notify: configurable RGB LED brightness 2015-12-31 11:32:59 +09:00
Lucas De Marchi
180359d6dd AP_Math: fix unit test
For ROTATION_ROLL_90_PITCH_68_YAW_293 consider the angles as 90, 68.8
and 293.3 degrees to pre-calculate rotation. This matches the rotation
matrix used in code.

While at it, check not only the values are close enough but also the
length of the vector.
2015-12-30 20:22:28 -02:00
Lucas De Marchi
ba3325ffd3 AP_Math: rename rotation
The rotations are supposed to follow the name of the enum, in order. The
ROTATION_YAW_293_PITCH_68_ROLL_90 was added with the name of an
intrinsic 321 rotation, but the matrix is actually a 123 rotation,
following the other rotations already present.

Change the name to follow the other names.
2015-12-30 20:22:27 -02:00
Jonathan Challinger
bae16a61e2 AP_InertialSensor: fix segfault 2015-12-29 23:10:56 -08:00
Jonathan Challinger
83d5a6664a AP_Math: minor changes to matrix_alg in response to review 2015-12-29 22:57:21 -08:00
Jonathan Challinger
0a3c2774e9 AP_InertialSensor: fixes in response to review 2015-12-29 22:55:04 -08:00
Jonathan Challinger
24e413c6af AP_AccelCal: fixes in response to review 2015-12-29 22:55:04 -08:00
Jonathan Challinger
660d9e86d5 AP_AccelCal: basic sanity check on fit parameters 2015-12-29 11:00:20 -08:00
Jonathan Challinger
1482614a7d AP_Arming: add accel cal requires reboot 2015-12-29 10:46:35 -08:00
Jonathan Challinger
137ace473d AP_InertialSensor: add accel_cal_requires_reboot 2015-12-29 10:46:35 -08:00
Jonathan Challinger
f6a41a8936 AP_InertialSensor: ensure that accel calibration object isn't allocated more than once 2015-12-29 10:46:35 -08:00
bugobliterator
1a4b4fa85e AP_Math: add inverse matrix test to check if inverse(mat)*mat = I
where I is an identity matrix (a matrix with diagonal elements = 1)
2015-12-29 10:46:35 -08:00
Jonathan Challinger
65915bbe71 StorageManager: fix example build 2015-12-29 10:46:35 -08:00
Jonathan Challinger
027e622a3c RC_Channel: fix example build 2015-12-29 10:46:35 -08:00
Jonathan Challinger
2c0657f326 GCS_MAVLink: fix example build 2015-12-29 10:46:35 -08:00
Jonathan Challinger
b85631bec3 DataFlash: fix example build 2015-12-29 10:46:35 -08:00
Jonathan Challinger
94543d55bb AP_Scheduler: fix example build 2015-12-29 10:46:35 -08:00
Jonathan Challinger
780d0de4bb AP_RangeFinder: fix example build 2015-12-29 10:46:35 -08:00
Jonathan Challinger
b0de3957ea AP_OpticalFlow: fix example build 2015-12-29 10:46:35 -08:00
Jonathan Challinger
99636b3e8b AP_Notify: fix example build 2015-12-29 10:46:35 -08:00
Jonathan Challinger
62701448ca AP_Mount: fix example build 2015-12-29 10:46:35 -08:00
Jonathan Challinger
b803907163 AP_Motors: fix example build 2015-12-29 10:46:35 -08:00
Jonathan Challinger
30a563044e AP_Mission: fix example build 2015-12-29 10:46:35 -08:00
Jonathan Challinger
f376510524 AP_HAL_PX4: fix example build 2015-12-29 10:46:35 -08:00
Jonathan Challinger
ac152b564f AP_HAL_FLYMAPLE: fix example build 2015-12-29 10:46:35 -08:00
Jonathan Challinger
d7639ce03a AP_HAL: fix example build 2015-12-29 10:46:35 -08:00
Jonathan Challinger
04dc7130f5 AP_GPS: fix example build 2015-12-29 10:46:35 -08:00
Jonathan Challinger
9b5644fdb6 AP_Compass: fix example build 2015-12-29 10:46:35 -08:00
Jonathan Challinger
a3789542cd AP_BattMonitor: fix example build 2015-12-29 10:46:35 -08:00
Jonathan Challinger
dcfc95fadf AP_Baro: fix example build 2015-12-29 10:46:35 -08:00
Jonathan Challinger
a1c7b32387 AP_Airspeed: fix example build 2015-12-29 10:46:35 -08:00
Jonathan Challinger
5cb7331095 AP_AHRS: fix example build 2015-12-29 10:46:35 -08:00
Jonathan Challinger
9e6be648b9 AC_PID: fix example build 2015-12-29 10:46:35 -08:00
bugobliterator
fe62a049bd AP_Math: implement LU decomposition based matrix inverse
Replaces previous matlab generated code, which was giving imprecise results
2015-12-29 10:46:34 -08:00
Siddharth Bharat Purohit
a0c3cbffee AP_Math: add inverse matrix test example
fix example build
2015-12-29 10:46:34 -08:00
Siddharth Bharat Purohit
5af0cc8eaf AP_Math: add inverse rotate example function 2015-12-29 10:46:34 -08:00
Jonathan Challinger
7ed8b3814f AP_Math: add rotate_inverse to Vector3 2015-12-29 10:46:34 -08:00
Jonathan Challinger
492223cb84 AP_InertialSensor: support AP_AccelCal 2015-12-29 10:46:34 -08:00
bugobliterator
d24b5023f4 AP_AccelCal: Add separate lib for accel calibration 2015-12-29 10:46:34 -08:00
Andrew Tridgell
f70d9d26ba HAL_QURT: fixed README formatting 2015-12-29 19:23:14 +11:00
Andrew Tridgell
70877ebd50 HAL_QURT: fixed open of new storage file 2015-12-29 19:20:51 +11:00
Andrew Tridgell
aae7dd952c HAL_QURT: document command line options 2015-12-29 19:15:47 +11:00
Andrew Tridgell
f832f29bfb HAL_QURT: allow cmdline to specify UART, RCin and RCout paths 2015-12-29 19:12:17 +11:00
Andrew Tridgell
dafc9b4c6b AP_HAL: allow getopt_cpp on QURT
avoid using stderr
2015-12-29 19:10:46 +11:00
Andrew Tridgell
ea1e3f4928 HAL_QURT: pass argc and argv into main thread 2015-12-29 18:53:05 +11:00
Andrew Tridgell
bd2f548130 AP_HAL: allow argc and argc on QURT 2015-12-29 18:52:17 +11:00
Lucas De Marchi
97022a4161 AP_HAL: RingBuffer: fix macro expansion
Fix warning that reveals a real bug:

In file included from libraries/AP_HAL_Linux/UARTDriver.cpp:25:0:
libraries/AP_HAL_Linux/UARTDriver.cpp: In member function 'virtual bool Linux::UARTDriver::tx_pending()':
libraries/AP_HAL/utility/RingBuffer.h:21:35: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
 #define BUF_EMPTY(buf) buf##_head == buf##_tail
                                   ^
libraries/AP_HAL_Linux/UARTDriver.cpp:355:13: note: in expansion of macro 'BUF_EMPTY'
     return !BUF_EMPTY(_writebuf);

The problem is when there's a ! operator: without the parenthesis we would actually be doing

    return !_write_buf_head == _write_buf_tail

which is not what we want.
2015-12-28 21:50:27 -02:00
Andrew Tridgell
fe8070bd51 DataFlash: move lock to protect just buffer IO 2015-12-29 09:10:28 +11:00
Lucas De Marchi
1a0f613a0f AP_Curve: remove unused library 2015-12-28 10:23:23 -02:00
Lucas De Marchi
8d252955f5 AP_Motors: don't link unused AP_Curve library 2015-12-28 10:23:23 -02:00
Lucas De Marchi
326e74f64f AP_Mission: don't link unused AP_Curve library 2015-12-28 10:23:23 -02:00
Lucas De Marchi
5d3a519277 APM_PI: remove unused library 2015-12-28 10:23:23 -02:00
Lucas De Marchi
8cee02cde7 AP_PerfMon: remove unused library 2015-12-28 10:23:23 -02:00
Jonathan Challinger
a2999ece54 AP_AHRS_NavEKF: add setTakeoffExpected, setTouchdownExpected 2015-12-28 13:51:24 +09:00
Andrew Tridgell
c90d7dd86e AP_HAL: fixed vprintf segfault 2015-12-28 08:44:40 +11:00
Andrew Tridgell
fa2a39f6c6 HAL_QURT: small cleanups
thanks to Lucas for finding these
2015-12-28 06:42:11 +11:00
Julien BERAUD
e46f23f538 RCOutput_Bebop: Increase max_rpm on Bebop 2
Bebop 2 can go as high as 12200 rpm. Use get_hw_arm32 method to see
if we are on a bebop or bebop 2
2015-12-27 16:11:36 -02:00
Julien BERAUD
b6f51233db AP_HAL_Linux: Make RPI get_hw method public
Valid also on Bebop
2015-12-27 16:11:36 -02:00
Julien BERAUD
cadef09542 AP_HAL_Linux: Fix comment and panic on Bebop 2015-12-27 16:11:36 -02:00
Lucas De Marchi
3a8bd7b829 AP_Progmem: remove unused library 2015-12-27 15:58:12 -02:00
Lucas De Marchi
a096703b06 Global: don't link with AP_Progmem
AP_Progmem is not used anymore.
2015-12-27 15:58:12 -02:00
Lucas De Marchi
52ef8c10a5 AP_Param: stop using Progmem.h 2015-12-27 15:58:12 -02:00
Lucas De Marchi
360855f109 StorageManager: stop using Progmem.h 2015-12-27 15:58:12 -02:00
Lucas De Marchi
5f26c951d8 GCS_MAVLink: stop using Progmem.h 2015-12-27 15:58:12 -02:00
Lucas De Marchi
5d07e5bdbf DataFlash: stop using Progmem.h 2015-12-27 15:58:12 -02:00
Lucas De Marchi
eb9fd96d5c AP_Scheduler: remove trailing whitespace 2015-12-27 15:58:12 -02:00
Lucas De Marchi
3375b6b01c AP_Scheduler: stop using Progmem.h 2015-12-27 15:58:12 -02:00
Lucas De Marchi
25c289b74c AP_Menu: stop using Progmem.h 2015-12-27 15:58:12 -02:00
Lucas De Marchi
502077d763 AP_Math: stop using Progmem.h 2015-12-27 15:58:12 -02:00
Lucas De Marchi
520b0384fd AP_HAL: remove unused in_progmem flag to print_vprintf 2015-12-27 15:58:12 -02:00
Lucas De Marchi
8e0c125f56 AP_HAL: print_vprintf: follow coding style
- Use 4 spaces to indent
 - Add braces to control statements
 - Don't use tabs
2015-12-27 15:58:12 -02:00
Lucas De Marchi
c35730058a AP_HAL: print_vprintf: stop using Progmem.h
Remove the unused support to data from progmem, including the unused %S
format specifier.
2015-12-27 15:58:12 -02:00
Lucas De Marchi
5bb4e3eda9 AP_GPS: stop using Progmem.h
Besides the trivial convertions, while reading
initblob_state[instance].blob we need to be sure to read only one byte
like we were before.
2015-12-27 15:58:12 -02:00
Lucas De Marchi
88319f52f7 AP_Declination: remove line continuation slashes
These are not necessary and only clutter the code.
2015-12-27 15:58:12 -02:00
Lucas De Marchi
3ae0082f52 AP_Declination: stop using Progmem.h
Since the headers were re-ordered we also had to add inttypes.h to
AP_Declination.h following a include-what-you-use approach.
2015-12-27 15:58:12 -02:00
Lucas De Marchi
cfb5bbeb9f APM_Control: stop using Progmem.h 2015-12-27 15:58:12 -02:00
Lucas De Marchi
29ed01189d AP_HAL: ftoa_engine: replace tabs with spaces 2015-12-27 15:58:12 -02:00
Lucas De Marchi
e751d632e6 AP_HAL: ftoa_engine: stop using Progmem.h 2015-12-27 15:58:12 -02:00
Andrew Tridgell
6a5c5969fa AP_AHRS: fixed example build 2015-12-27 14:57:32 +09:00
Andrew Tridgell
3fb0b8f69d AP_InertialSensor: fixed example build 2015-12-27 14:57:30 +09:00
Andrew Tridgell
23cef70846 AP_NavEKF2: use get_loop_delta_t() from INS 2015-12-27 14:57:17 +09:00
Andrew Tridgell
28a684ea03 AP_NavEKF: use get_loop_delta_t() from INS 2015-12-27 14:57:14 +09:00
Andrew Tridgell
17fc58f3cd AP_InertialSensor: re-work for more flexible main loop rates 2015-12-27 14:57:12 +09:00
Andrew Tridgell
93ef881109 AP_InertialSensor: added get_loop_delta_t() API 2015-12-27 14:57:10 +09:00
Andrew Tridgell
1b1be7e4a2 AP_Scheduler: switch to Hz based scheduler config 2015-12-27 14:57:06 +09:00
Andrew Tridgell
6bc19cd44c HAL_QURT: added README.md 2015-12-27 16:21:26 +11:00
Andrew Tridgell
bc8ee8af36 AP_GPS: added QURT GPS 2015-12-27 16:21:26 +11:00
Andrew Tridgell
b967140572 DataFlash: enable minimal file mode
This adds a "minimal" dataflash mode with a board specific macro. The
QURT port uses this to avoid problematic system calls that are buggy
in the QURT RTOS

With some pending updates to QURT we may be able to remove some (or
all) of this
2015-12-27 16:21:26 +11:00
Andrew Tridgell
a042845da8 AP_NavEKF: avoid an optimiser bug in clang 2015-12-27 16:21:26 +11:00
Andrew Tridgell
493ab96b29 AP_Compass: added QURT driver 2015-12-27 16:21:26 +11:00
Andrew Tridgell
6639c23685 AP_InertialSensor: added QURT driver 2015-12-27 16:21:26 +11:00
Andrew Tridgell
ff44a63007 AP_Baro: added QURT driver 2015-12-27 16:21:25 +11:00
Andrew Tridgell
285294a9cd AP_Common: added debug code for qurt
and disable some warnings for clang++ on qurt
2015-12-27 16:21:25 +11:00
Andrew Tridgell
7c431b40f2 AP_HAL: enable HAL_QURT 2015-12-27 16:21:25 +11:00
Andrew Tridgell
0816937ab1 HAL_QURT: initial implementation
this provides RC onput, RC output, scheduling, storage, UARTs and all
necessary support routines to fly ArduPilot on QURT
2015-12-27 16:12:28 +11:00
Andrew Tridgell
3b546bb242 AP_Compass: added qflight driver 2015-12-27 16:12:27 +11:00
Andrew Tridgell
1f4e503d91 AP_Baro: added qflight driver 2015-12-27 16:12:27 +11:00
Andrew Tridgell
28230556bb AP_InertialSensor: added qflight driver 2015-12-27 16:12:27 +11:00
Andrew Tridgell
0bbf4362e0 HAL_Linux: added qflight README.md 2015-12-27 16:12:27 +11:00
Andrew Tridgell
dc8a3bbf92 HAL_Linux: added qflight board subtype 2015-12-27 16:12:27 +11:00
Andrew Tridgell
cfd54c5683 AP_HAL: moved dsm implementation into AP_HAL/utility 2015-12-27 16:12:27 +11:00
Andrew Tridgell
fec9ffd1a0 AP_HAL: support UARTs on timer thread
This adds a macro for boards that need to have UARTs on the timer
thread instead of their own thread. This is needed for the qflight
port due to restrictions in the RPC API
2015-12-27 16:12:27 +11:00
Andrew Tridgell
ac1e75ae77 AP_HAL: added qflight linux subtype 2015-12-27 16:12:27 +11:00
Andrew Tridgell
e1c890eb58 RC_Channel: added RC_UART example
useful for UART -> ESCs
2015-12-27 16:12:27 +11:00
Don Gagne
605fedc1c0 AP_TECS: fix invalid Range meta data 2015-12-27 16:10:44 +11:00
Don Gagne
34d5dd0257 AP_NavEKF: fix invalid Range meta data 2015-12-27 16:10:44 +11:00
Don Gagne
8573245963 AP_NavEKF2: fix invalid Range meta data 2015-12-27 16:10:44 +11:00
Don Gagne
ed7cd8d3f4 AP_Motors: fix invalid Range meta data 2015-12-27 16:10:44 +11:00
Don Gagne
e891ae8a89 AP_L1_Control: fix invalid Range meta data 2015-12-27 16:10:44 +11:00
Don Gagne
47586dae07 AP_InertialSensor: fix invalid Range meta data 2015-12-27 16:10:44 +11:00
Don Gagne
2b1bc22b2a AP_BoardConfig: fix invalid Range meta data 2015-12-27 16:10:44 +11:00
Don Gagne
964d02065a Mount: add missing RebootRequired to param description 2015-12-26 10:06:14 +09:00
Jonathan Challinger
bde9a9421d AP_Param: panic on failure to load defaults file 2015-12-24 14:40:00 +11:00
Julien BERAUD
0ffba07ec8 AP_HAL: Set default params for Bebop 2015-12-23 10:24:04 -02:00
Randy Mackay
86bb03aa79 AC_AttControl: use ahrs get_rotation_body_to_ned
ahrs.get_dcm_matrix renamed to ahrs.get_rotation_body_to_ned
2015-12-23 11:38:21 +09:00
Jonathan Challinger
46e6ff3ca9 AC_AttitudeControl: modify comment on kinematic correction feedforward 2015-12-23 11:38:19 +09:00
Jonathan Challinger
829d6037fc AC_AttitudeControl: convert euler rates to angular velocity using the correct attitude 2015-12-23 11:38:16 +09:00
Jonathan Challinger
ae3357baee AC_AttitudeControl: rotate angular velocity feedforward into vehicle frame 2015-12-23 11:38:14 +09:00
Jonathan Challinger
3d4bd92b48 AC_AttitudeControl: add helper functions to retrieve rotation matrices 2015-12-23 11:38:12 +09:00
Michael du Breuil
52666232ed AP_Arming: Allow arming without the hardware safety switch having been pressed
Added an enum to the check type that allows for arming without the hardware switch having been enabled
2015-12-21 17:48:29 +11:00
Peter Barker
2f1297f30c DataFlash_File: Check return values of lseek 2015-12-21 16:07:23 +11:00
Peter Barker
ce84ba049f DataFlash_File: protect against fopen failing 2015-12-21 16:07:23 +11:00
Peter Barker
15265a45ed DataFlash_File: check fname before using it 2015-12-21 16:07:23 +11:00
DonLakeFlyer
74902012fd GCS_MAVLink: better mission errors 2015-12-21 16:02:23 +11:00
DonLakeFlyer
7cd3d8bfdc AP_Mission: better mission errors 2015-12-21 16:02:23 +11:00
Aaron Wang Shi
ac08eece84 AP_HAL_Linux: instantiate BH hat objects 2015-12-21 15:54:31 +11:00
Aaron Wang Shi
4d7db9bba3 AP_HAL_Linux: add ifdefs for BH hat like other RPI-based boards 2015-12-21 15:54:31 +11:00
Aaron Wang Shi
a712e9572f AP_HAL_Linux: instatiate SPI device for BH hat 2015-12-21 15:54:31 +11:00
Aaron Wang Shi
5d5e75c8ad AP_HAL_Linux: RCOutput_PCA9685 add new address for BH hat 2015-12-21 15:54:31 +11:00
Aaron Wang Shi
f437e7a67c AP_HAL_Linux: add GPIO definitions for BH hat 2015-12-21 15:54:31 +11:00
Aaron Wang Shi
8cca0beba9 AP_HAL_Linux: support PWM input for BH hat
Support 8 PWM channels as RCInput.
2015-12-21 15:54:31 +11:00
Aaron Wang Shi
800c142ac0 BH: Support UBLOX GPS M8N 2015-12-21 15:54:30 +11:00
Lucas De Marchi
766252cd87 AP_Compass: don't use ternary operator in place of if/else 2015-12-21 15:54:30 +11:00
Aaron Wang Shi
5a085b1610 AP_Compass: add support to BH hat 2015-12-21 15:54:30 +11:00
Aaron Wang Shi
3a31970056 AP_InertialSensor: add support to BH hat
- MPU6050 I2C for BH v0.1
    - MPU9250 SPI for BH v0.2
2015-12-21 15:54:30 +11:00
Aaron Wang Shi
fc2e810fb2 AP_Notify: add 1 RGB and board LEDs to BH hat 2015-12-21 15:54:30 +11:00
Aaron Wang Shi
c7a77af47f AP_HAL: add BH HAT board info 2015-12-21 15:54:30 +11:00
Andrew Tridgell
05e04ee1a7 HAL_SITL: added semaphore support 2015-12-21 07:38:30 +11:00
Andrew Tridgell
025e4edd17 DataFlash: fixed warning 2015-12-20 17:55:40 +11:00
Andrew Tridgell
a73039d515 HAL_Empty: use 5V voltage for HAL_EMPTY
this makes bringup easier for new boards (allows arming checks to
pass)
2015-12-20 17:55:40 +11:00
Andrew Tridgell
ef83f39029 AP_Baro: renamed _C* vars to avoid conflict with qurt 2015-12-20 17:55:39 +11:00
Andrew Tridgell
fbacb4c01f AC_AttitudeControl: fixed M_PI -> M_PI_F 2015-12-20 17:55:39 +11:00
Andrew Tridgell
d24f6f4050 AP_NavEKF: fixed static const bug 2015-12-20 17:55:39 +11:00
Andrew Tridgell
02d7867d79 DataFlash: added locking for multi-thread logging support 2015-12-20 17:55:39 +11:00
Andrew Tridgell
c77e3c89c5 HAL_Linux: implement new_semaphore() 2015-12-20 17:55:39 +11:00
Andrew Tridgell
02bee8810d HAL_PX4: added Semaphore support 2015-12-20 17:55:39 +11:00
Andrew Tridgell
9d4b31ca3c AP_HAL: added a new_semaphore() interface to Util 2015-12-20 17:55:39 +11:00
Andrew Tridgell
9fe25f9c71 HAL_Empty: fixed I2CDriver for use in Linux subtypes 2015-12-20 16:52:20 +11:00
Andrew Tridgell
ec6a679482 AP_HAL: added ByteBuffer and ObjectBuffer in RingBuffer
much better API than old macros
2015-12-20 07:33:54 +11:00
Tom Pittenger
cf170b2aa7 GCS_MAVLink: generated files 2015-12-19 14:36:16 +09:00
Tom Pittenger
7af717fead GCS_MAVLink: ADSB msg bug: vert_velocity is supposed to be signed
- bug was introduced when changing from floating point to fixed point format
2015-12-19 14:36:13 +09:00
Yang Liu
f0f3986f46 AP_InertialNav: Typo correction in comment 2015-12-19 10:11:35 +09:00
Andre Kjellstrup
6da7e76990 AP_Camera: Camera options for better camera control
All on one because they would not pass autotest if split up.
2015-12-18 18:16:11 +11:00
Jonathan Challinger
b0f58248a5 AP_TECS: reflect renamed function in AP_AHRS 2015-12-18 18:08:37 +11:00
Jonathan Challinger
63caca1d3f AP_Mount: reflect renamed function in AP_AHRS 2015-12-18 18:08:37 +11:00
Jonathan Challinger
ee8090e25f AC_AttitudeControl: reflect renamed function in AP_AHRS 2015-12-18 18:08:37 +11:00
Jonathan Challinger
6682b27456 AP_AHRS: rename get_dcm_matrix to get_rotation_body_to_ned 2015-12-18 18:08:37 +11:00
Lucas De Marchi
2a953c4e35 AP_HAL_Linux: add missing casts
These errors were all over the VideoIn.cpp file:

libraries/AP_HAL_Linux/VideoIn.cpp: In member function 'bool Linux::VideoIn::allocate_buffers(uint32_t)':
libraries/AP_HAL_Linux/VideoIn.cpp:107:15: error: invalid conversion from 'uint32_t {aka unsigned int}' to 'v4l2_memory' [-fpermissive]
     rb.memory = _memtype;
               ^
libraries/AP_HAL_Linux/VideoIn.cpp: In member function 'bool Linux::VideoIn::set_format(uint32_t*, uint32_t*, uint32_t*, uint32_t*, uint32_t*)':
libraries/AP_HAL_Linux/VideoIn.cpp:169:14: error: invalid conversion from 'int' to 'v4l2_buf_type' [-fpermissive]
     fmt.type = V4L2_CAP_VIDEO_CAPTURE;
              ^

Add proper casts to fix the compilation.
2015-12-18 17:56:06 +11:00
Lucas De Marchi
ba5dd88a0b AP_HAL_Linux: move mt9v117 patches inside class
Let it be a static const member instead of defining it in a header. The
problem with the header is that it will generate conflicting symbols
when more than 1 compilation unit includes it.
2015-12-18 17:56:06 +11:00
Julien BERAUD
a32738fd5f AP_OpticalFlow: Update test declaration
Declare a dummy vehicle to get a dummy ahrs. No problem since this code
is not used apart from compilation. Needed to declare an optical flow.
2015-12-18 17:56:06 +11:00
Julien BERAUD
780104dc9c GCS_MAVLink: Fix build
Optical Flow definition is needed
2015-12-18 17:56:06 +11:00
Julien BERAUD
924a94633d AP_AHRS: Fix build
Due to interdependancy between optical flow and AHRS, it is not possible
to include full class definition which rely on each other
2015-12-18 17:56:06 +11:00
Julien BERAUD
6f55f3734c AP_HAL_Linux: Add optflow declaration
Add an empty driver for boards that are not bebop
2015-12-18 17:56:05 +11:00
Lucas De Marchi
8b21dc9b22 AP_OpticalFlow: follow coding style
- use pragma once
 - sort headers
 - add missing header - always include what you are using in the header
2015-12-18 17:56:05 +11:00
Julien BERAUD
c5cca02bc8 AP_OpticalFlow: Add support for onboard optflow
Onboard Optical flow needs to have access to the ahrs to get
correct gyro values.
Therefore the constructor takes the ahrs as a param like it is done
for other classes that need to have access to these datas
2015-12-18 17:56:05 +11:00
Julien BERAUD
eccef24fa7 AP_HAL: Add optical flow params for bebop
Params that are necessary for optical flow
2015-12-18 17:56:05 +11:00
Julien BERAUD
f13cd00e59 AP_HAL_Linux: Update namespace and private
Add new interfaces for optical flow
2015-12-18 17:56:05 +11:00
Lucas De Marchi
83c50e12ca AP_HAL_Linux: OpticalFlow_Onboard: follow coding style
- Remove commented out defines
 - Sort headers
 - Remove ifdef for HAL_BOARD_SUBTYPE_LINUX_BEBOP inside the same ifdef
 - Use AP_HAL::panic() instead of perror
 - AP_HAL::panic() message doesn't take a '\n' and there's no return
   statement after a call to this function
 - Fix pointer placement
 - Use pragma once
 - Don't initialize members to 0, it's already the default behavior of
   our custom allocator
2015-12-18 17:56:05 +11:00
Julien BERAUD
ea89308d90 AP_HAL_Linux: Add Onboard Optical Flow interface
Implementation of AP_HAL::OpticalFlow for an embedded camera sensor

There is the possibility to record video and also the gyro datas in order
to process the video off-board and debug possible issues.
2015-12-18 17:56:05 +11:00
Lucas De Marchi
db5f49f49f AP_HAL_Linux: Flow_PX4: follow coding style
- Replace tabs with spaces
 - Sort headers
 - Fix curly braces placement
 - Use pragma once
2015-12-18 17:56:05 +11:00
Julien BERAUD
0476e698af AP_HAL_Linux: Flow_PX4 interface
Implementation of the PX4 flow algorithm for ardupilot.
Based on the original PX4 Flow code, it has diverged a lot.
I have kept the license header since it is required.
I have removed all the unused and dead code on current implementation,
modified the code to make it clearer, re-indented it and changed
the way some params are calculated. It has been tested on PC and
on board and showed results that I assumed were OK. No optical flow
Loiter tests have been undertaken since it requires a Sonar which will
be added soon.

Limitations :
Some parts were written in ARM assembly and I rewrote them very naively
to get them to be more easily portable. A simple optimisation would be
to re-introduce assembly code for ARM as a separate asm file with
methods for fixed resolutions that would reduce a lot the amount of
calculation and memory read/writes. Then writing a version in NEON
assembly would even be more optimised and then maybe an Intel version.
2015-12-18 17:56:05 +11:00
Lucas De Marchi
c75704bde3 AP_HAL_Linux: VideoIn: follow coding style and minor fixes
- No need to if/else if just returning
 - Sort includes
 - Fix missing space in log message
 - When closing the fd, set it to -1. It's better to later fail the
   operation than to operate on another random file descriptor
 - Add some spaces to improve readability
 - Use pragma once
 - Do not initialize members to zero, it's already the behavior for our
   custom allocator
2015-12-18 17:56:05 +11:00
Julien BERAUD
25df4d03ff AP_HAL_Linux: Add support for Video Input
VideoIn class is created that allows to setup a v4l2 interface
and capture buffers. I is based on yavta utility by Laurent Pinchart
and has been tested only on the bebop, though yavta works on any linux
platform.
2015-12-18 17:56:04 +11:00
Lucas De Marchi
24d20f89c4 AP_HAL_Linux: make CameraSensor follow coding style
- Replace tabs with spaces
 - Sort includes
 - No need to ifdef Linux inside AP_HAL_Linux
 - Use early returns on error rather than a chain o if/else
 - Use pragma once
 - No need to initialize class members to 0, it's already our default
   behavior
2015-12-18 17:56:04 +11:00
Julien BERAUD
c84d9bf702 AP_HAL_Linux: Add support for mt9v117 camera
The camera sensor is connected on i2c bus for config
and on a parallel bus on the main SoC.
Currently, the i2c driver remains userland, but this is intended to
change in the future. The v4l2_subdev part is the way to go in the future
and it is the mainline way of configuring i2c camera sensors on Linux.
Currently only the max framerate is supported because it is the one that
is to be used on the bebop optical flow.
2015-12-18 17:56:04 +11:00
Julien BERAUD
736f78a7a2 AP_HAL_VRBRAIN: add empty optical flow
No onboard optical flow on VRBRAIN
2015-12-18 17:56:04 +11:00
Julien BERAUD
d8bcb36530 AP_HAL_SITL: add empty optical flow
No embedded optical flow on sitl
2015-12-18 17:56:04 +11:00
Julien BERAUD
c0f65ff6e1 AP_HAL_PX4: add empty optical flow
No onboard optical flow on PX4
2015-12-18 17:56:04 +11:00
Lucas De Marchi
0e29a7193a AP_HAL_FLYMAPLE: replace tabs with spaces in HAL_FLYMAPLE_Class 2015-12-18 17:56:04 +11:00
Lucas De Marchi
d08d7ce125 AP_HAL_FLYMAPLE: fix indentation 2015-12-18 17:56:04 +11:00
Julien BERAUD
c114ad2b95 AP_HAL_FLYMAPLE: add empty optflow driver
no embedded optical flow on flymaple
2015-12-18 17:56:04 +11:00
Lucas De Marchi
e825eb12f5 AP_HAL_Empty: follow coding style
- Add some spaces
 - Use pragma once
 - Remove ; from method implementation
 - Remove unneeded return
2015-12-18 17:56:04 +11:00
Lucas De Marchi
b3a751a199 AP_HAL_Empty: sort include headers 2015-12-18 17:56:03 +11:00
Julien BERAUD
d14f4104ea AP_HAL_Empty: add support for OpticalFlow
Void driver
2015-12-18 17:56:03 +11:00
Lucas De Marchi
c7668479bb AP_HAL: follow coding style 2015-12-18 17:56:03 +11:00
Julien BERAUD
2b681f2f13 AP_HAL: Add support for an Optflow driver
This is meant to be used for onboard optical flow
2015-12-18 17:56:03 +11:00
Tom Pittenger
d003e24189 AP_ADSB: fix unit conversion 2015-12-18 13:49:47 +09:00
José Roberto de Souza
63e1d0753e AP_Notify: Add a new RGBLed implementation that works over RCOutput
To be used in boards that uses the same PWM chip to generate signal to
control motors and the status led.
2015-12-16 08:18:17 +11:00
José Roberto de Souza
d74bd533c8 AP_Math: Add function to convert frequency to/from microseconds 2015-12-16 08:18:17 +11:00
José Roberto de Souza
38575dd87a AP_Math: Fix parameter name in nsec_to_hz() 2015-12-16 08:18:17 +11:00
Julien BERAUD
a27d7f8a93 AP_InertialSensor_MPU6000: Fix FIFO reset
Change the sequence. Previous sequence was sometimes causing failure
to initialize the IMU.
2015-12-16 08:16:10 +11:00
Andrew Tridgell
0a36503742 HAL_Linux: fixed a bug with UDP packetisation
this fixes a bug where we would send UDP MAVLink packets larger than 300 bytes
2015-12-14 18:27:11 +11:00
Jonathan Challinger
0a701088d4 AP_Math: fix bug in Quaternion::operator*= 2015-12-14 11:15:33 +09:00
Peter Barker
326e68544c DataFlash: remove unused functions 2015-12-10 10:45:51 +09:00
Julien BERAUD
bbf146197c RCOutput_Bebop : Update motor order
Newer esc firmware versions on bebop 1 and all the versions on bebop 2
have a different order for the motors in the i2c frame sent to the
esc contoller. This commit adds support for both versions by reading
the firmware version of the esc, using GET_INFO frame
2015-12-09 20:48:26 +09:00
Randy Mackay
c8661f804f AC_AttControl: reduce compiler warnings by fixing member init order
Also increased _dt's default to 400hz (no functional change)
2015-12-09 20:04:42 +09:00
Randy Mackay
02eda4dcab AC_AttControl: remove comment, fix formatting 2015-12-09 20:04:32 +09:00
Jonathan Challinger
3c4d226b64 AC_WPNav: call renamed functions in AC_AttitudeControl 2015-12-09 19:58:50 +09:00
Jonathan Challinger
e8345fbaab AC_AttitudeControl: rename getters for attitude target and attitude error 2015-12-09 19:58:48 +09:00
Jonathan Challinger
3a06edcee3 AC_AttitudeControl: rename local variable to match naming convention 2015-12-09 19:58:46 +09:00
Jonathan Challinger
846ee7d2af AC_AttitudeControl: fix regression in angular velocity controller 2015-12-09 19:58:45 +09:00
Jonathan Challinger
b8223771d3 AC_AttitudeControl: properly protect sqrt_controller from nonpositive acceleration limits 2015-12-09 19:58:44 +09:00
Jonathan Challinger
162d2a9112 AC_AttitudeControl: naming changes in response to Leonard's review 2015-12-09 19:58:42 +09:00
Jonathan Challinger
a48f201a04 AC_AttitudeControl: comment changes in response to Paul's review 2015-12-09 19:58:41 +09:00
Jonathan Challinger
0baf86c485 AC_AttitudeControl: fixup more names 2015-12-09 19:58:39 +09:00
Jonathan Challinger
41e580e53a AC_AttitudeControl: add input_att_quat_bf_ang_vel and use for ACRO 2015-12-09 19:58:38 +09:00
Jonathan Challinger
5919e95635 AC_AttitudeControl: add input_ prefix to input shaper functions 2015-12-09 19:58:36 +09:00
Jonathan Challinger
bba360ea2b AC_AttitudeControl: correct bugs found in review 2015-12-09 19:58:35 +09:00
Jonathan Challinger
9208003aab AC_AttitudeControl: remove unused variable 2015-12-09 19:58:34 +09:00
Jonathan Challinger
f8c709478a AC_AttitudeControl: quaternion acro controller 2015-12-09 19:58:33 +09:00
Jonathan Challinger
8b886bc479 AC_AttitudeControl: minor comment changes and reorganization 2015-12-09 19:58:32 +09:00
Jonathan Challinger
edda7e4e1e AC_AttitudeControl: keep _att_target_euler_deriv_rads updated in euler_angle_roll_pitch_yaw 2015-12-09 19:58:31 +09:00
Jonathan Challinger
1afab89991 AC_AttitudeControl: extensive renaming and recommenting 2015-12-09 19:58:29 +09:00
Jonathan Challinger
06c8457efd AC_AttitudeControl: rename and modify frame_conversion functions to follow conventions 2015-12-09 19:58:27 +09:00
Jonathan Challinger
7330de86e5 AC_AttitudeControl: change internals to use radians instead of centidegrees 2015-12-09 19:58:26 +09:00
Jonathan Challinger
fff275fd99 AP_Math: add wrap_2PI 2015-12-09 19:58:25 +09:00
Tom Pittenger
37054d9571 SITL: update units for new adsb mavlink msg 2015-12-09 14:36:30 +11:00
Tom Pittenger
87fccce9e2 AP_ADSB: update units for new mavlink msg 2015-12-09 14:36:30 +11:00
Tom Pittenger
40a84f0589 GCS_MAVLink: recompiled common.xml for adsb 2015-12-09 14:36:29 +11:00
Tom Pittenger
0026b56f0a GCS_MAVLink: updated adsb mavlink msg - remove floats
- convert altitude from float m/s to int32 mm/s
- convert velocities from float m/s to uint16 cm/s
2015-12-09 14:36:29 +11:00
Tom Pittenger
decac5cb15 AP_ADSB: delete furthest when buffer is full
- added lowest/highest_threat tracking. This is currently defined as 2D distance. Room for improvement to make it 3D and be flight vector based instead of distance
- when trying to add a vehicle but  the buffer is full, overwrite the lowest_threat/furthest
- added basic THREAT enum of high/low which means in or our of the 200m radius. Room for improvement here.
2015-12-09 14:35:20 +11:00
Tom Pittenger
7236b48518 SITL: compiler warning: double to float demotion
- replace atof() with strtof() for the correct return time
2015-12-08 14:54:58 +09:00
Tom Pittenger
48ae0d645d AP_HAL_SITL: compiler warning: float to double promotion
- replace atof() with strtof() for the correct return time
2015-12-08 14:54:43 +09:00
Lucas De Marchi
4f012b2b32 AP_HAL_Empty: sort namespace classes 2015-12-08 11:12:14 +11:00
Lucas De Marchi
a9def97344 AP_HAL_VRBRAIN: rename AP_HAL_Empty instances 2015-12-08 11:12:14 +11:00
Lucas De Marchi
c72f812944 AP_HAL_SITL: rename AP_HAL_Empty instances 2015-12-08 11:12:14 +11:00
Lucas De Marchi
503533c6fe AP_HAL_PX4: rename AP_HAL_Empty instances 2015-12-08 11:12:14 +11:00
Lucas De Marchi
6011eefb55 AP_HAL_Linux: rename AP_HAL_Empty instances 2015-12-08 11:12:14 +11:00
Lucas De Marchi
2ffb08b9ca AP_HAL_Empty: remove prefix from classes
Like was done for AP_HAL_Linux in 2ac96b9 ("AP_HAL_Linux: remove prefix
from AP_HAL_Linux classes"), remove the "Empty" prefix from class names
since we are already inside the Empty namespace.
2015-12-08 11:12:14 +11:00
Lucas De Marchi
f69208d47d AP_HAL: remove state leftover from SPIDeviceDriver
This was previously used to allow to save a state in a SPIDriver so we
could synchronize the initialization of AP_Compass and
AP_InertialSensor.

It was only used by MPU9250 and is not used anymore since the move to
AuxiliaryBus initialization and it's not used anymore since c3dae6f
("AP_InertialSensor: MPU9250: Remove methods not used anymore")
2015-12-08 11:10:23 +11:00
Lucas De Marchi
27dafa8f1b AP_HAL_Linux: remove state leftover from SPIDeviceDriver
This was previously used to allow to save a state in a SPIDriver so we
could synchronize the initialization of AP_Compass and
AP_InertialSensor.

It was only used by MPU9250 and is not used anymore since the move to
AuxiliaryBus initialization and it's not used anymore since c3dae6f
("AP_InertialSensor: MPU9250: Remove methods not used anymore")
2015-12-08 11:10:23 +11:00
Peter Barker
7900359fac DataFlash: LOG_FILE_BUFSIZE sets buffer size for DataFlash_File 2015-12-08 10:59:57 +11:00
Tom Pittenger
c118130dda DataFlash: fixed mispelling
@param label was different than everywhere else that did not use plurl
2015-12-08 08:23:07 +09:00
Robert Lefebvre
59a44008d7 AP_RPM: Move timeout check into synthetic quality check. 2015-12-08 08:25:19 +11:00
Robert Lefebvre
fd106b20c7 AP_RPM: Add Minimum Quality Parameter 2015-12-08 08:25:19 +11:00
Robert Lefebvre
1f8b90e876 AP_RPM: Move filter step outside of min/max rpm check 2015-12-08 08:25:19 +11:00
Robert Lefebvre
f04668307d AP_RPM: Add Minimum RPM parameter 2015-12-08 08:25:18 +11:00
Robert Lefebvre
968599b795 AP_RPM: Add Signal Quality synthetic method. 2015-12-08 08:25:18 +11:00
Robert Lefebvre
77877ba5fc ModeFilter: Add get() method and support for Float type 2015-12-08 08:25:18 +11:00
Robert Lefebvre
a08fa50fda AP_RPM: Add enabled() method to check if sensor is enabled 2015-12-08 08:25:18 +11:00
Michael Oborne
1c1eea6119 AP_GPS_SBF: add sd logging by default, improve init 2015-12-07 21:56:44 +09:00
Michael Oborne
0bcc6e324a AP_GPS_SBF: formatting fixes 2015-12-07 21:56:42 +09:00
Tom Pittenger
f8b0a6a977 AP_Math: compiler warnings - undeclared function 2015-12-07 16:05:00 +09:00
Tom Pittenger
103af93ec3 AP_Math: compiler warnings - float compare to constant (zero) 2015-12-07 16:04:59 +09:00
Tom Pittenger
41746733fe AP_Common: remove crazy #define float double
- not creating a warning buuuuuut this is just sooooo bad that it must be nuked on the spot
2015-12-07 15:50:07 +09:00
Tom Pittenger
4e3864049a DataFlash: compile warning - float to double promotion 2015-12-07 15:50:03 +09:00
Tom Pittenger
4ee2fb6c7a Filter: compiler warnings - unused template <double> 2015-12-07 15:50:00 +09:00
Tom Pittenger
0aa0380db8 AP_Compass: compiler warnings - float to float compare and bool cast 2015-12-07 15:49:58 +09:00
Gustavo Jose de Sousa
3035fb282d DataFlash: fix example 2015-12-07 15:42:04 +09:00
Robert Lefebvre
3a13db9333 AP_MotorsHeli: Add more parameter checks. 2015-12-07 14:51:42 +09:00
Andrew Tridgell
58f0abaf4c AC_AttitudeControl: fixed one usage of zero accel limits
in other places zero accel limit means no limit
2015-12-07 13:43:14 +09:00
Andrew Tridgell
78e9b0a4e3 HAL_PX4: check for servo counts changing after boot
this copes with changes to BRD_PWM_COUNT
2015-12-06 14:19:28 +11:00
Lucas De Marchi
5678ae54db AP_ADC_AnalogSource: remove unused library 2015-12-03 13:32:45 +11:00
Lucas De Marchi
cee770f5f7 StorageManager: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:44 +11:00
Lucas De Marchi
e8e48fd8e0 RC_Channel: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:44 +11:00
Lucas De Marchi
9f0ff6ec24 GCS_MAVLink: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:44 +11:00
Lucas De Marchi
f584543ea1 DataFlash: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:44 +11:00
Lucas De Marchi
c59490677d AP_Scheduler: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:44 +11:00
Lucas De Marchi
fb24056ca9 AP_RangeFinder: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:44 +11:00
Lucas De Marchi
1ba22398a5 AP_OpticalFlow: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:44 +11:00
Lucas De Marchi
a4213166ae AP_Notify: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:44 +11:00
Lucas De Marchi
f1de9c25fe AP_Mount: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:43 +11:00
Lucas De Marchi
c9d1456a66 AP_Motors: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:43 +11:00
Lucas De Marchi
3818a8a703 AP_Mission: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:43 +11:00
Lucas De Marchi
f5c03c786d AP_Math: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:43 +11:00
Lucas De Marchi
e1d90c78d8 AP_InertialSensor: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:43 +11:00
Lucas De Marchi
fe5d6f2d49 AP_HAL_PX4: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:43 +11:00
Lucas De Marchi
a1c3912bd8 AP_HAL: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:43 +11:00
Lucas De Marchi
2b5417046b AP_GPS: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:43 +11:00
Lucas De Marchi
0bcbcd07cc AP_Compass: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:42 +11:00
Lucas De Marchi
0a1dbab24e AP_BattMonitor: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:42 +11:00
Lucas De Marchi
5b1769cd2b AP_Baro: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:42 +11:00
Lucas De Marchi
7c78955591 AP_Airspeed: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:42 +11:00
Lucas De Marchi
2b26a2eebe AP_AHRS: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:42 +11:00
Lucas De Marchi
247195512f AC_PID: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:42 +11:00
Andrew Tridgell
3a3394ce36 HAL_AVR: fixed branch URL for AVR 2015-12-03 13:28:51 +11:00
Andrew Tridgell
3fcda53d11 GCS_MAVLink: regenerated headers 2015-12-03 13:21:52 +11:00
Peter Barker
4f1a7c6427 DataFlash: remove use of AddLogFormats 2015-12-03 13:21:52 +11:00
Peter Barker
0f9e7a905d AP_GPS: remove use of AddLogFormats 2015-12-03 13:21:52 +11:00
Peter Barker
0ca07e5245 DataFlash: DataFlash-over-MAVLink support 2015-12-03 13:21:51 +11:00
Peter Barker
31b8432545 GCS_MAVLink: add remote logging messages 2015-12-03 13:21:51 +11:00
Peter Barker
faabe0b83d DataFlash: support multiple simultaneous backends 2015-12-03 13:21:51 +11:00
Peter Barker
121967d1b1 DataFlash: factor log structures into LogStructures.h (no functional change 2015-12-03 13:21:51 +11:00
Michael du Breuil
2f97f9f416 AP_GPS: Fix incorrect values docstring on RAW_DATA 2015-12-03 10:17:22 +09:00
Gustavo Jose de Sousa
eef784fbe6 AP_Math: add benchmark for matrix multiplication 2015-12-03 07:54:31 +11:00
Gustavo Jose de Sousa
4266e924d0 AP_Math: add unit test for vector rotations
This unit test already shows that rotation is wrong for
ROTATION_YAW_293_PITCH_68_ROLL_90.
2015-12-03 07:54:31 +11:00
Caio Marcelo de Oliveira Filho
6e7b73610d waf: add waf support 2015-12-03 07:54:30 +11:00
Lucas De Marchi
6d7678d2a3 AP_HAL_PX4: fix passing callback to member function
This is the same approach as done for AP_HAL_Linux in e3d78b8 ("AP_HAL_Linux:
fix passing callback to member function"). It fixes the following warnings:

ardupilot/libraries/AP_HAL_PX4/Scheduler.cpp: In member function 'virtual void PX4::PX4Scheduler::init(void*)':
ardupilot/libraries/AP_HAL_PX4/Scheduler.cpp:55:95: warning: converting from 'void* (PX4::PX4Scheduler::*)()' to 'pthread_startroutine_t {aka void* (*)(void*)}' [-Wpmf-conversions]
  pthread_create(&_timer_thread_ctx, &thread_attr, (pthread_startroutine_t)&PX4::PX4Scheduler::_timer_thread, this);
                                                                                               ^
ardupilot/libraries/AP_HAL_PX4/Scheduler.cpp:65:94: warning: converting from 'void* (PX4::PX4Scheduler::*)()' to 'pthread_startroutine_t {aka void* (*)(void*)}' [-Wpmf-conversions]
  pthread_create(&_uart_thread_ctx, &thread_attr, (pthread_startroutine_t)&PX4::PX4Scheduler::_uart_thread, this);
                                                                                              ^
ardupilot/libraries/AP_HAL_PX4/Scheduler.cpp:75:92: warning: converting from 'void* (PX4::PX4Scheduler::*)()' to 'pthread_startroutine_t {aka void* (*)(void*)}' [-Wpmf-conversions]
  pthread_create(&_io_thread_ctx, &thread_attr, (pthread_startroutine_t)&PX4::PX4Scheduler::_io_thread, this);
                                                                                            ^
ardupilot/libraries/AP_HAL_PX4/Scheduler.cpp:85:100: warning: converting from 'void* (PX4::PX4Scheduler::*)()' to 'pthread_startroutine_t {aka void* (*)(void*)}' [-Wpmf-conversions]
     pthread_create(&_storage_thread_ctx, &thread_attr, (pthread_startroutine_t)&PX4::PX4Scheduler::_storage_thread, this);

ardupilot/libraries/AP_HAL_PX4/NSHShellStream.cpp: In member function 'void PX4::NSHShellStream::start_shell()':
ardupilot/libraries/AP_HAL_PX4/NSHShellStream.cpp:83:99: warning: converting from 'void (PX4::NSHShellStream::*)()' to 'pthread_startroutine_t {aka void* (*)(void*)}' [-Wpmf-conversions]
     pthread_create(&shell_thread_ctx, &thread_attr, (pthread_startroutine_t)&PX4::NSHShellStream::shell_thread, this);
                                                                                                   ^
2015-12-03 07:51:08 +11:00
Lucas De Marchi
036eb21c09 AP_HAL: remove init() method with unused argument 2015-12-02 14:49:12 -02:00
Lucas De Marchi
bf24d0ef31 AP_HAL_VRBRAIN: use init() method without arguments
Override the init() method from parent class that doesn't have a
parameter since it's not used here.
2015-12-02 14:49:12 -02:00
Lucas De Marchi
4c82c535cc AP_HAL_SITL: use init() method without arguments
Override the init() method from parent class that doesn't have a
parameter since it's not used here.
2015-12-02 14:49:11 -02:00
Lucas De Marchi
0c3733601b AP_HAL_PX4: use init() method without arguments
Override the init() method from parent class that doesn't have a
parameter since it's not used here.
2015-12-02 14:49:11 -02:00
Lucas De Marchi
2439826c19 AP_HAL_Linux: use init() method without arguments
Override the init() method from parent class that doesn't have a
parameter since it's not used here.
2015-12-02 14:49:11 -02:00
Lucas De Marchi
0514aadaec AP_HAL_FLYMAPLE: use init() method without arguments
Override the init() method from parent class that doesn't have a
parameter since it's not used here.
2015-12-02 14:49:11 -02:00
Lucas De Marchi
00f17466a8 AP_HAL_Empty: use init() method without arguments
Override the init() method from parent class that doesn't have a
parameter since it's not used here.
2015-12-02 14:49:11 -02:00
Lucas De Marchi
6bc07da0ee AP_HAL: use init() method without arguments
Override the init() method from parent class that doesn't have a
parameter since it's not used here.
2015-12-02 14:42:37 -02:00
Lucas De Marchi
6b1c5e6f72 AP_HAL: add init() method without argument
The argument in init() is not used by any implementation. Add a second
method without it so the HAL implementation can used it instead. Later
the unused method will be removed.
2015-12-02 14:21:58 -02:00
Tom Pittenger
f60f0e80c3 AP_ADSB: update msg sizeof comment 2015-12-01 17:15:49 -08:00
Tom Pittenger
55f84e9c05 SITL: update ADSB for squawk 2015-12-01 17:13:02 -08:00
Tom Pittenger
c0c3500d06 GCS_MAVLink: regenerate headers 2015-12-01 17:12:20 -08:00
Tom Pittenger
5a9e632ace GCS_MAVLink: added squawk to ADSB_vehicle msg 2015-12-01 17:11:44 -08:00
Lucas De Marchi
49abb78372 AP_HAL_Linux: fix warning due to derived PWM_Sysfs
PWM_Sysfs derives from PWM_Sysfs_Base which was not update to have a
virtual destructor. Make PWM_Sysfs_Base's constructor virtual.
2015-12-02 10:43:43 +11:00
Lucas De Marchi
8eee888b3e AP_Baro: BMP085: move data-ready macro to a method 2015-12-02 10:40:50 +11:00
Lucas De Marchi
c5e97129c1 AP_Baro: BMP085: follow coding style
- Spacing changes and variable renames to follow coding style
 - No need to initialize variables to 0, it's already done by our
   global new operator.
2015-12-02 10:40:50 +11:00
Lucas De Marchi
81a298c9c8 AP_Baro: reduce header scope
We don't need to expose to other libraries how each backend is
implemented. AP_Baro.h is the main header, included by other libraries.

Instead of including each backend in the main header, move them to where
they are needed. Additionally standardize the order and how we include
the headers.

The advantages are:
	- Internals of each backend is not exposed outside of the
	  library
	- Faster incremental builds since we don't need to recompile
	  whoever includes AP_Baro.h because a backend changed
2015-12-02 10:40:50 +11:00
Lucas De Marchi
30f631de8f AP_Baro: MS5637: fix CRC check
The configuration of MS5637 is different from MS5611 in 2 ways:

    - The PROM is of 112 bytes rather than 128
    - The CRC is located in the first MSB of the first word, not the
      last one

For CRC calculation we also need to zero out the last (missing) word.

This renames _check_crc() to _read_prom(), which returns false when the
PROM doesn't contain valid data. It also makes it virtual so MS5637 can
override it. This also moves the PROM read to be all in the same place
rather than split between the CRC field and coefficient fields. Finally
calculate_crc() is renamed to crc4() to be shorter and add info on what
it does.
2015-12-02 10:38:09 +11:00
José Roberto de Souza
7457588d7c AP_Baro: Move initialisation code from MS56XX constructor to init()
On MS5637 we will need to override the method to read and calculate the
PROM's crc. Thus we need a 2-phase init.

It also makes the constructor of AP_Baro_MS56XX protected since only the
derived classes should instantiate the base one.
2015-12-02 10:38:09 +11:00
José Roberto de Souza
29791c9cec AP_Baro: Make _check_crc more readable 2015-12-02 10:38:09 +11:00
Lucas De Marchi
fef364e4e8 AP_TECS: avoid comparison between signed and unsigned 2015-12-01 16:28:18 -02:00
Lucas De Marchi
aa9168e0e9 AP_Math: remove unused maxf() 2015-12-01 16:28:18 -02:00
Lucas De Marchi
798b743660 AP_NavEKF: use MAX() instead of maxf() 2015-12-01 16:28:18 -02:00
Lucas De Marchi
6f88fba8e5 AP_Math: remove unused minf() 2015-12-01 16:28:18 -02:00
Lucas De Marchi
e0a0514c79 AP_Math: turn MIN/MAX macros into inline functions
The problem with the current MIN/MAX macros is that they evaluate twice
the arguments. For example, these cases provide unintended results:

	// a is incremented twice
	a = MIN(a++, b);
	// foo() with side-effects
	a = MIN(foo(), b);

The alternative implementation here was provided by Daniel Frenzel using
template function. It doesn't have type safety as std::min and std::max,
but adding type safety would mean to check case by case what would be a
reasonable type and add proper casts. Here the arguments for MIN and MAX
can have different types and the return type is deduced from the
expression in the function.

Inspecting the current callers no place was found with the unintended
results above, but some in which now we don't calculate twice the
parameters will benefit from this new version. Examples:

	float velocity_max = MIN(_pos_control.get_speed_xy(), safe_sqrt(0.5f*_pos_control.get_accel_xy()*_radius));

	float acro_level_mix = constrain_float(1-MAX(MAX(abs(roll_in), abs(pitch_in)), abs(yaw_in))/4500.0, 0, 1)*ahrs.cos_pitch()

	accel_x_cmss = (GRAVITY_MSS * 100) * (-(_ahrs.cos_yaw() * _ahrs.sin_pitch() / MAX(_ahrs.cos_pitch(),0.5f)) - _ahrs.sin_yaw() * _ahrs.sin_roll() / MAX(_ahrs.cos_roll(),0.5f));

	track_leash_slack = MIN(_track_leash_length*(leash_z-track_error_z)/leash_z, _track_leash_length*(leash_xy-track_error_xy)/leash_xy);

	RC_Channel_aux::move_servo(RC_Channel_aux::k_sprayer_pump, MIN(MAX(ground_speed * _pump_pct_1ms, 100 *_pump_min_pct),10000),0,10000);
2015-12-01 16:28:18 -02:00
Lucas De Marchi
2591261af6 Global: rename min and max macros to uppercase
The problem with using min() and max() is that they conflict with some
C++ headers. Name the macros in uppercase instead. We may go case by
case later converting them to be typesafe.

Changes generated with:

	git ls-files '*.cpp' '*.h' -z | xargs -0 sed -i 's/\([^_[:alnum:]]\)max(/\1MAX(/g'
	git ls-files '*.cpp' '*.h' -z | xargs -0 sed -i 's/\([^_[:alnum:]]\)min(/\1MIN(/g'
2015-12-01 16:28:09 -02:00
Andrew Tridgell
1e8c391024 AP_AHRS: fixed float exception on start in SITL
zero DCM matrix
2015-12-01 15:19:45 +11:00
Lucas De Marchi
d19c5035b6 Global: Rename printf format attribute
As commented in 8218140 ("AP_Common: add scanf format macro"), "FORMAT"
was a bad name for this macro since there's also the scanf. Rename to
FMT_PRINTF to follow the scanf name.
2015-12-01 07:22:12 +11:00
Andrew Tridgell
520b9de48a HAL_PX4: expose do_transfer() in API 2015-12-01 07:18:25 +11:00
Andrew Tridgell
44c280e9fb AP_HAL: fixed typo in do_transfer declaration 2015-12-01 07:18:10 +11:00