Commit Graph

12449 Commits

Author SHA1 Message Date
Tom Pittenger
1586abab8d Revert "AP_Airspeed: Converted library to be stand-alone from APM:Plane."
This reverts commit 5439257236.
2016-08-07 17:54:24 -07:00
Tom Pittenger
82777873af Revert "APM_Control: Convert references to AP_Airspeed."
This reverts commit cc5a2417a6.
2016-08-07 17:54:24 -07:00
Tom Pittenger
e5bd23e34a Revert "AP_TECS: Convert references to AP_Airspeed."
This reverts commit 09d53eaeca.
2016-08-07 17:54:24 -07:00
Tom Pittenger
44037c13a1 Revert "AP_Vehicle: Removed unused airspeed_min and airspeed_max as now part of AP_Airspeed."
This reverts commit bf7ab052c1.
2016-08-07 17:54:24 -07:00
Tom Pittenger
8dad05d12e Revert "Airspeed: store reference in libraries and populate it"
This reverts commit c090ba2257.
2016-08-07 17:54:24 -07:00
LukeMike
5987cc273f AP_HAL_VRBRAIN: added some new modules for I2C wrapper 2016-08-07 20:31:52 +10:00
LukeMike
7ee8898948 AP_BoardConfig: updated defines for VRBRAIN 2016-08-07 20:31:52 +10:00
LukeMike
95ae69eb1c VRBRAIN /AP_BoardConfig: changed definition of PWM_SERVO_MODE_12PWM only for VRBRAIN 2016-08-07 20:31:52 +10:00
LukeMike
024d3311b3 VRBRAIN / AP_BoardConfig: enabled PWM configuration and safety management for all VirtualRobotix boards 2016-08-07 20:31:51 +10:00
LukeMike
9f8b66758c VRBRAIN / AP_OpticalFlow: enabled OpticalFlow_PX4 for all VirtualRobotix boards 2016-08-07 20:31:51 +10:00
LukeMike
6748bdb1a4 AP_Notify/ExternalLED: added HIGH and LOW definition 2016-08-07 20:31:51 +10:00
LukeMike
858c22ae21 VRBRAIN /AP_Notify: enabled tone_alarm for all VirtualRobotix boards 2016-08-07 20:31:51 +10:00
LukeMike
13e3150023 VRBRAIN / AP_HAL_Boards: definition of new board VR Brain 5.4 and VR Core 1.0 2016-08-07 20:31:51 +10:00
LukeMike
b5cf0308cd VRBRAIN / AP_BattMonitor_Analog: definition of default value for battery monitor for all VirtualRobotix boards 2016-08-07 20:31:51 +10:00
LukeMike
4d8e7f1783 VRBRAIN / AP_Airspeed: defined ARSPD_DEFAULT_PIN for VR Brain 5.4 and VR Core 1.0 2016-08-07 20:31:51 +10:00
LukeMike
d8cc2668cb VRBRAIN / AP_AHRS_NavEKF: set AP_AHRS_WITH_EKF1 to 1 only for VR Brain 5.4 2016-08-07 20:31:51 +10:00
LukeMike
998033286d AP_HAL_PX4 / Semaphores: removed AP_HAL_VRBRAIN (for now it's better to have different AP_HAL for PX4 and VRBRAIN) 2016-08-07 20:31:50 +10:00
LukeMike
fde5992b6d VRBRAIN: updated AP_HAL_VRBRAIN 2016-08-07 20:31:50 +10:00
Leonard Hall
34055944cd AC_PosControl: fix relax_alt_hold_controllers 2016-08-05 12:40:37 +09:00
Randy Mackay
24044e5611 AC_AttControl: get_throttle_avg_max always returns value in 0 to 1 range
throttle_avg_max is the total average throttle level (expressed as a number from 0 to 1) that the motors can safely be raised to in order to maintain attitude control.  This level can be higher than the pilot's or autopilot provided throttle level.
Previously passing in a negative throttle_in could result in a negative throttle_avg_max being returned.
2016-08-05 12:40:37 +09:00
Leonard Hall
ac04fcd836 AC_AttControl: fix set_yaw_target_to_current_heading 2016-08-05 12:40:37 +09:00
Leonard Hall
011bc0a350 AC_AttControl: add reset_rate_controller_I_terms() 2016-08-05 12:40:37 +09:00
Tom Pittenger
e63e7a5336 AP_NavEKF: comment that param "Enable" index is moved to top 2016-08-04 11:32:46 -07:00
Tom Pittenger
9b33280795 APM_OBC: set param "Enable" to be FLAG_ENABLE and move to top 2016-08-04 11:32:02 -07:00
Tom Pittenger
28648665b9 AP_Terrain: set param "Enable" to be FLAG_ENABLE 2016-08-04 11:31:37 -07:00
Tom Pittenger
ebe829614d AP_Parachute: set param "Enable" to be FLAG_ENABLE 2016-08-04 11:31:21 -07:00
Tom Pittenger
b1ef848de6 AP_EPM: set param "Enable" to be FLAG_ENABLE 2016-08-04 11:30:50 -07:00
Tom Pittenger
0d14941eea AP_Avoidance: set param "Enable" to be FLAG_ENABLE 2016-08-04 11:30:39 -07:00
Tom Pittenger
c07b85f9bb AP_Airspeed: set param "Enable" to be FLAG_ENABLE 2016-08-04 11:30:22 -07:00
Tom Pittenger
dd5ed7e2e0 AC_Sprayer: set param "Enable" to be FLAG_ENABLE 2016-08-04 11:30:03 -07:00
Tom Pittenger
ccb0151816 AC_PrecLand: set param "Enable" to be FLAG_ENABLE 2016-08-04 11:29:45 -07:00
Tom Pittenger
5e811b8463 AC_Fence: set param "Enable" to be FLAG_ENABLE 2016-08-04 11:29:30 -07:00
Tom Pittenger
c090ba2257 Airspeed: store reference in libraries and populate it
- also had to move the initial definition in plane.h so it happened before the others.
2016-08-04 11:06:44 -07:00
AndersonRayner
bf7ab052c1 AP_Vehicle: Removed unused airspeed_min and airspeed_max as now part of AP_Airspeed. 2016-08-04 10:09:04 -07:00
AndersonRayner
09d53eaeca AP_TECS: Convert references to AP_Airspeed. 2016-08-04 10:09:04 -07:00
AndersonRayner
cc5a2417a6 APM_Control: Convert references to AP_Airspeed. 2016-08-04 10:09:04 -07:00
AndersonRayner
5439257236 AP_Airspeed: Converted library to be stand-alone from APM:Plane.
Additional changes:
   ARSPD_FBW_MIN and ARSPD_FBW_MAX renamed to ARSPD_MIN and ARSPD_MAX
   ARSPD_MIN and ARSPD_MAX changed to floats
2016-08-04 10:09:04 -07:00
Andrew Tridgell
66c4995c9d AP_Motors: added get_desired_spool_state() 2016-08-04 09:43:40 -07:00
murata
b6c27b58a8 AC_Fence: magic number 4 changed to size of uint32_t 2016-08-04 15:26:18 +09:00
Pavel Kirienko
9b786559d4 Fixed missing definition error UAVCAN_IOCS_HARDPOINT_SET 2016-08-04 09:16:02 +10:00
Pavel Kirienko
fccdcf50c1 EPM: fixed build 2016-08-04 09:16:02 +10:00
Pavel Kirienko
8af6af004d EPM: fixed parameter comments 2016-08-04 09:16:02 +10:00
Pavel Kirienko
accf118e38 UAVCAN hardpoint control 2016-08-04 09:16:02 +10:00
Murilo Belluzzo
077e03678f Global: Adapt Stream class to be used with Ringbuffer 2016-08-03 01:44:02 -03:00
Murilo Belluzzo
b856d26087 RingBuffer: ::set_size now returns true or false 2016-08-03 01:44:02 -03:00
Murilo Belluzzo
f7f203efa9 RingBuffer: Add ::clear() method to discard the buffer content
The same could be achieved with ::set_size(::get_size()), but was not
obvious and hurts code readability.
2016-08-03 01:44:02 -03:00
Murilo Belluzzo
75a1b102fb RingBuffer: Handle zero sized better
Sometimes (like in DataFlash) the size of the ring buffer will be
determined in run time and the object can have size zero until proper
initialization. When this was the case, an underflow in ::get_size would
mess with the initializing algorithm.

Another issue was that the 'new' operator could fail what was not being
handled. Now, we only set the size member after we are sure 'new'
successfully allocated memory.
2016-08-03 01:44:02 -03:00
Murilo Belluzzo
fe48901db0 AP_ADC_ADS1115: Remove resource leak.
Constructor allocate '_samples' but there was no destructor to
deallocate it. Also, initializes '_gain' to silence CID 9144 although
'_gain' wasn't being used uninitialized because of ::init().

CID 91424
2016-08-03 00:24:55 -03:00
Murilo Belluzzo
36bdd7f1f1 AP_InertialSensor: MPU6000: Add missing read() check 2016-08-03 00:18:20 -03:00
Lucas De Marchi
0d4caa3ccc AP_Math: remove declaration of not implemented functions 2016-08-03 00:16:35 -03:00
Murilo Belluzzo
70942472d3 AP_Math: Matrix: Change deallocator to match allocator used 2016-08-03 00:09:11 -03:00
Murilo Belluzzo
e17fdb2aa9 DataFlash: Avoid null pointer dereference
Confirms that the loop successfully found a log structure before using it.

Should fix CID 126742
2016-08-03 00:02:19 -03:00
Holger Steinhaus
cc4fafc3e4 AP_GPS_PX4: fixed GPS epoch calculations 2016-08-02 11:20:48 +10:00
Tom Pittenger
282817eeb9 AP_ADSB: revert default enable = 0 2016-08-01 17:56:04 -07:00
Tom Pittenger
b5ec37b9d8 AP_ADSB: change adsb.enable param to be a flag 2016-08-01 17:51:24 -07:00
Tom Pittenger
2be32e9daa AP_ADSB: remove all threat logic in adsb lib in favor of avoidance lib 2016-08-01 15:27:40 -07:00
Tom Pittenger
b2b63b4d80 AP_ADSB: change param ADSB_ENABLE default from 0 to 1 2016-08-01 15:27:39 -07:00
Tom Pittenger
89271c29ab AP_ADSB: move variable into struct like the rest 2016-08-01 15:27:38 -07:00
Tom Pittenger
f7c2df8e91 AP_ADSB: sanity check data via valid_flags before forwarding to avoidance lib 2016-08-01 12:47:18 -07:00
Tom Pittenger
5c0b5f5cd1 AP_ADSB: reject packets that are invalid or already stale 2016-08-01 12:44:20 -07:00
Tom Pittenger
b12edf6a71 AP_ADSB: fix bug where the update timeout wasn't being stored correctly
- causes immediate timeout so all samples were dropped
- now the timeout is current and respects the time-since-last-comms/packet so we can ignore stale packets
2016-08-01 12:43:47 -07:00
Tom Pittenger
e0bb77726e AP_ADSB: do not service transceiver if it is not detected
- also allow forced detected (setting chan in header) for testing by not having it time out in that special case (timer = 0)
2016-08-01 09:06:05 -07:00
Peter Barker
2844190e5b AP_RangeFinder: correct DisplayName comments 2016-08-01 09:55:25 -03:00
Peter Barker
1bb73383ec AP_RangeFinder: group _ADDR with other first-rangefinder params 2016-08-01 09:55:24 -03:00
Peter Barker
d5ffc8a863 AP_RangeFinder: define 3_ADDR when we have three rangefinders
Without this patch this field would only be defined when 4 rangefinders
were specified
2016-08-01 09:55:24 -03:00
Randy Mackay
d5c18dc987 AC_AttControl: remove unused 100hz definition 2016-08-01 17:21:04 +09:00
Randy Mackay
2dc111ff39 Copter: reduce WPNAV_LOIT_MINA parameter description range 2016-08-01 17:09:20 +09:00
Randy Mackay
7d0cac15fb AP_ICEngine: add casting to avoid compiler warnings 2016-08-01 09:41:32 +09:00
Lucas De Marchi
e217faacab AP_Baro: MS56XX: cosmetic changes to members
- reorder and document members.
    - remove tentative of vertical alignement
    - like was done for accumulated values, move the calibration
      values to a struct
2016-07-30 00:55:28 -03:00
Lucas De Marchi
f7b453359d AP_Baro: MS56XX: convert to threaded bus
This converts MS56XX to use the thread started by SPI/I2C instead of
using the timer thread. This also fixes a possible starvation of the
main thread:

    1) INS driver registers itself to be sampled on timer thread
    2) MS56XX registers itself to be sampled on timer thread
    3) Main thread waits for a sample from INS with
       ins.wait_for_sample()
    4) timer thread is waiting on update from MS56XX and consequently
       the main thread is waiting on an I2C/SPI transfer

Besides this starvation there's another one due to reuse of the timer
lock in order to pump values from the timer thread to the main thread. A
call to the update() method when we have a sample available would need
to wait on any other driver holding the timer lock.

Now there's a lock just to pass the new values from the bus thread to
the main thread with a very tiny critical region, not waiting on any
bus transfers and/or syscalls.
2016-07-30 00:55:28 -03:00
Lucas De Marchi
052f30bc70 AP_HAL: remove macros to use MS5611 in the main thread 2016-07-30 00:55:28 -03:00
Lucas De Marchi
929348ff75 AP_Baro: MS5611: always use timer thread
Remove support to run MS5611 on main thread since we shouldn't be doing
I2C transactions there and we are moving to "thread per bus"
nonetheless.
2016-07-30 00:55:28 -03:00
Lucas De Marchi
7b7e73680f AP_Math: add USEC_PER_MSEC 2016-07-30 00:55:28 -03:00
Lucas De Marchi
8541d5339d AP_HAL_Linux: Implement threaded SPI 2016-07-30 00:55:27 -03:00
Lucas De Marchi
ea0595c7ac AP_HAL_Linux: SPIDevice: move implementation to outside
As we add methods, it's becoming too complex to be implemented together
with the declaration.
2016-07-30 00:55:27 -03:00
Lucas De Marchi
590539f674 AP_HAL_Linux: implement threaded I2C 2016-07-30 00:55:27 -03:00
Lucas De Marchi
11ddbb8fb8 AP_HAL_Linux: add PollerThread
This is the infrastructure needed by both SPIDevice and I2CDevice to
start a poller thread per bus.
2016-07-30 00:55:27 -03:00
Lucas De Marchi
7d451ac876 AP_HAL_Linux: allow to check if thread is running 2016-07-30 00:55:27 -03:00
Lucas De Marchi
eca6f45b68 AP_HAL_Linux: remove unused part of Poller infra
We aren't going to use all the poller infra for now and we need it's
behavior a little bit different for what we are going to use:

    - Do not use any "fair" time for each ready fd since we don't want
      to set a timeout
    - Allow to set the fd on Pollable after constructing it since we are
      likely to embed Pollable inside other structs and just later be
      able to open an fd.
    - Let caller use the epoll flags directly - this is not in AP_HAL,
      so there's no need to abstract them
2016-07-30 00:55:27 -03:00
Leandro Pereira
0f865a019a AP_HAL_Linux: Add Pollable/Poller
Add system's polling infrastructure to be notified whenever a
file descriptor is ready to be read from or written to.

Adds a few classes:
  * Poller, as an interface to epoll()
  * Pollable, as an interface to a file descriptor
2016-07-30 00:55:27 -03:00
Lucas De Marchi
c859c5ecd9 AP_HAL_PX4: update Device interface 2016-07-30 00:55:27 -03:00
Lucas De Marchi
eaa1c39a15 AP_HAL_Linux: update Device interface 2016-07-30 00:55:27 -03:00
Lucas De Marchi
7669d54265 AP_HAL_Empty: update Device interface 2016-07-30 00:55:27 -03:00
Lucas De Marchi
37de995960 AP_HAL: update Device interface for periodic tasks
Replace the previous not-implemented interface with a set of new methods
that can be resonably implemented:

    - register_periodic_callback() now receives a functor returning bool
      to easily allow "oneshot" timers

    - adjust_periodic_callback() allows the caller to change the timer
      for a specific handle. This way drivers like MS5611 can adjust the
      timer depending on its state machine: the time to sample
      temperature is smaller than the time to get a pressure sample

    - add unregister_callback(): since we have an opaque pointer, we
      can't tell the user to just delete it in order to unregister the
      callback
2016-07-30 00:55:27 -03:00
Lucas De Marchi
8e5aba8653 AP_HAL_Linux: I2CDevice: move implementation to outside
As we add methods, it's becoming too complex to be implemented together
with the declaration.
2016-07-30 00:55:27 -03:00
Lucas De Marchi
7b39f3d0a7 AP_HAL_Linux: do not warn for empty table
../../libraries/AP_HAL_Linux/SPIDevice.cpp: In member function ‘virtual AP_HAL::OwnPtr<AP_HAL::SPIDevice> Linux::SPIDeviceManager::get_device(const char*)’:
../../libraries/AP_HAL_Linux/SPIDevice.cpp:337:27: warning: comparison is always false due to limited range of data type [-Wtype-limits]
     for (uint8_t i = 0; i < _n_device_desc; i++) {
                         ~~^~~~~~~~~~~~~~~~

Define a dummy device to remove warning.
2016-07-30 00:03:23 -03:00
Lucas De Marchi
f37a560295 AP_HAL_Linux: remove private headers
This centralized private header encourages centralizing things on
umbrella headers that are a pain to maintain. Force each part of
AP_HAL_Linux to include what is used.
2016-07-29 20:29:46 -03:00
Lucas De Marchi
e8f71a5bd2 AP_HAL_Linux: change define and members visibility
Make some member variables protected to follow what we do in other
places (and there's no reason to be private).

Move defines to .cpp to reduce their visibility.
2016-07-29 20:27:12 -03:00
Lucas De Marchi
f36e8d9c05 AP_HAL_Linux: remove AP_HAL_Linux_Namespace header
This centralized namespace header encourages centralizing things on
umbrella headers that are a pain to maintain. Force each part of
AP_HAL_Linux to include what is used.

While at it, do some whitespace cleanups and minor changes to adhere to
coding style.
2016-07-29 20:25:03 -03:00
Lucas De Marchi
b044fac4b6 AP_HAL_Linux: rename variable to follow I2CDevice convention 2016-07-29 15:01:15 -03:00
Lucas De Marchi
57ec968b44 AP_HAL: remove SPIDriver
SPIDevice now controls all accesses to SPI bus.
2016-07-29 15:01:15 -03:00
Lucas De Marchi
dc91dfb446 AP_HAL_Empty: remove SPIDriver
SPIDevice now controls all accesses to SPI bus.
2016-07-29 15:01:15 -03:00
Lucas De Marchi
7b140da6d1 AP_HAL_Linux: remove SPIDriver
SPIDevice now controls all accesses to SPI bus.
2016-07-29 15:01:15 -03:00
Lucas De Marchi
5ab1c6ff51 AP_ADC: remove ADS7844
It's not used by any board.
2016-07-29 15:01:15 -03:00
Lucas De Marchi
ef81e71afa AP_ADC: remove example tailored to a single ADC
This is the only user of ADS7844 - we don't have it actually used in our
boards. Remove the example since we can later add a more generic one or
at least one that reuses a driver from our boards.
2016-07-29 15:01:15 -03:00
Lucas De Marchi
3a5e8a17c7 AP_HAL: remove enum id for Ublox and RASPIO 2016-07-29 15:01:15 -03:00
Lucas De Marchi
945556bbc3 AP_HAL_Linux: remove id for SPIDevice_Ublox and RASPIO 2016-07-29 15:01:15 -03:00
Lucas De Marchi
065592e7df AP_HAL_Linux: SPIUARTDriver: add some cosmetic changes
Mainly changes to follow the coding style and reduce the complexity a
little bit.
2016-07-29 15:01:15 -03:00
Lucas De Marchi
e3c0476b8a AP_HAL_Linux: SPIUARTDriver: initialize device once 2016-07-29 15:01:14 -03:00
Lucas De Marchi
418cc817a3 AP_HAL_Linux: SPIUARTDriver: fix conversion to SPIDevice
We need to use the fullduplex method to transfer both tx and rx at the
same time.
2016-07-29 15:01:14 -03:00
Lucas De Marchi
cbbd6f9d78 AP_HAL_Linux: SPIDevice: implement fullduplex transfer 2016-07-29 15:01:14 -03:00
Lucas De Marchi
9fda608d4a AP_HAL_Empty: SPIDevice: implement fullduplex transfer 2016-07-29 15:01:14 -03:00
Lucas De Marchi
01452bf922 AP_HAL: SPIDevice: add fullduplex method
This method is needed when we want to transfer both tx and rx at the
same time, as opposed to common cases for sensors in which they are like
in the I2C interface: half-duplex.
2016-07-29 15:01:14 -03:00
Luiz Ywata
7ded01cf24 AP_HAL_Linux: SPIUARTDriver: use SPIDevice interface 2016-07-29 15:01:14 -03:00
Luiz Ywata
c8bb5e6469 AP_HAL_Linux: RCInput_Raspilot use SPIDevice interface 2016-07-29 15:01:14 -03:00
Luiz Ywata
e8d3229492 AP_HAL_Linux: RPIOUARTDriver: use SPIDevice interface 2016-07-29 15:01:14 -03:00
Luiz Ywata
bfd840c5ca AP_HAL_Linux: RCOutput_Raspilot: use SPIDevice interface 2016-07-29 15:01:14 -03:00
Lucas De Marchi
86ac9bc367 AP_HAL_Linux: AnalogIn_Raspilot: use SPIDevice interface 2016-07-29 14:47:04 -03:00
Lucas De Marchi
81345cc112 AP_HAL: Remove enum for Dataflash 2016-07-29 14:47:04 -03:00
Lucas De Marchi
8681d23cbd AP_HAL_Linux: remove unused Dataflash
This is selectable by a define and is never changed. Just remove
everything referencing it: we can come up with a better solution if it
is actually used later.
2016-07-29 14:47:04 -03:00
Peter Barker
9749b91d46 SITL: initialise sigaction structs - valgrind fix 2016-07-29 10:38:03 -03:00
Jonathan Challinger
d1ecc63bf1 AP_NavEKF2: change priority of statustext messages 2016-07-29 13:19:51 +09:00
Lucas De Marchi
1841313f73 AP_HAL_VRBRAIN: remove I2CDriver
I2CDevice now serves for the same purpose.
2016-07-28 18:08:57 -03:00
Lucas De Marchi
d418338e22 AP_HAL_SITL: remove I2CDriver
I2CDevice now serves for the same purpose.
2016-07-28 18:08:57 -03:00
Lucas De Marchi
13848f0f3f AP_HAL_QURT: remove I2CDriver
I2CDevice now serves for the same purpose.
2016-07-28 18:08:57 -03:00
Lucas De Marchi
2ef78051c1 AP_HAL_PX4: remove I2CDriver
I2CDevice now serves for the same purpose.
2016-07-28 18:08:56 -03:00
Lucas De Marchi
73bb371918 AP_HAL_Linux: remove I2CDriver
I2CDevice now serves for the same purpose.
2016-07-28 18:08:56 -03:00
Lucas De Marchi
3eb0a48d59 AP_HAL_Empty: remove I2CDriver
I2CDevice now serves for the same purpose.
2016-07-28 18:08:56 -03:00
Lucas De Marchi
b21ad36676 AP_HAL: remove I2CDriver 2016-07-28 18:08:56 -03:00
Lucas De Marchi
8f11bf7373 AP_ADC: ADS1115: fix typo 2016-07-28 18:05:45 -03:00
Lucas De Marchi
4595a2b7d8 AP_Compass: Remove i2c lockup count
This was returned only for a single bus and on all supported platforms
this is hardcoded to 0.
2016-07-28 18:03:09 -03:00
Lucas De Marchi
84f45f09a3 AP_HAL_Linux: convert CameraSensor_Mt9v117 to I2CDevice 2016-07-28 18:03:09 -03:00
Lucas De Marchi
9acffc8868 AP_HAL_Linux: use Empty version if not implemented
There's little point in having the Linux::AnalogIn just to implement and
empty interface. All implementations inside AP_HAL_Linux are already
inheriting directly from AP_HAL, so just remove it.
2016-07-28 16:42:38 -03:00
Lucas De Marchi
47d2f8dc6d AP_HAL_Linux: AnalogIn_ADS1115: return 5V on board_voltage
board voltage is not available - don't return 0V since that prevents
arming.
2016-07-28 16:42:38 -03:00
Tom Pittenger
59135fc615 AP_ADSB: fixed comment for default chan -1 means transceiver is not detected 2016-07-28 09:41:38 -07:00
Andrew Tridgell
c6d3f07b5f AP_RPM: provide an RPM quality in SITL 2016-07-28 12:39:07 +10:00
Staroselskii Georgii
4ca1b58408 AP_HAL_Linux: add ConsoleDevice a handler for TTIN signal
In a case ArduPilot is launched as a background process without
detaching with *nohup* like this ./arduplane -C /dev/ttyAMA0 ConsoleDevice
is created and an attempt to read from it is made. This yields in a stopped
process. This is an endeavour to overcome this problem.
2016-07-27 21:30:19 +10:00
Staroselskii Georgii
8d2b587f71 AP_HAL_Linux: RPI: set signal handler iff nobody has already done it before 2016-07-27 21:30:19 +10:00
Staroselskii Georgii
5e8edcb1db AP_HAL_Linux: use NSIG instead of a hardcoded number in RCInput_RPI 2016-07-27 21:30:19 +10:00
Staroselskii Georgii
d69aeb4808 AP_HAL_SITL: use sigaction over signal API in SITL_State 2016-07-27 21:30:19 +10:00
Randy Mackay
d19c074ba1 AP_ADC_ADS1115.h: changed member declaration order to resolve compiler warning
No functional change
2016-07-27 13:39:32 +09:00
hiro2233
3ae36c4a6c AP_HAL_Linux:RCInput: Minimun input channels defined 2016-07-27 00:55:55 -03:00
hiro2233
4a6447575c AP_HAL: fixed and updated RCInput example. 2016-07-27 00:52:13 -03:00
Andrew Tridgell
9df58e1e0a AP_Arming: don't show the GPS arming error in SITL
it just makes users think something is wrong
2016-07-27 07:46:04 +10:00
Lucas De Marchi
a159eedd8c AP_RangeFinder: fix bus for Lightware on some boards 2016-07-26 00:52:54 -03:00
Lucas De Marchi
cb01280d77 AP_HAL: define bus for Lightware rangefinder 2016-07-26 00:52:54 -03:00
Jonathan Challinger
4dfb277683 AP_RangeFinder: fix LightwareI2C conversion to I2CDevice 2016-07-26 00:52:54 -03:00
Tom Pittenger
5108b4cbb6 AP_BattMonitor: move vehicle dependant code to be c-file only, not header 2016-07-25 18:10:57 -07:00
murata
7721290160 AP_Scheduler:time_available value type invalid uint16_t to valid uint32_t. 2016-07-25 20:18:16 -03:00
Murilo Belluzzo
d8b58690ad AP_TECS: Remove useless 'if' statement
This should fix CID 91386.

Before removing the 'if', I checked the log to confirm that both branch
didn't end-up being equal by mistake in some commit. But it looks like
the file was added in the project this way.
2016-07-25 18:51:56 -03:00
Lucas De Marchi
c6edae7e8e Revert "Global: workaround toolchain problem on windows"
This reverts commit 4e2b30b413.

The toolchain for windows is now updated, we can remove this workaround.
2016-07-25 17:56:12 -03:00
Tom Pittenger
2c6340bb10 AP_ADSB: compiler warning: init value before use even though it already is
silly compiler warnings.. this one is incorrect but it throws a conservative warning which this solves
2016-07-25 10:14:00 -07:00
Tom Pittenger
dce734d196 AP_ADSB: treat invalid vehicle same as out-of-range: ignore and/or delete it
- aircraft that travel out of range will now get dropped instantly instead of linger and go stale then timeout
2016-07-25 10:03:48 -07:00
Tom Pittenger
726d1d515e AP_ADSB: use correct units (sec) in time since last update for vehicle update 2016-07-25 10:00:57 -07:00
Randy Mackay
f27cf8d388 AC_Avoidance: add adjust_velocity that accepts Vector3f for convenience
We should actually modify this function to scale back the z axis in order to avoid breaching the vertical fence.  Currently breaching the vertical fence is handled within the position controller which is inconsistent.
2016-07-25 20:24:37 +09:00
Peter Barker
692ff22453 AC_Avoid: move closest_point to AP_Math 2016-07-25 20:24:37 +09:00
Peter Barker
2047d53470 Math: move closest_point in from AC_Avoid 2016-07-25 20:24:37 +09:00
Peter Barker
89fbf23012 AP_Avoidance: get_location becomes a method on adsb rather than a abds vehicle 2016-07-25 20:24:37 +09:00
Peter Barker
b5c1019aac AP_Avoidance: adsb based avoidance library 2016-07-25 20:24:37 +09:00
Peter Barker
1cdb97e605 AP_ADSB: support for provision of samples to other libraries 2016-07-25 20:24:37 +09:00
Peter Barker
4639d12f0e AP_ADSB: break circular dependency with Avoidance 2016-07-25 20:24:37 +09:00
Peter Barker
aae84b3edc GCS_MAVLink: send_collision_all 2016-07-25 20:24:37 +09:00
Peter Barker
7bc9a1cf83 GCS_MAVLink: break out a packetReceived function
This just moves code, doesn't change it
2016-07-25 20:24:37 +09:00
Peter Barker
779f78d471 AP_Math: vector3 perpendicular function 2016-07-25 20:24:37 +09:00
Peter Barker
f6cb0ffb6f AP_Math: add Vector2f perpendicular
Add closest_distance_between_radial_and_point function
2016-07-25 20:24:37 +09:00
Peter Barker
b6d0b028c3 AP_Math: add operator[] to Vector2 2016-07-25 20:24:37 +09:00
Andrew Tridgell
d25396543c AP_ICEngine: report takeoff height set 2016-07-25 15:45:58 +10:00
Andrew Tridgell
622d26b122 SITL: expand to 16 output channels
needed for IC engine testing with octaquadplane
2016-07-25 15:45:39 +10:00
Andrew Tridgell
37f71bc6d6 AP_Mission: support DO_ENGINE_CONTROL 2016-07-25 10:06:03 +10:00
Andrew Tridgell
461be7ff0e AP_ICEngine: added IC engine control library 2016-07-25 10:06:03 +10:00
Andrew Tridgell
be2b6e47aa RC_Channel: added output types for choke, ignition and starter 2016-07-25 10:06:03 +10:00
Andrew Tridgell
e73d43d4f9 SITL: improve ICEngine simulation 2016-07-25 10:06:02 +10:00
Andrew Tridgell
306487cad4 GCS_MAVLink: adjust for 16 channels in SERVO_OUTPUT_RAW 2016-07-25 10:06:02 +10:00
Andrew Tridgell
995fb7cd86 SITL: added IC engine simulation 2016-07-25 10:06:02 +10:00
Andrew Tridgell
7ea68f8f80 RC_Channel: fixed function indexes above 64 2016-07-24 19:46:01 +10:00
Andrew Tridgell
8e959d4704 AP_Button: check for space before sending BUTTON_CHANGE 2016-07-24 07:48:36 +10:00
Randy Mackay
65038c753c AC_PrecLand: re-order init to resolve compiler warning 2016-07-23 14:49:21 +09:00
Tom Pittenger
cb91f25dd7 AP_ADSB: change adsb-out param desc and defaults 2016-07-22 17:09:10 -07:00
Gustavo Jose de Sousa
cd0d65dc3f AP_InertialSensor: don't check {gyro,accel}_available twice
That gives a slightly simpler code.
2016-07-22 19:58:08 -03:00
Tom Pittenger
9b390fcc1b AP_ADSB: add mavlink handlers 2016-07-22 13:55:20 -07:00
Lucas De Marchi
4ab1d7cf41 AP_RangeFinder: MaxsonarI2CXL: add some fixes
- coding style changes and some renames
   - fix bus number
   - use be16toh
2016-07-22 13:18:37 -03:00
Murilo Belluzzo
f2d5eb9a97 AP_RangeFinder_MaxsonarI2CXL: Fix driver after I2CDevice conversion
* Simplify semaphore releasing logic
* Fix typo
2016-07-22 13:18:37 -03:00
Luiz Ywata
c167364fa0 AP_RangeFinder: MaxsonarI2CXL: use I2CDevice interface 2016-07-22 13:18:37 -03:00
Lucas De Marchi
ae259bc563 AP_RangeFinder: LightWareI2C: allow detect method to fail
If bus isn't found, allow the detect() method to fail.
2016-07-22 13:18:37 -03:00
Lucas De Marchi
0193517f30 AP_RangeFinder: LightWareI2C: use be16toh
While at it remove some trailing whitespaces and little reformats.
2016-07-22 13:18:36 -03:00
Murilo Belluzzo
66fdfbb850 AP_RangeFinder_LightWareI2C: Fix driver after I2CDevice conversion
* Fix semaphore not being released in ::get_reading
* Simplify semaphore releasing logic
* Fix typo
2016-07-22 13:18:36 -03:00
Luiz Ywata
49d1520850 AP_RangeFinder: LightWareI2C: use I2CDevice interface 2016-07-22 13:18:36 -03:00
Lucas De Marchi
a372f33cc0 AP_RangeFinder: fix PulsedLightLRF detection
- Most of the boards use bus 1 for first I2C
    - If the bus doesn't exist, let the detect() method fail when it
      call start_reading(), because _dev would be invalid
2016-07-22 13:18:36 -03:00
Lucas De Marchi
d653139c5d AP_RangeFinder: PulsedLightLRF: use be16toh 2016-07-22 13:10:51 -03:00
Lucas De Marchi
c8094e2593 AP_RangeFinder: PulsedLightLRF: fix coding style
- sort headers
    - fix constructor
2016-07-22 13:10:51 -03:00
Murilo Belluzzo
0dc33410ff AP_RangeFinder_PulsedLightLRF: Fix driver after I2CDevice conversion
* Fix wrong semaphore->take check in ::get_reading
* Simplify semaphore releasing
* Fix typos and trailing whitespace
2016-07-22 13:10:51 -03:00
Luiz Ywata
e1342eb533 AP_RangeFinder: PulsedLightLRF: use I2CDevice interface 2016-07-22 13:10:51 -03:00
Luiz Ywata
a7fddc0594 AP_RangeFinder: add method _add_backend()
Wrapper method that saves a detected driver
2016-07-22 13:10:51 -03:00
Lucas De Marchi
64d17702e6 AP_BattMonitor: AP_BattMonitor_SMBus: fix after conversion to I2CDevice
- Fix bus number
    - Minor updates to coding style
2016-07-22 13:10:51 -03:00
Luiz Ywata
0cf4353382 AP_BattMonitor: AP_BattMonitor_SMBus: use I2CDevice interface 2016-07-22 13:10:51 -03:00
Andrew Tridgell
4301faeac9 SITL: map X-Plane Mixture inputs to channels 6 and 7
this gives two user controllable channels for experimental aircraft
2016-07-22 19:14:46 +10:00
Andrew Tridgell
69da7e9f86 SITL: added elevrev option for plane sim
used by autotest
2016-07-22 16:42:23 +10:00
Andrew Tridgell
d7faeada87 HAL_SITL: notify GCS on GPIO changes
useful for testing relays in SITL
2016-07-22 15:01:21 +10:00
Andrew Tridgell
5b081a704c HAL_SITL: added GPIO simulation
using SIM_PIN_MASK
2016-07-22 15:01:20 +10:00
Andrew Tridgell
f075fcd79f SITL: added SIM_PIN_MASK
for simulation of GPIO pins
2016-07-22 15:01:20 +10:00
Andrew Tridgell
2ce7b465c1 AP_Button: button monitoring library
library to monitor changes to button state
2016-07-22 15:01:20 +10:00
Andrew Tridgell
7fe1c58575 AP_Notify: added handling of PLAY_TUNE message 2016-07-22 15:00:17 +10:00
Francisco Ferreira
ef28be9ce8 AP_Rally: add is_valid method
method will be used in Copter to check if a rally point is inside fence
2016-07-22 09:00:13 +09:00
Gustavo Jose de Sousa
69405cc99a AP_InertialSensor: fix timing debug macro
- Use "INS_" prefix for the name in order to limit the scope for that macro.

- Don't define it in the code and check if it is defined instead of checking
  the value. With that, there's no need to touch the code for enabling debug,
  only a reconfiguration is necessary (e.g., `CXXFLAGS='-DINS_TIMING_DEBUG' waf
  configure ...`).
2016-07-21 19:01:28 -03:00
Lucas De Marchi
cfb3124f2c AP_HAL_Linux: remove types for spi drivers
Those drivers using SPIDevice interface don't need a global id for each
of them. Remove those that were already converted.
2016-07-21 16:05:03 -03:00
Lucas De Marchi
b23f7a8be4 AP_HAL_Linux: examples: remove BusTest
This needs to be rewritten using the probe methods.
2016-07-21 16:05:03 -03:00
José Roberto de Souza
dd36952efe AP_InertialSensor: BMI160: Register poll function with the timer lock 2016-07-21 15:42:32 -03:00
Tom Pittenger
44a60f278a SITL: change default of SIM_ADSB_RADIUS from 1E3 to 10E3 2016-07-21 00:04:20 -07:00
Tom Pittenger
a5f256229f AP_ADSB: remove mavlink specific source, xml not ready yet 2016-07-21 00:04:17 -07:00
Tom Pittenger
8617880714 AP_ADSB: check buffer space before sending 2016-07-20 22:40:13 -07:00
Tom Pittenger
8b9057f23c AP_ADSB: run dynamic at 5Hz and static/cfg at 5sec 2016-07-20 22:40:12 -07:00
Tom Pittenger
ea0a5c973c AP_ADSB: simplify logic in update_vehicle() 2016-07-20 22:40:12 -07:00
Tom Pittenger
cf77ff6d4f AP_ADSB: convert all function calls to use const and use Location_Class 2016-07-20 22:40:11 -07:00
Tom Pittenger
4c9642ac08 AP_ADSB: callsign gen should use ICAO in hex 2016-07-20 22:40:10 -07:00
Tom Pittenger
69887e1646 AP_ADSB: do not init variables in header class definition 2016-07-20 22:40:09 -07:00
Tom Pittenger
f5bf98041e AP_ADSB: do not spam to all mavlink ports, require the transceiver health heartbeat 2016-07-20 22:40:09 -07:00
Tom Pittenger
b6e25e7d64 AP_ADSB: add support for ADSB transceiver mavlink packets 2016-07-20 22:40:08 -07:00
Tom Pittenger
2223216ca2 AP_ADSB: add param ADSB_LIST_RADIUS to ignore distant aircraft 2016-07-20 22:32:47 -07:00
Tom Pittenger
454560ca4c AP_ADSB: organize variables into in_state and avoid_state structs 2016-07-20 22:32:47 -07:00
Tom Pittenger
b78255cc25 AP_Common: avoid using AP_Math is_zero() because it is classless
- because it is classless it can not be called like AP_Math::is_zero() and will then conflict with local definition of is_zero()
2016-07-20 22:32:47 -07:00
Tom Pittenger
3edd95b99b AP_Common: add Location::is_zero and ::zero member functions 2016-07-20 22:32:47 -07:00
Andrew Tridgell
003c94830b AP_Airspeed: added ARSP_PSI_RANGE parameter
for using pressure sensors with a different range
2016-07-20 13:38:22 +10:00
Andrew Tridgell
28d5103435 AP_Airspeed: initial support for MS4515DO on Disco 2016-07-20 13:38:18 +10:00
Andrew Tridgell
e0047d81a2 AP_RangeFinder: enable sonar on Disco 2016-07-20 13:38:18 +10:00
Andrew Tridgell
018d8f732a AP_Compass: work around poor magnetic setup on Disco
bring compass offsets into line with what the calibrator can handle
2016-07-20 13:38:17 +10:00
Andrew Tridgell
39dac57b56 AP_BattMonitor: support Disco battery monitoring 2016-07-20 13:38:17 +10:00
Andrew Tridgell
d30e55fa44 AP_InertialSensor: initial support for Disco
setup right orientation
2016-07-20 13:38:17 +10:00
Andrew Tridgell
96095b0942 HAL_Linux: fixed comment typo for SBUS input 2016-07-20 13:38:17 +10:00
Andrew Tridgell
b69170febd HAL_Linux: fixed build for Disco with I2C changes 2016-07-20 13:38:17 +10:00
Andrew Tridgell
f5a20d28bc HAL_Linux: fixed comment in SBUS 2016-07-20 13:38:17 +10:00
Andrew Tridgell
a78b875ec3 HAL_Linux: fixed ULTRASOUND GPIO for Disco 2016-07-20 13:38:17 +10:00
Andrew Tridgell
1d8e4cdea9 HAL_Linux: added debugging line for Heat_Pwm 2016-07-20 13:38:17 +10:00
Andrew Tridgell
55d692708b HAL_Linux: fixed set_esc_scaling on Disco 2016-07-20 13:38:16 +10:00
Andrew Tridgell
298f7bffb9 HAL_Linux: fixed motor output for Disco 2016-07-20 13:38:16 +10:00
Andrew Tridgell
9b057ee4f1 HAL_Linux: separate out the GPIO table for Disco 2016-07-20 13:38:16 +10:00
Andrew Tridgell
677a38a10a HAL_Linux: make SBUS input much more robust
use inter-frame gap to resync after byte loss
2016-07-20 13:38:16 +10:00
Andrew Tridgell
29135a0158 HAL_Linux: use termios2 for SBUS RCOUT on Disco 2016-07-20 13:38:16 +10:00
Andrew Tridgell
a40d704126 HAL_Linux: added RCOutput_Disco
combines Sysfs and Bebop RCOutput code
2016-07-20 13:38:16 +10:00
Andrew Tridgell
cf83a43b56 HAL_Linux: support SBUS input on Disco 2016-07-20 13:38:16 +10:00
Andrew Tridgell
aaaa6d38c7 HAL_Linux: initial support for Disco 2016-07-20 13:35:51 +10:00
Andrew Tridgell
e407caaa41 AP_HAL: added support for Parrot Disco 2016-07-20 13:35:51 +10:00
Peter Barker
78fa23440c AP_AHRS: remove use of uninitialised variable
clang told us:

../../libraries/AP_AHRS/AP_AHRS_NavEKF.cpp:695:35: fatal error: variable 'posD' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
2016-07-20 00:06:49 -03:00
Tom Pittenger
7be15be185 AP_TECS: slew the hgt_lag_filter when starting a land 2016-07-19 17:19:10 -07:00
Andrew Tridgell
2527859b59 AP_TECS: update comment on underspeed clearing 2016-07-20 08:21:08 +10:00
Lucas De Marchi
293f94b355 AP_HAL_PX4: Util: fix check for PX4_V4
When building for px4-v2 we have an warning because we are checking for
the value of this undefined macro. Just change both checks to use
"defined()".

../../libraries/AP_HAL_PX4/Util.cpp:115:7: warning: "CONFIG_ARCH_BOARD_PX4FMU_V4" is not defined [-Wundef]
 #elif CONFIG_ARCH_BOARD_PX4FMU_V4
       ^
2016-07-19 17:53:46 -03:00
khancyr
c4b009f4b5 AP_HAL_PX4 : remove unused variable 2016-07-19 17:44:22 -03:00
Andrew Tridgell
a1c759e491 SITL: added sensor smoothing
this adds smoothing of sensors for kinematic consistency when
interacting with the ground. It means when we land the EKF doesn't go
crazy
2016-07-19 21:38:16 +10:00
Andrew Tridgell
4faa57074a SITL: removed vehicle specific ground handling 2016-07-19 14:47:47 +10:00
Andrew Tridgell
e7a54c83d1 SITL: allow SITL to use terrain data for ground height 2016-07-19 14:42:31 +10:00
Andrew Tridgell
c471b635b3 AP_Notify: added NTF_LED_OVERRIDE parameter
when this is set the board RGB LED will be controlled by MAVLink
instead of internally. This is useful for cases where the LED patterns
and colours needed are specified by an external authority (such as the
OBC organisers)
2016-07-19 13:37:13 +10:00
Andrew Tridgell
567d5cdbe6 AP_NavEKF2: use mavlink messages not printf for state change notifications 2016-07-19 12:16:51 +10:00
priseborough
bd7bf21475 AP_NavEKF2: Speed improve switch-over to backup magnetometer
When switching over to a back up magnetometer, ensure that the earth field estimate are reset. other wise mag earth field estimates due to the previous failed mag could cause data from the new mag to be rejected.
2016-07-19 12:16:50 +10:00
priseborough
e34cdc6666 AP_NavEKF2: Fix bug preventing planes recovering from bad magnetometers
This bug created a race condition whereby if the EKF had to reset the yaw to the GPS ground course to recover from a bad magnetometer, the new heading could be over-written by the bad magnetic heading when the plane reached the height for the scheduled reset.
2016-07-19 12:16:50 +10:00
priseborough
e2b8807260 AP_NavEKF2: Fix bug causing switching in and out of aiding
If the GPS receiver was disconnected and no data received, then then the gpsGoodToAlign check did not get a chance to run and becasue it was previously true the EKF would switch back into aiding.
This prevents this by ensuring that gpsGoodToAlign defaults to false when the check is not being performed.
An additional check has also been dded to ensure that there is GPS data to fuse before we declare ready to use GPS.
2016-07-19 12:16:50 +10:00
priseborough
fcc07b5560 AP_NavEKF2: Prevent multiple aiding mode changes per update 2016-07-19 12:16:50 +10:00
priseborough
f4f347fb75 AP_NavEKF2: add missing parenthesis and console message 2016-07-19 12:16:50 +10:00
priseborough
9a23152ee4 AP_NavEKF2: Fix bugs and consolidate aiding switch logic
Switching in and out of aiding modes was being performed in more than one place and was using two variables.
The reversion out of GPS mode due to prolonged loss of GPS was not working.
This consolidates the logic and ensures that PV_AidingMode is only changed by the setAidingMode function.
2016-07-19 12:16:50 +10:00
priseborough
230ba2700f AP_NavEKF2: fix documentation errors 2016-07-19 12:16:50 +10:00
priseborough
b3bfb71431 AP_NavEKF: fix documentation errors 2016-07-19 12:16:50 +10:00
priseborough
01ce3e7f1e AP_AHRS: fix documentation errors 2016-07-19 12:16:49 +10:00
priseborough
7700b1417d AP_InertialNav: Use separated EKF horiz/vert position interfaces 2016-07-19 12:16:49 +10:00
priseborough
5454f76702 AP_AHRS: Add separate interfaces for local horizontal and vertical position 2016-07-19 12:16:49 +10:00
priseborough
a8cd037f56 DataFlash: update to match revised EKF1 and EKF2 interface
Uses separate horz/vert position interfaces
2016-07-19 12:16:49 +10:00
priseborough
341d070db8 AP_NavEKF2: Separate filter status update and get functions
The filter status logic calculations were being repeated every time the get function was called.
The logic is now updated once per filter update step and a separate get function added
2016-07-19 12:16:49 +10:00
priseborough
b1717649b1 AP_NavEKF2: remove combined NED local position interface 2016-07-19 12:16:49 +10:00
priseborough
e374ec634d AP_NavEKF2: Add separate horizontal/vertical local position interfaces 2016-07-19 12:16:49 +10:00
priseborough
487bbc3ed2 AP_NavEKF: Fix reporting of position status
Split publishing of local position into horiz and vert components with separate validity checks
Split status reporting into separate update and get functions and only update once after each loop update. This removes unnecessary re-calculation of the status logic and ensures all consumers get the same data (avoid possible race conditions).
2016-07-19 12:16:48 +10:00
priseborough
04e8726d8a AP_NavEKF2: relax bias convergence check
Enables bias convergence check to pass within 30 seconds when vehicle is static.
2016-07-19 12:16:48 +10:00
priseborough
280395afa1 AP_NavEKF2: Don't declare ready to do aiding unless gyro bias is learned 2016-07-19 12:16:48 +10:00
priseborough
169cd6625d AP_NavEKF2: clean up output predictor 2016-07-19 12:16:48 +10:00
priseborough
aaab250f13 AP_NavEKF2: Don't start GPS aiding until gyro calibration has stabilised
If we start GPS aiding before the gyro bias variances have reduced, glitches on the GPS can cause attitude disturbances that degrade flight accuracy during early flight.
2016-07-19 12:16:48 +10:00
Lucas De Marchi
4e2b30b413 Global: workaround toolchain problem on windows
The minimum version for gcc was supposed to be 4.9 for any platform.
However our build instructions are outdated. Remove the problematic
parts that use the sparse-endian.h header while we don't fix the setup
for windows.
2016-07-19 09:30:39 +09:00
Lucas De Marchi
913f88f2be AP_BoardConfig: fix check for PX4_V4
When building for px4-v2 we have an warning because we are checking for
the value of this undefined macro. Just change both checks to use
"defined()".

../../libraries/AP_BoardConfig/AP_BoardConfig.cpp:36:7: warning: "CONFIG_ARCH_BOARD_PX4FMU_V4" is not defined [-Wundef]
 #elif CONFIG_ARCH_BOARD_PX4FMU_V4
       ^
2016-07-19 10:28:56 +10:00
Lucas De Marchi
6d1acc5813 AP_InertialSensor: BMI160: remove stray call to set speed
It's already supposed to be on high speed there.
2016-07-18 11:20:49 -03:00
Andrew Tridgell
6776f8ac76 DataFlash: fixed GPS2 log format 2016-07-18 09:19:05 +10:00
Grant Morphett
8d6b417adb AP_SteerController: Adding support for Rovers driving reverse
This change is mostly for handling the reverse yaw.
2016-07-17 08:15:33 +10:00
Grant Morphett
b56799f444 AP_L1_Control: Adding support for rover's operating in reverse
Mostly invovles sorting out the reverse yaw when travelling backwards.
2016-07-17 08:15:33 +10:00
Grant Morphett
4e8666cee9 AP_Mission: Adding new MAV_CMD_DO_SET_REVERSE for Rovers.
Rover now supports reverse via this MAV_CMD.
2016-07-17 08:15:33 +10:00
Grant Morphett
647602ed4d AP_Navigation: Adding set_reverse to virtual parent class 2016-07-17 08:15:33 +10:00
Tom Pittenger
acaf0c6a5d SITL: LPF the SIM_WIND_DIR and SIM_WIND_SPD values to eliminate step inputs 2016-07-15 18:37:40 -07:00
Andrew Tridgell
4e8b4f29d9 SITL: added -heavy option to fixed wing model 2016-07-16 08:14:29 +10:00
Andrew Tridgell
d3d2ce3e0d AP_TECS: use full throttle in initial takeoff
during the first part of a takeoff when we have not yet reached the
target airspeed this forces the throttle to maximum. This fixes a case
where the throttle may drop too low during the first part of takeoff
and lead to a stall.
2016-07-16 08:14:29 +10:00
Gustavo Jose de Sousa
ee7c40be61 AP_InertialSensor: BMI160: add backend
The reason of defining BMI160_MAX_FIFO_SAMPLES as 8 can be found on the
following histogram of the number of samples in the FIFO on each read while
performing the accelerometer calibration process:

Samples Count   Freq Acc. Freq
------------------------------
      1  3842 0.1201  0.120111
      2 13172 0.4118  0.531904
      3  9065 0.2834  0.815300
      4  2710 0.0847  0.900022
      5  2231 0.0697  0.969769
      6   816 0.0255  0.995279
      7   137 0.0043  0.999562
      8    13 0.0004  0.999969
     13     1 0.0000  1.000000
2016-07-15 16:46:06 -03:00
Staroselskii Georgii
a1f151a79b AP_HAL_Linux: do not create unnecessary consoles in UARTDriver 2016-07-15 15:31:19 -03:00
Staroselskii Georgii
7b3a5e3158 AP_HAL_Linux: use factory method for creation of UARTDriver backends
Using factory method maked it easier to grasp the lifetime of all object
that get created and destroyed. Instead of spanning this thoughout whole
source file we have it nicely encapsulated in this a little horrendeous
_parseDevicePath that is of course to improve more.
2016-07-15 15:29:05 -03:00
Staroselskii Georgii
0ca635bfb8 AP_HAL_Linux: close() console in dtor 2016-07-15 15:28:10 -03:00
Staroselskii Georgii
e7a5945056 AP_HAL_Linux: make flow_control a property of SerialDevice rather than UARTDriver's
Make it possible to change flow control settings for individual devices.
2016-07-15 15:26:49 -03:00
Staroselskii Georgii
897d2fb1fb AP_HAL_Linux: use OwnPtr for _device in UARTDriver
Otherwise we're going to leak memory without any need.
Before this fix we've created ConsoleDevice 4 times in case -A switch hadn't been supplied,
but we hadn't ever deleted those. Now there's no memory leak here.
2016-07-15 15:22:51 -03:00
Staroselskii Georgii
3f1e999fc8 AP_HAL_Linux: remove ConsoleDevice construction from UARTDriver constructor
Since we're going to create ConsoleDevice in UARTDriver either way,
there's no need to do anything except setting the console flag.
2016-07-15 14:56:00 -03:00
Andrew Tridgell
1b8da3bce2 HAL_PX4: implement I2CDevice driver for PX4 2016-07-15 12:24:03 -03:00
Luiz Ywata
1f0f36d603 AP_Notify: NavioLED_I2C: use I2CDevice interface 2016-07-14 17:32:33 -03:00
Lucas De Marchi
24cdef24b8 AP_HAL_Linux: remove wrong ifdef
This was added when the support for navio2 went in, but the same ifdef
is already on the lines above.
2016-07-14 17:32:33 -03:00
Luiz Ywata
3e765e23a9 AP_HAL_Linux: RCOutput_PCA9685: use I2CDevice interface 2016-07-14 17:32:33 -03:00
Luiz Ywata
d5449a6f20 AP_HAL: Add read method
Provide a more intuitive api for reading an I2CDevice.
2016-07-14 17:32:33 -03:00
Lucas De Marchi
08ea1ea263 AP_HAL_Linux: RCOutput_Bebop: follow coding style
Minor changes to follow coding style and improve readability:

    - sort headers
    - move struct definition to compilation unit rather than header
    - Add braces to if, for, etc
2016-07-14 17:32:33 -03:00
Luiz Ywata
7fb5db8077 AP_HAL_Linux: RCOutput_Bebop: use I2CDevice interface 2016-07-14 17:32:33 -03:00
Lucas De Marchi
a34a5c1aa3 AP_Notify: Display_SSD1306_I2C: Fix after conversion to I2CDevice
- Initialize device on hw_init() method, allowing it not to be
      present
    - Add missing lock
    - Add packed attribute to structs
    - Move defines to source file
2016-07-14 17:32:33 -03:00
Luiz Ywata
f26692de92 AP_Notify: Display_SSD1306_I2C: use I2CDevice interface 2016-07-14 17:32:33 -03:00
Lucas De Marchi
213c38afaf AP_Notify: ToshibaLED_I2C: add part number comment
It's easier to find the datasheet for this driver with the part number
rather than a generic "toshiba led".
2016-07-14 17:32:33 -03:00
Lucas De Marchi
5618008935 AP_Notify: ToshibaLED_I2C: Fix driver after I2CDevice conversion
- Add missing semaphore take on bus
    - Initialize device on init function rather than constructor: the
      constructor may run before I2CDeviceManager is initialized since our
      AP_Notify objects are static so it can't be used.
2016-07-14 17:32:33 -03:00
Luiz Ywata
0b69e43464 AP_Notify: ToshibaLED_I2C: use I2CDevice interface 2016-07-14 17:32:32 -03:00
Lucas De Marchi
e5d519edec AP_ADC: AP_ADC_ADS1115: release bus lock as soon as possible 2016-07-14 17:32:32 -03:00
Lucas De Marchi
85c0c98194 AP_ADC: ADS1115: fix driver after conversion to I2CDevice
In _start_conversion(), the check for return code of _dev->transfer() was
inverted. The structure also needs to be PACKED, otherwise there will be
a hole in the middle.  Fix these issues and use be16_t where it makes
sense.

In read() we need to check for the second byte of config register, so
either make it an array of uint8_t or convert from big endian to host
endianness.  It's simpler to leave it as it was, accessing just the
first byte. Also the conversion value is in be16 type an needs to be
converted to host endiannes, not the opposite.

Fix bus number: all boards that use it expect it to be on bus 1, not 0.
2016-07-14 17:32:32 -03:00
Luiz Ywata
038389f583 AP_ADC_ADS1115: use I2CDevice interface 2016-07-14 17:32:32 -03:00
Lucas De Marchi
de5025a46f AP_Airspeed: I2C: fix after conversion to I2CDevice
- Allow to fail init
2016-07-14 17:32:32 -03:00
Luiz Ywata
6c87b2aa7c AP_Airspeed: AP_Airspeed_I2C: use I2CDevice interface 2016-07-14 17:32:32 -03:00
Lucas De Marchi
5ef1568137 AP_HAL_Empty: fix sitl
Sitl or anyone using AP_HAL_Empty implementation doesn't have any
I2CDevice, so it's pointless to return an empty one.
2016-07-14 17:32:32 -03:00
Andrew Tridgell
7d48b25207 AP_Module: use ifdef in function, not caller
suggestion by Lucas
2016-07-14 13:39:48 +10:00
Andrew Tridgell
eee9fc88a1 AP_InertialSensor: avoid ifdef for AP_MODULE_SUPPORTED 2016-07-14 13:39:47 +10:00
Andrew Tridgell
e82468a529 AP_AHRS: avoid ifdef for AP_MODULE_SUPPORTED 2016-07-14 13:39:47 +10:00
Andrew Tridgell
5ce472ab8a AP_Module: changed hook prefix to ap_hook_ 2016-07-14 13:39:47 +10:00
Andrew Tridgell
e8d8ca5eef AP_Module: updated example module 2016-07-14 13:39:47 +10:00
Andrew Tridgell
847bfda48a HAL_Linux: adjust include ordering 2016-07-14 13:39:47 +10:00
Andrew Tridgell
dd5d0ffbad HAL_Linux: use default module directory 2016-07-14 13:39:47 +10:00
Andrew Tridgell
f29323871f AP_Module: added default module directory 2016-07-14 13:39:47 +10:00
Andrew Tridgell
33ce1213a2 AP_InertialSensor: call gyro_sample and accel_sample AP_Module hooks 2016-07-14 13:39:47 +10:00
Andrew Tridgell
6b6a02e67e AP_Module: also allow export of raw gyro and accel samples
allows for oversampling in image correction
2016-07-14 13:39:46 +10:00
Andrew Tridgell
36181b78de AP_AHRS: fixed build for px4 2016-07-14 13:39:46 +10:00
Andrew Tridgell
7a2d67bde9 AP_Module: added AP_MODULE_SUPPORTED define 2016-07-14 13:39:46 +10:00
Andrew Tridgell
107f76828d HAL_Linux: added AP_Module support 2016-07-14 13:39:46 +10:00
Andrew Tridgell
15a01eefb1 AP_AHRS: added AHRS_update hook 2016-07-14 13:39:46 +10:00
Andrew Tridgell
bd00beaf99 AP_Module: added external module hook library
this allows for external modules to be called at defined hook
locations in ArduPilot. The initial example is a module that consumes
the AHRS state, but this can be generalised to a wide variety of hooks
2016-07-14 13:39:46 +10:00
Andrew Tridgell
f3f34be9c4 SITL: added comment on heli interlock 2016-07-12 20:50:22 +10:00
Jonathan Challinger
630e5378da AC_PosControl: add get_horizontal_error 2016-07-12 18:40:25 +09:00
Jonathan Challinger
8fe0c1b05b AC_PrecLand: don't run if not enabled 2016-07-12 18:40:25 +09:00
Jonathan Challinger
e84d1581ab AC_PrecLand: use new irlock interface, refactor backend interface 2016-07-12 18:40:25 +09:00
Jonathan Challinger
6254608c45 AP_IRLock: refactor interface 2016-07-12 18:40:25 +09:00
Andrew Tridgell
4f17093add SITL: give a bit more pitch on tail in XPlane heli 2016-07-12 19:08:50 +10:00
Andrew Tridgell
fdd20830d6 SITL: use flaps for collective on helis in X-Plane 10
works for more helis
2016-07-12 19:08:50 +10:00
Randy Mackay
6e224158f1 AP_GPS_MAV: use GPS_INPUT_IGNORE_FLAGS 2016-07-12 15:44:46 +09:00
Randy Mackay
e34aa0bc72 AP_GPS_MAV: minor formatting fixes
No functional change
2016-07-12 15:44:19 +09:00
Allan Matthew
4249f7dbe6 AP_GPS: Add GPS_MAV type and accept GPS_INPUT message 2016-07-12 15:34:27 +09:00
Tom Pittenger
84ce499a0d AP_Baro: remove zero-init in constructor 2016-07-11 22:11:34 -07:00
Tom Pittenger
1d81df8144 Revert "AP_Baro: coverity scan - variables not initialized in constructor"
This reverts commit 8d2872d3ab.
2016-07-11 22:02:41 -07:00
Tom Pittenger
9fb4a928e5 Revert "AP_Airspeed: coverity scan - variables not initialized in constructor"
This reverts commit 93462d0fe3.
2016-07-11 22:02:22 -07:00
Tom Pittenger
fc02908c0d Revert "GCS_MAVLink: coverity scan - variables not initialized in constructor"
This reverts commit bd8debdf8b.
2016-07-11 22:01:50 -07:00
Tom Pittenger
773372d2f3 Revert "AP_TECS: coverity scan - variables not initialized in constructor"
This reverts commit 753c0d47f0.
2016-07-11 22:01:26 -07:00
Tom Pittenger
c38c3ae7fe Revert "AP_TECS: coverity scan: init variable struct"
This reverts commit 19713200e5.
2016-07-11 22:01:02 -07:00
Tom Pittenger
be752164f4 Revert "AP_L1_Control: coverity scan - variables not initialized in constructor"
This reverts commit d558f32142.
2016-07-11 21:59:12 -07:00
Andrew Tridgell
871219d199 SITL: support helicopters with X-Plane 10
we get collective from "throttle2" and get interlock from generator1 on/off
2016-07-12 14:40:08 +10:00
priseborough
8793c75da0 AP_NavEKF2: clean up mag field learned logic 2016-07-11 00:44:33 +10:00
priseborough
e6592186fc AP_NavEKF2: Tuning update
Slow down magnetic field learning
2016-07-10 08:21:18 +10:00
priseborough
10470b2dc1 AP_NavEKF2: fix bug in initialisation of declination co-variances
Co-variances were being re-zeroed after being set. This meant that the initial declination learning was sensitive to measurement errors which could result in poor initial yaw accuracy.
2016-07-10 08:21:18 +10:00
priseborough
6b04a81b8d AP_NavEKF2: Fix plane in-flight yaw reset bug
Fixes bugs that prevented planes being able to reset yaw to GPS to recovery from takeoff with a bad magnetoemter.

1) If the velocity innovation check had not failed by the time the in-air transition occurred, then the yaw reset would not be performed
2) The velocity states were not being reset
3) The non fly-forward vehicle (copter) reset could occur first and effectively lock out the fly-forward vehicle (plane) yaw check.
2016-07-10 08:21:18 +10:00
priseborough
51dbed2338 AP_NavEKF2: remember mag field states between flight on same power cycle
Remember the mag bias and earth field states learned during flight when the vehicle  lands.
This improves performance for vehicles that do multiple flight on one power cycle
2016-07-10 08:21:18 +10:00
priseborough
136df7cb5c AP_NavEKF2: reduce declination errors on start of 3-axis fusion
Reset co-variances for NE field states.
2016-07-10 08:21:18 +10:00
priseborough
744f19cd2d AP_NavEKF2: Improve scaling of output predictor I gain
Provide consistent overshoot of 5% across a wider range of time constants and prevent selection of larger time constants causing 'ringing' in the position and velocity outputs.
2016-07-09 15:57:36 +10:00
priseborough
a49c16d63c AP_NavEKF2: Update output filter tuning
Updated tuning to take advantage of corrected time delta dtEkfAvg
2016-07-09 15:57:36 +10:00
priseborough
55dee347e0 AP_NavEKF2: Fix bug in averaged filter delta time
Average EKF time delta was not being updated.
2016-07-09 15:57:36 +10:00
priseborough
cc7caa27bc DataFlash: Use a unique struct for EKF2 logging 2016-07-09 15:57:35 +10:00
priseborough
772c719df3 DataFlash: log tracking error for active instance of EKF2 2016-07-09 15:57:35 +10:00
priseborough
927186339c AP_NavEKF2: Improved output predictor tracking
Implement a PI feedback controller for velocity and position state tracking
2016-07-09 15:57:35 +10:00
priseborough
00b66ddc07 DataFlash: Log EKF2 output predictor tracking data 2016-07-09 15:57:35 +10:00
priseborough
253f744824 AP_NavEKF2: Collect output predictor tracking data 2016-07-09 15:57:35 +10:00
priseborough
14bb4f4574 AP_NavEKF2: Publish output observer tracking errors 2016-07-09 15:57:35 +10:00
priseborough
fa435d0323 AP_NavEKF2: Allow for faster accel bias change in-flight
Fixes a problem observed in a flight log where rapid temperature change caused the accel bias to change faster than the EKF could keep up.
This allows the bias to be learned faster but with acceptable level of noise in the estimate
2016-07-09 15:57:35 +10:00
priseborough
191c34612d AP_NavEKF2: Fix bug in use of corrected IMU data
IMU data was being corrected before being used by the co-variance prediction, whereas the delta angles and velocities in the derivation were supposed to be uncorrected.
This patch creates separate variable for the corrected data
2016-07-09 15:57:35 +10:00
priseborough
118d5b88b2 AP_NavEKF2: Clean up output observer and reduce pos vel time constant
Previous Time constant was too large leading to poor tracking of EKF states in the presence of bad quality IMU data.
2016-07-09 15:57:35 +10:00
Lucas De Marchi
b9f65996bc AP_HAL: sparse-endian: unconditionally use byteswap.h
This is either provided by a system header or a minimal header from
'missing' directory.
2016-07-08 19:49:32 -03:00
Lucas De Marchi
471de28967 AP_Common: provide minimal byteswap.h and endian.h 2016-07-08 19:49:32 -03:00