Commit Graph

11670 Commits

Author SHA1 Message Date
Andrew Tridgell
4131b98f8c AP_Airspeed: use non-blocking airspeed calibration
this prevents the EKF from being upset by a time jump
2016-05-24 17:00:56 +10:00
Andrew Tridgell
1581a5e354 AP_Param: fixed forced save of constructor override parameters
this fixes the problem where setting ATC_RAT_YAW_FILT to 20 in copter
didn't stick across reboots
2016-05-24 16:55:45 +10:00
Grant Morphett
52755c893d Rover: Print message when running skid steering SITL 2016-05-24 12:24:53 +10:00
Randy Mackay
8d1f50e78f AP_Motors: rename get_pwm_min to get_pwm_output_min 2016-05-24 10:00:25 +09:00
Randy Mackay
0c225cf498 AP_MotorsMulticopter: fix typo in comments 2016-05-24 10:00:25 +09:00
Randy Mackay
ff93524ba4 AP_Motors: rename MOT_THST_MAX to MOT_SPIN_MAX
Also renamed:
MOT_THST_BAT_MIN,MAX to MOT_BAT_VOLT_MIN,MAX
MOT_CURR_MAX to MOT_BAT_CURR_MAX
2016-05-24 10:00:25 +09:00
Randy Mackay
f1cbdbe914 AP_Motors: update some comments 2016-05-24 10:00:25 +09:00
Randy Mackay
49b14b3cb6 AP_Motors: add PWM_MIN, MAX
These parameters allow the motor PWM output range to be different from receiver's throttle input range
Also renamed throttle_pass_through to set_throttle_passthrough_for_esc_calibration and change the method's input to the 0 to 1 range instead of direct PWM value
2016-05-24 10:00:25 +09:00
Lucas De Marchi
bbe3a94175 AP_HAL: remove support for main without argc
This was only used by flymaple. Also add missing copyright notice to
header.
2016-05-23 21:49:45 -03:00
Lucas De Marchi
b067bce140 AP_InertialSensor: remove support for flymaple 2016-05-23 21:49:45 -03:00
Lucas De Marchi
346bdf5f8f AP_HAL: remove support for flymaple 2016-05-23 21:49:45 -03:00
Lucas De Marchi
7703e5f1d1 AP_Common: remove support for flymaple 2016-05-23 21:49:45 -03:00
Lucas De Marchi
e448f161d2 AP_BattMonitor: remove support for flymaple 2016-05-23 21:49:45 -03:00
Lucas De Marchi
62f048c417 AP_Airspeed: remove support for flymaple 2016-05-23 21:49:45 -03:00
Lucas De Marchi
7503c1b6d4 AP_InertialSensor: update doc about used ids 2016-05-23 21:49:45 -03:00
Lucas De Marchi
01b9316114 AP_HAL_AVR: remove examples
These were committed by mistake after AP_HAL_AVR was removed.
2016-05-23 21:49:45 -03:00
Lucas De Marchi
dfde4a27e6 AP_HAL_FLYMAPLE: remove hal
This is untested and not being updated lately. We can support it on the
avr branch or add it back later when someone is willing to maintain it
in upstream.
2016-05-23 21:49:45 -03:00
Andrew Tridgell
64e105464d GCS_MAVLink: fixed disabling of signing remotely 2016-05-24 07:25:54 +10:00
Lucas De Marchi
3457dbcdf8 AP_HAL_Linux: rename lttng define
Like others, use HAVE_ prefix and name it HAVE_LTTNG_UST to be the same
name as exported by pkg-config While at it remove wrong comment with
_HELLO_TP_H.
2016-05-23 12:06:42 -03:00
Andrew Tridgell
635a975486 HAL_SITL: use a smaller buffer for real SITL UARTs
better emulation of real hw
2016-05-23 23:41:02 +10:00
Andrew Tridgell
595d5c0002 AP_HAL: added set_size() to RingBuffer API 2016-05-23 23:41:02 +10:00
Andrew Tridgell
0bbddd38cf GCS_MAVLink: fixed some places where packets are sent without space
we always need sufficient space for the packet in the send buffer
2016-05-23 23:41:01 +10:00
Lucas De Marchi
13722b8858 AP_HAL_Linux: support 16 RCInput channels on Navio2 2016-05-23 09:12:33 -03:00
Andrew Tridgell
5f7af390ec AP_Common: a useful debug macro for SITL 2016-05-23 10:10:29 +10:00
Andrew Tridgell
ef210217dd HAL_Linux: cope with MAVLink2 in UDP driver for packetising 2016-05-23 10:10:03 +10:00
Andrew Tridgell
8486d4ab5e AP_AHRS: disable EKF1 on all PX4v1 and PX4v2 boards
we're out of space in copter now too
2016-05-21 15:25:18 +10:00
Andrew Tridgell
273c80116a GCS_MAVLink: added a wrapper for sending HEARTBEAT
will be used to cope with old radios with MAVLink2
2016-05-21 15:25:17 +10:00
Andrew Tridgell
2094cb2d88 RC_Channel: fixed example for MAVLink2 2016-05-21 15:25:17 +10:00
Andrew Tridgell
8899455ea3 GCS_MAVLink: use extended MEMINFO message 2016-05-21 15:25:17 +10:00
Andrew Tridgell
fde0652d81 DataFlash: use HAVE_PAYLOAD_SPACE() 2016-05-21 15:25:17 +10:00
Andrew Tridgell
cd1f43a6ce GCS_MAVLink: use generated target_system and target_component offsets 2016-05-21 15:25:17 +10:00
Andrew Tridgell
018b1143d2 GCS_MAVLink: handle difference between SERIALn_PROTOCOL=1 and 2 2016-05-21 15:25:17 +10:00
Andrew Tridgell
78e9ef427e AP_SerialManager: remove special case for console
and add get_mavlink_protocol() to allow selection of correct mavlink
protocol behaviour
2016-05-21 15:25:17 +10:00
Andrew Tridgell
b3f94184f2 GCS_MAVLink: always build with MAVLink2 headers 2016-05-21 15:25:16 +10:00
Andrew Tridgell
f377787444 AP_Mount: always build with MAVLink2 headers 2016-05-21 15:25:16 +10:00
Andrew Tridgell
94feae9eaf AP_HAL_QURT: always build with MAVLink2 headers 2016-05-21 15:25:16 +10:00
Andrew Tridgell
6f7d6269a8 AP_HAL_Linux: always build with MAVLink2 headers 2016-05-21 15:25:16 +10:00
Andrew Tridgell
ef4d7e5618 GCS_MAVLink: fixed build with mavlink1 2016-05-21 15:25:15 +10:00
Andrew Tridgell
048fc8d39e GCS_MAVLink: adjust for min_length mavlink2 API change 2016-05-21 15:25:15 +10:00
Andrew Tridgell
318ec69465 GCS_MAVLink: added periodic saving of signing key
thanks to Michael for noticing this was missing
2016-05-21 15:25:15 +10:00
Andrew Tridgell
40d1a23a13 AP_Terrain: use HAVE_PAYLOAD_SPACE() 2016-05-21 15:25:15 +10:00
Andrew Tridgell
ec62d8f4ca AP_Mount: use HAVE_PAYLOAD_SPACE() 2016-05-21 15:25:14 +10:00
Andrew Tridgell
12c1d58511 GCS_MAVLink: cope with different packet overheads with signing
use common macros for determining if there is sufficient space to send
a packet
2016-05-21 15:25:14 +10:00
Andrew Tridgell
006b9728d0 GCS_MAVLink: updates for 24 bit msgid 2016-05-21 15:25:14 +10:00
Andrew Tridgell
a05679fb3b GCS_MAVLink: fixed build after rebase 2016-05-21 15:25:14 +10:00
Andrew Tridgell
7aae93e3e0 GCS_MAVLink: fixed auto-switching to MAVLink2 2016-05-21 15:25:14 +10:00
Andrew Tridgell
4ba09671a4 GCS_MAVLink: support disabling signing with zero key 2016-05-21 15:25:13 +10:00
Andrew Tridgell
c96ed2b4c6 GCS_MAVLink: fixed calculation of GPS timestamp 2016-05-21 15:25:13 +10:00
Andrew Tridgell
970dbf3c8d GCS_MAVLink: fixed build with MAVLink1 2016-05-21 15:25:13 +10:00
Andrew Tridgell
24eb6afbe9 GCS_MAVLink: provide signing streams and accept_unsigned callback 2016-05-21 15:25:13 +10:00
Andrew Tridgell
ed9a43ca46 GCS_MAVLink: support for mavlink2 signing operations 2016-05-21 15:25:12 +10:00
Andrew Tridgell
ca39ece6cb StorageManager: added storage region for signing keys 2016-05-21 15:25:12 +10:00
Andrew Tridgell
8ea9e29fee GCS_MAVLink: use a fixed signing key for testing 2016-05-21 15:25:12 +10:00
Andrew Tridgell
0ead0ab978 GCS_MAVLink: support mavlink2 build 2016-05-21 15:25:12 +10:00
Andrew Tridgell
0ef5d8995b AP_Mount: support mavlink2 build 2016-05-21 15:25:12 +10:00
Andrew Tridgell
4eadab7a90 HAL_QURT: support mavlink2 build 2016-05-21 15:25:12 +10:00
Andrew Tridgell
31f8d26784 HAL_Linux: support mavlink2 build 2016-05-21 15:25:11 +10:00
Paul Riseborough
74121fdaeb AP_NavEKF2: fix bug preventing in-flight alignment 2016-05-21 15:13:53 +10:00
Paul Riseborough
16cb7078cd AP_NavEKF2: Fix misleading pre-flight status reporting 2016-05-21 15:13:53 +10:00
Paul Riseborough
38d61f5281 AP_NavEKF2: Update status reporting to handle no-magnetometer startup 2016-05-21 15:13:53 +10:00
Paul Riseborough
9aa3cdfaae AP_NavEKF2: Update GPS yaw re-alignment function
Updates to support initial alignment without magnetometer
2016-05-21 15:13:53 +10:00
Paul Riseborough
e3c966661b AP_NavEKF2: Remove unnecessary variance reset
This reset is unnecessary give that a synthetic yaw angle is fused at a low rate to prevent variances from becoming badly conditioned.
2016-05-21 15:13:53 +10:00
Paul Riseborough
1179c08473 AP_NavEKF2: Handle case where we are in-flight and haven't yet aligned the yaw
This happens if planes are flown without a compass
2016-05-21 15:13:53 +10:00
Paul Riseborough
581c1aa0d4 AP_NavEKF2: Adjust attitude variance values used after a heading reset
Because these errors are in body frame, a spherical error should be used to accommodate different orientations
2016-05-21 15:13:53 +10:00
Paul Riseborough
5ec8d523f6 AP_NavEKF: remove unwanted co-variance reset
The co-variance resets required following a velocity and position state reset is now performed in the stte reset function
2016-05-21 15:13:53 +10:00
Paul Riseborough
66e4d9d6e8 AP_NavEKF2: Reset co-variance values when doing a pos,vel,hgt reset
Ensures consistent behaviour after resets and reduces attitude disturbances
2016-05-21 15:13:52 +10:00
Paul Riseborough
cf8175a073 AP_NavEKF2: Allow immediate use of GPS in-flight for plane without compass
Planes operating without a compass must align the yaw to the GPS heading immediately after launch or takeoff and cannot wait for GPS accuracy checks.
2016-05-21 15:13:52 +10:00
Paul Riseborough
08de4e6d95 AP_NavEKF: Do not perform start-up yaw alignment if no compass
Yaw cannot be aligned until in-flight when there is sufficient GPS velocity.
2016-05-21 15:13:52 +10:00
Paul Riseborough
d2694fe5dc AP_NavEKF2: Remove duplicate transition into GPS aiding
This decision is made in one place in setAidingMode()
2016-05-21 15:13:52 +10:00
Paul Riseborough
7201f7d2fd AP_NavEKF2: fix comment 2016-05-21 15:13:52 +10:00
Paul Riseborough
64a8153b68 AP_NavEKF2: update function name
The primary purpose of this function is re-alignment
2016-05-21 15:13:52 +10:00
Paul Riseborough
addd213af0 AP_NavEKF2: reduce effect of acceleration on non-GPS mode attitude 2016-05-21 15:13:52 +10:00
Paul Riseborough
d33bbf8cc7 AP_NavEKF: remove debug code 2016-05-21 15:13:52 +10:00
Paul Riseborough
54213ad871 DataFlash: Improve reporting of normalised ekf2 magnetometer innovations
Report the maximum of the x,y,z axis
2016-05-21 15:13:52 +10:00
Paul Riseborough
a3b78e6231 AP_NavEKF2: update tuning defaults 2016-05-21 15:13:51 +10:00
Paul Riseborough
65f63341d7 AP_NavEKF2: Improve numerical error protection in optical flow fusion
Abort fusion of data if variances will become negative and publish the fault
2016-05-21 15:13:51 +10:00
Paul Riseborough
42da33593d AP_NavEKF2: fix yaw fusion numerical health reporting 2016-05-21 15:13:51 +10:00
Paul Riseborough
6eb9d43507 AP_NavEKF2: add numerical error checking and isolation to mag decl fusion 2016-05-21 15:13:51 +10:00
Paul Riseborough
b325c5faeb AP_NavEKF2: add error checking and isolation to mag heading fusion 2016-05-21 15:13:51 +10:00
Paul Riseborough
a0b1dc5325 AP_NavEKF2: add error checking and isolation to 3D amg fusion 2016-05-21 15:13:51 +10:00
Paul Riseborough
51a3df0319 AP_NavEKF2: Add error checking and isolation to pos vel fusion 2016-05-21 15:13:51 +10:00
Paul Riseborough
fcee82f9b2 DataFlash: extend ekf fault status reporting coverage 2016-05-21 15:13:51 +10:00
Paul Riseborough
597ec61673 AP_AHRS: extend ekf fault status reporting coverage 2016-05-21 15:13:50 +10:00
Paul Riseborough
d59d8cc6e3 AP_NavEKF: extend fusion fault reporting coverage 2016-05-21 15:13:50 +10:00
Paul Riseborough
71b589c89c AP_NavEKF2: extend fusion fault reporting coverage 2016-05-21 15:13:50 +10:00
Paul Riseborough
0982bd0b2b AP_NavEKF2: update parameter documentation 2016-05-21 15:13:50 +10:00
Paul Riseborough
46a2993a0d AP_NavEKF: use intuitive units for imu bias process noise parameters 2016-05-21 15:13:50 +10:00
Paul Riseborough
8c374fd679 AP_NavEKF2: correct comments 2016-05-21 15:13:50 +10:00
Paul Riseborough
6be9eaa524 AP_NavEKF2: use receiver estimated accuracy
Adjust the GPS observation noise based on receiver accuracy output if available.
2016-05-21 15:13:50 +10:00
Paul Riseborough
dddc213836 AP_NavEKF2: Open up tuning limits
Done to assist tuning assessments
2016-05-21 15:13:50 +10:00
Paul Riseborough
cf05e110fc AP_NavEKF2: fix scaling error in use of IMU noise parameters
Also remove process noise from state transition matrix where it was mistakenly left in after the derivation
2016-05-21 15:13:50 +10:00
Randy Mackay
2bafc36ded AC_WPNav: support rangefinder for terrain following 2016-05-21 10:36:53 +09:00
Randy Mackay
4829dbb55d AC_Fence: rename check_destination_within_fence and accept distances in meters 2016-05-21 09:56:12 +09:00
Saloni Jain
ff843448aa AC_Fence: Added a new function to check whether the guided waypoint is within the fence 2016-05-21 09:56:12 +09:00
Gustavo Jose de Sousa
9a100afede AP_HAL_Linux: Thread: add doc about rounding function 2016-05-20 16:31:15 -03:00
Lucas De Marchi
359417d544 AP_HAL_Linux: Thread: make sure pointer is aligned
Implementation of alloca() is very much architecture and compiler
dependent. Avoid the case in which it could return a non-aligned
pointer, which would mean Thread::_poison_stack() would do the wrong
thing.
2016-05-20 16:31:15 -03:00
Lucas De Marchi
7e49d0c53f AP_HAL_Linux: Thread: fix alignment warning
../../libraries/AP_HAL_Linux/Thread.cpp: In member function ‘void Linux::Thread::_poison_stack()’:
../../libraries/AP_HAL_Linux/Thread.cpp:87:31: warning: cast from ‘uint8_t* {aka unsigned char*}’ to ‘uint32_t* {aka unsigned int*}’ increases required alignment of target type [-Wcast-align]
         for (p = (uint32_t *) end; p > curr; p--) {
                               ^
../../libraries/AP_HAL_Linux/Thread.cpp:93:31: warning: cast from ‘uint8_t* {aka unsigned char*}’ to ‘uint32_t* {aka unsigned int*}’ increases required alignment of target type [-Wcast-align]
         for (p = (uint32_t *) end; p < curr; p++) {
                               ^
../../libraries/AP_HAL_Linux/Thread.cpp:98:39: warning: cast from ‘uint8_t* {aka unsigned char*}’ to ‘uint32_t* {aka unsigned int*}’ increases required alignment of target type [-Wcast-align]
     _stack_debug.start = (uint32_t *) begin;
                                       ^
../../libraries/AP_HAL_Linux/Thread.cpp:99:37: warning: cast from ‘uint8_t* {aka unsigned char*}’ to ‘uint32_t* {aka unsigned int*}’ increases required alignment of target type [-Wcast-align]
     _stack_debug.end = (uint32_t *) end;
                                     ^
2016-05-20 16:31:15 -03:00
Lucas De Marchi
18af4da690 AP_HAL_Linux: Thread: fix warning regarding shadow member
../../libraries/AP_HAL_Linux/Thread.cpp: In member function ‘void Linux::Thread::_poison_stack()’:
../../libraries/AP_HAL_Linux/Thread.cpp:63:20: warning: declaration of ‘start’ shadows a member of 'this' [-Wshadow]
     uint8_t *end, *start, *curr;
                    ^
2016-05-20 16:31:15 -03:00
Tom Pittenger
684ac12dd6 AC_WPNav: fix compile when using AP_TERRAIN_AVAILABLE 0 2016-05-20 12:29:19 -07:00
Tom Pittenger
f085666032 AP_Common: fix compile when using AP_TERRAIN_AVAILABLE 0 2016-05-20 12:28:46 -07:00
Leandro Pereira
3555e439a4 AP_HAL_Linux: Simplify I2C initialization in HAL_Linux_Class 2016-05-20 10:12:17 -03:00
Aaron Wang Shi
cb9cd9008a AP_HAL_Linux: fix bhat spi device driver build error 2016-05-20 10:09:50 -03:00
Lucas De Marchi
035937ea7e AP_GPS: add some safety checks to _parse_decimal_100() 2016-05-20 10:06:45 -03:00
Lucas De Marchi
994b2fc966 AP_GPS: add unit test for _parse_decimal_100() 2016-05-20 10:06:44 -03:00
Lucas De Marchi
fc6dd97e61 AP_GPS: make _parse_decimal_100() a static function
This allows to easily write tests for it as opposed to having to
construct the entire object.
2016-05-20 10:06:44 -03:00
Bert Regelink
7379d120e1 AP_GPS: fix _parse_decimal_100() with negative numbers
_parse_decimal_100() did not parse the fractional part for negative
numbers. Furthermore, use the third decimal (when present) for proper
rounding.
2016-05-20 10:06:44 -03:00
AndersonRayner
aaa8709194 AP_RPM: Added an example script 2016-05-19 19:01:03 -03:00
Vinicius Juvinski
ed2718a183 AP_Notify: Buzzer: change pin 11(P8_31) to pin 12(P8_32)
Avoid boot conflict during power on.
2016-05-19 17:22:27 -03:00
Randy Mackay
54731a139f AP_Mission: rename starts_with_takeoff_cmd 2016-05-19 19:43:22 +09:00
Niti Rohilla
9ec0000691 AP_Mission: add check_takeoff_cmd
This checks that the first command in the mission is a takeoff command which helps avoid mission setup errors in which users forget to start a mission with a takeoff command
2016-05-19 19:43:17 +09:00
Niti Rohilla
d771017c25 AP_Mission: support MAV_CMD_NAV_DELAY command 2016-05-19 16:16:02 +09:00
Randy Mackay
67620f312d AP_HAL: fix comment for get_time_utc 2016-05-19 16:05:29 +09:00
Niti Rohilla
faec752801 AP_HAL: add get_system_clock_utc functions to Util 2016-05-19 16:05:26 +09:00
Andrew Tridgell
4080c6091d AP_NavEKF2: fixed an assumption that _ahrs->get_compass() always works
if MAG_ENABLE=0 in plane there is no compass
2016-05-19 14:16:40 +10:00
Lucas De Marchi
71e10c9132 AP_HAL_Linux: fix include order
Sort include alphabetically and make them in order:

Main header
system headers
library headers
local headers

While reordering, change a include of endian.h to our sparse-endian.h
which is more reliant to toolchain changes.
2016-05-18 23:05:56 -03:00
Lucas De Marchi
45c6b750f2 AP_HAL_Linux: remove ifdef checks for HAL_BOARD_LINUX
Everything inside libraries/AP_HAL_Linux is for Linux boards, there's
not need to add the ifdefs.
2016-05-18 23:05:56 -03:00
Lucas De Marchi
c4306de122 AP_Common: fix build on windows
The way the build was fixed for gcc >= 5.3 breaks the build for older
compiler versions on waf. Fix this by ifdef'ing for WAF_BUILD and
checking the compiler version.
2016-05-18 22:56:50 -03:00
Lucas De Marchi
9ccce2c980 AP_Compass: explicitely add compasses for erlebrain2, pxf and pxfmini 2016-05-18 18:24:14 -03:00
Lucas De Marchi
8372e74c0f AP_Compass: simplify handling of sensors for Linux boards
In addition:
    - bbbmini, navio and navio2 can force HMC5843 backend to
      be external.
    - there was a typo in the backend name that's now fixed:
      AK8953 vs AK8963
2016-05-18 18:24:14 -03:00
Lucas De Marchi
1ddbafabdd AP_Compass: add name field to internal compass drivers 2016-05-18 18:24:14 -03:00
Gustavo Jose de Sousa
ef61096e08 AP_Math: geodesic_grid tool: show triangle number for sections too 2016-05-18 13:28:52 -03:00
Gustavo Jose de Sousa
a6deb65d95 AP_Math: geodesic_grid tool: add option --section 2016-05-18 13:28:52 -03:00
Andrew Tridgell
f7ac6c8d86 AP_Compass: make internal compasses use a higher cal threshold
they tend to be a lot noisier
2016-05-18 16:32:32 +10:00
Tom Pittenger
d67b1edf10 AP_NavEKF2: (potential) compiler warning of float to double promotion 2016-05-17 20:30:51 -07:00
Tom Pittenger
3c6323dd82 AP_TECS: Log TEC2.LF as Aerodynamic Load Factor 2016-05-17 20:17:27 -07:00
Tom Pittenger
32d51e346d DataFlash: optimize logging climbrate - call function one and reuse result 2016-05-17 18:59:14 -07:00
Tom Pittenger
ad11f3815b AP_HAL_SITL: rename aspd variables to arspd 2016-05-17 16:36:14 -07:00
Tom Pittenger
c77a5e6764 SITL: rename aspd variables and params to arspd 2016-05-17 16:36:07 -07:00
Tom Pittenger
d55401aa18 AP_Tuning: fixed float->double promotion compiler warning 2016-05-17 16:32:10 -07:00
Tom Pittenger
ae91804aaa AP_Arming: updated comment for z-axis accel threshold 2016-05-17 16:31:42 -07:00
Tom Pittenger
f9335e9d8c AP_TECS: fixed float->double print warning 2016-05-17 15:58:03 -07:00
Lucas De Marchi
1ac712fa65 AP_Math: fix is_zero() after template conversion 2016-05-17 15:49:29 -07:00
Andrew Tridgell
7b47d54d6b AP_Common: workaround for SITL on windows 2016-05-17 20:55:57 +10:00
Lucas De Marchi
fa6f2c6b67 AP_Math: fix some coding style mistakes
- fix alignement of &
    - remove const from bool arguments
2016-05-16 19:08:36 -03:00
Gustavo Jose de Sousa
0c31354539 AP_Compass: implement completion mask
Fill the completion mask and send that through MAVLink while calibrating the
compass.
2016-05-16 19:08:36 -03:00
Gustavo Jose de Sousa
390b196eda AP_Math: AP_GeodesicGrid: add notice for auto generated code 2016-05-16 19:08:36 -03:00
Gustavo Jose de Sousa
b3068baa11 AP_Math: add geodesic_grid toolset
That was used to aid development AP_GeodesicGrid and understanding its
concepts.
2016-05-16 19:08:36 -03:00
Gustavo Jose de Sousa
9d34b3b996 AP_Math: AP_GeodesicGrid: make all methods static
Since all members are.
2016-05-16 19:08:36 -03:00
Gustavo Jose de Sousa
3b05ec1157 AP_Math: make vectors and matrix constructors constexpr
That allows some object to be constructed at compile time.
2016-05-16 19:08:36 -03:00
Gustavo Jose de Sousa
77223a7fcb AP_Math: AP_GeodesicGrid: make data static
That gives the change of storing that data in flash storage in some
architectures. That doesn't happen yet though, some extra changes are required
for that to happen.
2016-05-16 19:08:36 -03:00
Gustavo Jose de Sousa
fd2428db34 AP_Math: AP_GeodesicGrid: reduce number of _neighbor_umbrellas items
Only the first half is necessary. The values for the other half can be derived.
2016-05-16 19:08:36 -03:00
Gustavo Jose de Sousa
43d9e00ab7 AP_Math: AP_GeodesicGrid: use uint8_t for _neighbor_umbrellas
All integers there are limited to the range [0,20), so uint8_t is enough.
2016-05-16 19:08:36 -03:00
Gustavo Jose de Sousa
54889e4175 AP_Math: AP_GeodesicGrid: reduce number of inverses by half
We don't actually need all of them, since the second half is for the opposite
triangles. In that case we just need to negate the resulting vector when
changing basis.
2016-05-16 19:08:36 -03:00
Gustavo Jose de Sousa
f31161ecb6 AP_Math: AP_GeodesicGrid: remove triangles
There's no need to keep those triangles, since we just need the inverses.
2016-05-16 19:08:36 -03:00
Gustavo Jose de Sousa
b34c04a4f9 AP_Math: test_geodesic_grid: test also non-centroid vectors 2016-05-16 19:08:36 -03:00
Gustavo Jose de Sousa
8e8ab3af96 AP_Math: AP_GeodesicGrid: remove section_triangle() function
That function was only being used by the unit tests and the benchmark. In order
to remove memory usage, the triangles will be removed, since we don't actually
need to keep them in real situations. Thus, this patch removes that function
and copy those triangles to the test and benchmark.
2016-05-16 19:08:36 -03:00
Gustavo Jose de Sousa
c7eb46fae2 AP_Math: AP_GeodesicGrid: optimize _from_neighbor_umbrella()
This is the second optimization. With that we don't have to iterate over the
umbrella's components.

The table below summarizes the mean CPU time in ns from the brenchmark results
on an Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz processor:

       | Naive implementation | First Optimization | Second Optimization
------------------------------------------------------------------------
Min.   |                 26.0 |              28.00 |                26.0
1st Qu.|                 78.0 |              48.75 |                39.0
Median |                132.0 |              57.00 |                41.0
Mean   |                130.1 |              61.20 |                41.6
3rd Qu.|                182.2 |              76.00 |                47.0
Max.   |                234.0 |              98.00 |                54.0
2016-05-16 19:08:36 -03:00
Gustavo Jose de Sousa
eb90ef23a1 AP_Math: AP_GeodesicGrid: fix algorithm for null vector
If v is the null vector, then alpha * v is still the null vector for any alpha
as a real number. That means that the null vector doesn't cross any section.
2016-05-16 19:08:36 -03:00
Gustavo Jose de Sousa
c28c3265c8 AP_Math: AP_GeodesicGrid: optimize with neighbor umbrellas
This is a first optimization of the algorithm. The struct for the neighbor
umbrella has only one member, but new members will be added in the next
optimization.

The table below summarizes the mean CPU time in ns from the brenchmark results
on an Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz processor:

Cases  | Naive implementation | First Optimization
--------------------------------------------------
Min.   |                 26.0 |              28.00
1st Qu.|                 78.0 |              48.75
Median |                132.0 |              57.00
Mean   |                130.1 |              61.20
3rd Qu.|                182.2 |              76.00
Max.   |                234.0 |              98.00

This optimization reduces the mean time for the worst case (Max. line) by more
than 50%.
2016-05-16 19:08:36 -03:00
Gustavo Jose de Sousa
0ff05b7af3 AP_Math: test_geodesic_grid: test triangles indexes
That helps figuring out which intermediate step failed the high level call.
2016-05-16 19:08:36 -03:00
Gustavo Jose de Sousa
4398e1e49b AP_Math: AP_GeodesicGrid: change order of triangles
- Change the order of the icosahedron triangles so that there's a uniform way of
finding the opposite triangle. The order visually still makes sense.

 - Change test to accommodate the order change.
2016-05-16 19:08:36 -03:00
Gustavo Jose de Sousa
ea412ad629 AP_Math: benchmark_geodesic_grid: add benchmark
That will help to benchmark improvements on the section search algorithm.
2016-05-16 19:08:36 -03:00
Gustavo Jose de Sousa
797a2da031 AP_Math: test_geodesic_grid: test when inclusive=true 2016-05-16 19:08:36 -03:00
Gustavo Jose de Sousa
b299261ad4 AP_Math: AP_GeodesicGrid: add first implementation
The search for the geodesic section is still naive in this version.
Additionally, add unit tests.
2016-05-16 19:08:35 -03:00
Gustavo Jose de Sousa
3f2ad764ca AP_Math: Matrix3: add inverse() and invert() functions
Additionally, add unit tests.
2016-05-16 19:08:35 -03:00
Gustavo Jose de Sousa
06eea2838f AP_Math: Matrix3: add det() function
Function to calculate determinant. Additionally, add unit tests.
2016-05-16 19:08:35 -03:00
Gustavo Jose de Sousa
26959f1448 AP_Math: define golden ratio constant 2016-05-16 19:08:35 -03:00
dgrat
f8540f1a80 AP_Compass: Do not use is_zero() for non-float types 2016-05-16 19:08:35 -03:00
dgrat
7ff8004f8f AP_Math: Replace is_zero() with a template function
This function only makes sense for floating point types. However this
function was also used for ints.
2016-05-16 19:08:35 -03:00
Tom Pittenger
ebd993dabb AP_Arming: updated z-axis accel threshold comment 2016-05-16 13:46:17 -07:00
Tom Pittenger
9073ac91ff AP_Mission: 2of3 add loiter_xtrack option flag for post-loiter navigation via param4
0 to crosstrack from center of waypoint, 1 to crosstrack from tangent exit location
2016-05-16 11:50:54 -07:00
Tom Pittenger
02eeb2d4f0 AP_Common: 1of3 add loiter_xtrack option flag for post-loiter navigation
0 to crosstrack from center of waypoint, 1 to crosstrack from tangent exit location
2016-05-16 11:50:53 -07:00
Gustavo Jose de Sousa
2246343ec7 AP_HAL_SITL: pass signed value to abs()
Passing an unsigned value to abs() causes compilation error in gcc 6.1.1
(and doing that doesn't make sense too).

As a bonus, this patch fixes the code, since, for two unsigned integers
a and b, such that a > b, (a - b) without the casting to a signed
integer would produce garbage in the context of this patch. The type
int32_t is enough for the cases covered by this patch.
2016-05-16 15:04:22 -03:00
Lucas De Marchi
421b9ef54a AP_Mount do not use flexible array in union
We actually don't want a flexible array in this union, but rather a way
to access it byte by byte. This fixes the build for gcc >= 6

In file included from ../../libraries/AP_GPS/AP_GPS_UBLOX.cpp:23:0:
../../libraries/AP_GPS/AP_GPS_UBLOX.h:387:23: error: flexible array member in union
         uint8_t bytes[];
                       ^
compilation terminated due to -Wfatal-errors.

In file included from ../../libraries/AP_Mount/AP_Mount.cpp:9:0:
../../libraries/AP_Mount/AP_Mount_Alexmos.h:291:23: error: flexible array member in union
         uint8_t bytes[];
                       ^
compilation terminated due to -Wfatal-errors.
2016-05-16 13:50:56 -03:00
Lucas De Marchi
39bd196481 AP_GPS: do not use flexible array in union
We actually don't want a flexible array in this union, but rather a way
to access it byte by byte. This fixes the build for gcc >= 6

In file included from ../../libraries/AP_GPS/AP_GPS.cpp:24:0:
../../libraries/AP_GPS/AP_GPS_ERB.h:93:23: error: flexible array member in union
         uint8_t bytes[];
                       ^
compilation terminated due to -Wfatal-errors.

In file included from ../../libraries/AP_GPS/AP_GPS_ERB.cpp:22:0:
../../libraries/AP_GPS/AP_GPS_ERB.h:93:23: error: flexible array member in union
         uint8_t bytes[];
                       ^
compilation terminated due to -Wfatal-errors.

In file included from ../../libraries/AP_GPS/AP_GPS_MTK.cpp:25:0:
../../libraries/AP_GPS/AP_GPS_MTK.h:75:23: error: flexible array member in union
         uint8_t bytes[];
                       ^
compilation terminated due to -Wfatal-errors.

In file included from ../../libraries/AP_GPS/AP_GPS_MTK19.cpp:26:0:
../../libraries/AP_GPS/AP_GPS_MTK.h:75:23: error: flexible array member in union
         uint8_t bytes[];
                       ^
compilation terminated due to -Wfatal-errors.

In file included from ../../libraries/AP_GPS/AP_GPS_SIRF.cpp:22:0:
../../libraries/AP_GPS/AP_GPS_SIRF.h:101:23: error: flexible array member in union
         uint8_t bytes[];
                       ^
compilation terminated due to -Wfatal-errors.

In file included from ../../libraries/AP_GPS/AP_GPS_UBLOX.cpp:23:0:
../../libraries/AP_GPS/AP_GPS_UBLOX.h:387:23: error: flexible array member in union
         uint8_t bytes[];
                       ^
compilation terminated due to -Wfatal-errors.
2016-05-16 13:50:39 -03:00
Gustavo Jose de Sousa
d615628367 AP_HAL_Linux: I2CDevice: add missing stdio.h include
This was probably being included by another header, but it's not on
gcc >= 6.1 and glibc 2.23.
2016-05-16 13:12:53 -03:00
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