Commit Graph

16289 Commits

Author SHA1 Message Date
Andrew Tridgell
d2075b4b67 AP_HAL: added irq save/restore API to hal.scheduler
these are used by RPM driver
2018-04-07 09:10:29 +10:00
Andrew Tridgell
54185af8ef AP_BLHeli: removed test code
not needed any more, and no longer compiles
2018-04-07 09:10:29 +10:00
Andrew Tridgell
019049e76b HAL_ChibiOS: fixed RC period setting 2018-04-07 09:10:29 +10:00
Andrew Tridgell
9ba3992d9e AP_BLHeli: added SERVO_BLHI_AUTO option
makes choosing motor mask much easier for multicopters
2018-04-07 09:10:29 +10:00
Andrew Tridgell
fd3037bbb7 GCS_MAVLink: add support for alternative protocol
this allows an alternative to MAVLink to be installed on a GCS
port. This is used for BLHeli passthru support
2018-04-07 09:10:29 +10:00
Andrew Tridgell
d258eac88d HAL_ChibiOS: fixed reconfig of group after serial_end() 2018-04-07 09:10:29 +10:00
Andrew Tridgell
46c76c3d5d HAL_ChibiOS: increase serial byte timeout
needs 2ms for final ack in verify
2018-04-07 09:10:29 +10:00
Andrew Tridgell
202a7dd091 HAL_ChibiOS: don't allow dshot while serial active 2018-04-07 09:10:29 +10:00
Andrew Tridgell
b350b07593 HAL_ChibiOS: allow internal GPIO fuctions to use disabled pins 2018-04-07 09:10:29 +10:00
Andrew Tridgell
1be41b83fc SRV_Channel: added SERVO_BLHI_ parameters 2018-04-07 09:10:29 +10:00
Andrew Tridgell
a1a83ab768 AP_BLHeli: added ESC serial protocol implementation
this implements the MSP and BLHeli protocols for passthru control of
BLHeli ESCs
2018-04-07 09:10:29 +10:00
Andrew Tridgell
67bae2669b HAL_ChibiOS: enable serial5 on fmuv3 2018-04-07 09:10:29 +10:00
Andrew Tridgell
382772d999 HAL_ChibiOS: initial support for ESC serial output 2018-04-07 09:10:29 +10:00
Andrew Tridgell
dcfec21b46 AP_HAL: added support for serial output to ESCs 2018-04-07 09:10:29 +10:00
Andrew Tridgell
80a1688361 AP_Motors: make a singleton
this is used by AP_ESCSerial
2018-04-07 09:10:29 +10:00
Andrew Tridgell
17f2f40b11 AP_Math: added xmodem CRC
used by blheli 4-way ESC protocol
2018-04-07 09:10:29 +10:00
Andrew Tridgell
2933d4dd35 HAL_PX4: handle MODE_PWM_NONE enum 2018-04-07 09:10:29 +10:00
Andrew Tridgell
3c5c77889c HAL_VRBRAIN: fixed build with DShot 2018-04-07 09:10:29 +10:00
Andrew Tridgell
a9b4d37bd2 HAL_PX4: fixed build with DShot 2018-04-07 09:10:29 +10:00
Andrew Tridgell
26d279e165 HAL_ChibiOS: improve DShot timing accuracy 2018-04-07 09:10:29 +10:00
Andrew Tridgell
93111dc0b1 HAL_ChibiOS: ensure that IO UART gets DMA 2018-04-07 09:10:29 +10:00
Andrew Tridgell
bd9df6d0ec AP_Motors: added DShot to parameter docs 2018-04-07 09:10:29 +10:00
Andrew Tridgell
95a261e061 HAL_ChibiOS: don't generate DMA channels for ALARM pin 2018-04-07 09:10:29 +10:00
Andrew Tridgell
01e9c55721 HAL_ChibiOS: fixed SPI bus speed on SPI3
and add optional bootup test of SPI bus speeds to help with porting to
new MCUs
2018-04-07 09:10:29 +10:00
Andrew Tridgell
5f29524a41 AP_Radio: fixed optimisation of AP_Radio drivers 2018-04-07 09:10:29 +10:00
Andrew Tridgell
e55d3a0834 AP_Motors: fix mask passed to rc_set_freq
the full motor mask must be supplied to work correctly for oneshot and
dshot
2018-04-07 09:10:29 +10:00
Andrew Tridgell
610a6a6c88 HAL_ChibiOS: optimise USB config driver 2018-04-07 09:10:29 +10:00
Andrew Tridgell
bc32276966 HAL_ChibiOS: support DShot output
use DMAR burst DMA to minimise number of DMA channels needed

thanks to betaflight for the great reference implementation!
2018-04-07 09:10:29 +10:00
Andrew Tridgell
294aac6955 HAL_ChibiOS: fixed CTS pulldown
we need to pulldown to prevent delays in uart sends
2018-04-07 09:10:29 +10:00
Andrew Tridgell
a64819cbf2 HAL_ChibiOS: minimise DMA TX latency on contended UARTs
try to prevent long delays on other users of a DMA channel
2018-04-07 09:10:29 +10:00
Andrew Tridgell
a86e85c6b2 HAL_ChibiOS: enable checking for DMA contention 2018-04-07 09:10:29 +10:00
Andrew Tridgell
0fb4e4720d AP_HAL_VRBRAIN: added mask to set_output_mode()
this allows for some groups using dshot and some not
2018-04-07 09:10:29 +10:00
Andrew Tridgell
25cc73c1e7 AP_HAL_PX4: added mask to set_output_mode()
this allows for some groups using dshot and some not
2018-04-07 09:10:29 +10:00
Andrew Tridgell
4fb53d44f3 AP_HAL_F4Light: added mask to set_output_mode()
this allows for some groups using dshot and some not
2018-04-07 09:10:29 +10:00
Andrew Tridgell
2c84d77306 AP_Motors: setup for DShot output modes 2018-04-07 09:10:29 +10:00
Andrew Tridgell
e7dc304f4e AP_HAL: support DShot output modes 2018-04-07 09:10:29 +10:00
Andrew Tridgell
64278f07d3 HAL_ChibiOS: removed the DMA channels from RCIN in hwdef.dat
no longer needed as this is automatic now
2018-04-07 09:10:29 +10:00
Andrew Tridgell
9a5df6d1f7 HAL_ChibiOS: auto-generate DMA channels for RCIN
and add DMA channels for TIMx_UP ready for DMAR based DShot support
2018-04-07 09:10:29 +10:00
Andrew Tridgell
6aff7ecbf5 HAL_ChibiOS: added channel numbers for STM32F4xx MCUs 2018-04-07 09:10:29 +10:00
Andrew Tridgell
da2e79130b HAL_ChibiOS: generate channel numbers in DMA tables 2018-04-07 09:10:29 +10:00
Andrew Tridgell
3501763f4e HAL_ChibiOS: added DShot example app 2018-04-07 09:10:29 +10:00
Randy Mackay
64be134f7b GCS_MAVLink: add VISP logging 2018-04-06 11:13:28 +09:00
Tom Pittenger
f03c73aeff AP_Terrain: compiler warning printing %u with signed value 2018-04-06 07:40:37 +09:00
Peter Barker
b77d4ad82a AP_InertialNav: remove dead get_hagl method 2018-04-05 17:35:55 +09:00
Randy Mackay
a8857726d1 AR_AttitudeControl: replace get_steering_out_angle_error with heading
internally uses AHRS's heading to determine angle error so overally a non-functional change
2018-04-05 12:14:59 +09:00
Randy Mackay
4f0b26bd48 AP_L1_Control: update_waypoint gets dist_min argument
L1_dist can become extremely short for slow moving vehicles leading to unnecessarily jerk turns after passing waypoints.  This reduces the minimum length along the track that the vehicle will point.
2018-04-05 12:14:59 +09:00
Randy Mackay
e6f8021519 AR_AttitudeControl: add angular accel and rate limits
This limits the change in desired turn rate to reduce impossible requests which should help avoid overshoot
Also add rotation rate limit to turn-rate controller
2018-04-05 12:14:59 +09:00
Peter Barker
3d84dfcc2e DataFlash: remove unused ins error count logging 2018-04-04 14:21:20 +01:00
Peter Barker
c4ea83177f AP_Scheduler: remove unused ins error count logging 2018-04-04 14:21:20 +01:00
Peter Barker
be634a893f AP_InertialSensor: remove unused ins error count logging 2018-04-04 14:21:20 +01:00
Peter Barker
81044760c7 AP_NavEKF2: const accessors 2018-04-04 12:20:36 +01:00
Peter Barker
aca87ab638 AP_InertialSensor: remove pointless initialisations
AP_InertialSensor: avoid pointless zeroing in constructor

AP_InertialSensor is either in bss or is created via new (which zeroes
memory)
2018-04-04 12:14:02 +01:00
Peter Barker
355752ebb8 AP_AHRS: remove pointless initialisations
These are either in bss or new'd.

Saves ~130 bytes
2018-04-04 10:14:40 +01:00
Peter Barker
51991fdd76 AP_Proximity: fix compilation warning in LightWare driver
../../libraries/AP_Proximity/AP_Proximity_LightWareSF40C.cpp: In member
function ‘void AP_Proximity_LightWareSF40C::request_new_data()’:
../../libraries/AP_Proximity/AP_Proximity_LightWareSF40C.cpp:235:6:
warning:
‘__builtin___snprintf_chk’ output may be truncated before the last
format
character [-Wformat-truncation=]
 void AP_Proximity_LightWareSF40C::request_new_data()
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:862:0,
                 from ../../libraries/AP_Common/AP_Common.h:179,
                 from ../../libraries/AP_HAL/UARTDriver.h:5,
                 from ../../libraries/AP_HAL/HAL.h:11,
                 from ../../libraries/AP_HAL/AP_HAL_Main.h:19,
                 from ../../libraries/AP_HAL/AP_HAL.h:8,
                 from
../../libraries/AP_Proximity/AP_Proximity_LightWareSF40C.cpp:16:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:65:44: note:
‘__builtin___snprintf_chk’ output between 10 and 16 bytes into a
destination
of size 15
        __bos (__s), __fmt, __va_arg_pack ());
                                            ^
../../libraries/AP_Proximity/AP_Proximity_LightWareSF40C.cpp: In member
function ‘bool
AP_Proximity_LightWareSF40C::send_request_for_distance()’:
../../libraries/AP_Proximity/AP_Proximity_LightWareSF40C.cpp:275:6:
warning:
‘__builtin___snprintf_chk’ output may be truncated before the last
format
character [-Wformat-truncation=]
 bool AP_Proximity_LightWareSF40C::send_request_for_distance()
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:862:0,
                 from ../../libraries/AP_Common/AP_Common.h:179,
                 from ../../libraries/AP_HAL/UARTDriver.h:5,
                 from ../../libraries/AP_HAL/HAL.h:11,
                 from ../../libraries/AP_HAL/AP_HAL_Main.h:19,
                 from ../../libraries/AP_HAL/AP_HAL.h:8,
                 from
../../libraries/AP_Proximity/AP_Proximity_LightWareSF40C.cpp:16:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:65:44: note:
2018-04-04 18:04:57 +09:00
Peter Barker
b7f1040dca DataFlash: do not log beacon if it is disabled 2018-04-04 16:20:33 +09:00
Randy Mackay
f6cf52a748 AC_Loiter: move defines to cpp 2018-04-04 10:45:10 +09:00
Randy Mackay
757a35f3ba AC_Loiter: consolidate sanity checks 2018-04-04 10:45:10 +09:00
Randy Mackay
9de73a994f AC_Circle: add get distance and bearing to target 2018-04-04 10:45:10 +09:00
Randy Mackay
9426ee6df6 AC_WPNav: remove loiter
Loiter is in separate AC_Loiter class
2018-04-04 10:45:10 +09:00
Randy Mackay
0ba22a1feb AC_WPNav: remove brake dependency on loiter 2018-04-04 10:45:10 +09:00
Randy Mackay
cc5ad7c004 AC_Loiter: loiter extracted from AC_WPNav 2018-04-04 10:45:10 +09:00
Alexey Bulatov
4d08ec8c85 AP_HAL: Edge: set storage directory to /edge/ardupilot 2018-04-04 09:29:16 +09:00
Francisco Ferreira
ac73fa9681
GCS_MAVLink: fix method shadowing 2018-04-03 16:29:33 +01:00
Peter Barker
4db9a5e6fe AP_HAL_SITL: remove cast to signed type
... we're currently taking an unsigned type, casting it to a signed type
and then comparing the result of that to an unsigned type.  That's
unhealthy.
2018-04-03 13:08:56 +01:00
Peter Barker
4fd2ec1cef GCS_MAVLink: factor vehicle's mavlink send_heartbeat 2018-04-03 13:05:19 +01:00
Michael du Breuil
a21eb12f9e AP_GPS: Correct HIL_GPS altitude conversion 2018-04-02 20:21:20 -07:00
Pierre Kancir
2b2c1e2d78 AP_NavEKF3: only use bcn EKF is the alignement as been completed 2018-04-03 09:55:13 +09:00
Pierre Kancir
44a21bc8ac EKF3: correct acos to acosf 2018-04-03 09:54:45 +09:00
Pierre Kancir
48c5a9b9c5 AP_NavEKF3: style change in BCN mesurements 2018-04-03 09:54:43 +09:00
Pierre Kancir
4d2f2a2aad AP_NavEKF3: correct flag in case of GPS disable 2018-04-03 09:54:41 +09:00
Peter Barker
1f862e8192 GCS_MAVLink: serial control: avoid nullptr dererences 2018-04-02 23:29:33 +01:00
Tom Pittenger
b864cd6ae6 AP_HAL_ChibiOS: include correct wrappers 2018-04-03 08:27:44 +10:00
Peter Barker
30f944b921 AP_AirSpeed: notify of calibration start 2018-04-02 23:25:05 +01:00
Peter Barker
d2ab76b2c6 GCS_MAVLink: calibrate airspeed sensor if it is present 2018-04-02 23:25:05 +01:00
Peter Barker
c6d7f5151a GCS_MAVLink: tidy handling of barometer calibrations 2018-04-02 23:25:05 +01:00
Peter Barker
1de68b78dc AP_Barometer: tidy handling of barometer calibrations 2018-04-02 23:25:05 +01:00
Peter Barker
d878690d00 GCS_MAVLink: move common calibration functions up 2018-04-02 23:25:05 +01:00
Peter Barker
2396a248ed AP_InertialSensor: use ahrs singleton for simple accelcal 2018-04-02 23:25:05 +01:00
Peter Barker
f6b7ca75e9 GCS_MAVLink: allow Plane to override method so it can set calib. flag 2018-04-02 23:25:05 +01:00
Peter Barker
09d4e36970 GCS_MAVLink: handle preflight calibrations 2018-04-02 23:25:05 +01:00
Peter Barker
c3e70e477d GCS_MAVLink: avoid using global chan to uart mapping
This is an instance method, so it has a pointer to its own
uart
2018-04-02 23:04:24 +01:00
Peter Barker
3781d2f2eb AP_SmartRTL: use ahrs singleton 2018-04-02 17:16:02 +01:00
Peter Barker
e33ce5eb48 AP_Follow: use ahrs singleton 2018-04-02 17:16:02 +01:00
Peter Barker
ac99d37bc1 DataFlash: correct logging interval of XKFD message 2018-04-02 14:12:09 +09:00
Peter Barker
32795f0a8f AP_Param: correct possible use of nullptr during param count
::first can return nullptr
2018-04-02 14:12:09 +09:00
Peter Barker
ac283fb032 DataFlash: narrow enumeration to uint8_t to avoid narrowing-warnings
/home/pbarker/rc/ardupilot/libraries/DataFlash/LogFile.cpp:1571:32:
error: non-constant-expression cannot be narrowed from type 'enum
LogMessages' to 'uint8_t' (aka 'unsigned char') in initializer list
[-Wc++11-narrowing]
        LOG_PACKET_HEADER_INIT(type),
2018-04-02 14:12:09 +09:00
Peter Barker
febcdd766b AP_Math: narrow enumeration to uint8_t to avoid narrowing-warnings
/home/pbarker/rc/ardupilot/libraries/DataFlash/LogFile.cpp:361:25:
error: non-constant-expression cannot be narrowed from type 'enum
Rotation' to 'uint8_t' (aka 'unsigned char') in initializer list
[-Wc++11-narrowing]
        orient1       : s0 ? s0->orientation() : ROTATION_NONE,
2018-04-02 14:12:09 +09:00
Peter Barker
2a274675f6 AP_AHRS: narrow enumeration to uint8_t to avoid narrowing-warnings 2018-04-02 14:12:09 +09:00
Peter Barker
871661c65f SITL: SIM_Vicon: use existing channel for packing messages
Also correct sending of Vicon message; too many bytes were sent
2018-04-02 09:23:27 +09:00
Peter Barker
42547d2d6d GCS_MAVLink: allow extra mavlink port for packing vicon messages 2018-04-02 09:23:27 +09:00
Peter Barker
7d271e0f3c AP_HAL_SITL: check return value of setsockopt 2018-04-02 09:23:27 +09:00
Michael du Breuil
5bd4091976 AP_HAL_SITL: Protect against nullpointer dereference 2018-03-31 16:15:48 +09:00
Peter Barker
c627ed6ae3 RangeFinder: remove divide-by-zero possibility 2018-03-31 16:14:09 +09:00
Randy Mackay
57f2eb6853 AR_AttitudeControl: minor comment fix 2018-03-31 14:47:30 +09:00
Randy Mackay
032b4373f6 AC_WPNav: removed brake's unused dt calc 2018-03-31 13:42:59 +09:00
Michael du Breuil
334ff0fb66 AC_AttitudeControl: Prevent DCM fallback from triggering a flyaway 2018-03-31 13:40:52 +09:00
Randy Mackay
428682c8e9 GCS_MAVLink: fix handling of global_vision_position_estimate 2018-03-30 18:21:48 +09:00
Dr.-Ing. Amilcar do Carmo Lucas
2f59572d42 AP_Beacon: Use multiplications instead of divisions in Marvelmind 2018-03-29 11:46:20 -07:00
Peter Barker
994e3e7092 SITL: SIM_Vicon: fix compiler warning 2018-03-29 16:45:34 +09:00
Dr.-Ing. Amilcar Do Carmo Lucas
24c1b0890d AP_BattMonitor: NFC improve coments 2018-03-28 17:01:33 +09:00