Commit Graph

23524 Commits

Author SHA1 Message Date
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
ShingoMatsuura bf5a035024 Git: add Shingo Matsuura to Git_Success.txt 2016-08-03 13:28:24 +09: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
Randy Mackay 595aea236a Copter: consolidate throw mode state into structure 2016-08-02 20:25:52 +09:00
Randy Mackay 381397c7bd Copter: set throw mode stage on init 2016-08-02 20:25:52 +09:00
Randy Mackay 807e930251 Copter: throw uses motor spooling instead of interlock 2016-08-02 20:25:52 +09:00
Randy Mackay f4f13bbe6b Copter: add throw mode logging 2016-08-02 20:25:52 +09:00
Randy Mackay 8c5c8eec44 Copter: minor throw mode comment fix
No functional change
2016-08-02 20:25:52 +09:00
Randy Mackay 8e58ea9277 Copter: add throw mode defines for required speed
No functional change
2016-08-02 20:25:52 +09:00
chambana 25940c8e0f Copter: add THROW_TYPE and allow dropping vehicle to trigger motors 2016-08-02 20:25:52 +09:00
Randy Mackay f0f87a2f0c Copter: add throw_nextmode
vehicle switches to mode specified in THROW_NEXTMODE parameter after the
throw is completed.
2016-08-02 20:25:52 +09:00
Randy Mackay 64ac18da6c Copter: move throw state into structure
This makes it easier to add more state which is required for the follow throw_nextmode change
2016-08-02 20:25:52 +09:00
Randy Mackay 40db19549e Copter: allow taking off in Guided mode's attitude control sub mode 2016-08-02 18:26:05 +09:00
Randy Mackay 4e92f08bf1 Copter: only accept attitude targets in Guided mode 2016-08-02 18:26:04 +09:00
Randy Mackay 1161417d7f Copter: add GUIDED_NOGPS flight mode
This mode is a cut down version of Guided mode that only accepts attitude commands.
This mode does not require a GPS lock
2016-08-02 18:25:59 +09:00
Holger Steinhaus cc4fafc3e4 AP_GPS_PX4: fixed GPS epoch calculations 2016-08-02 11:20:48 +10:00
Gustavo Jose de Sousa 5ccd3dfec8 waf: create ap_version taskgen in the corresponding function 2016-08-01 22:04:16 -03:00
Gustavo Jose de Sousa 2e1ac0de8d waf: make get_legacy_defines() "public"
That function will be used by an upcoming separate tool.
2016-08-01 22:04:16 -03:00
Gustavo Jose de Sousa f2dec971e7 waf: add "ap_" prefix to keywords "libraries" and "vehicle"
As an effort to keep things specific to ardupilot API in the build system
consistent and easy way to identify.
2016-08-01 22:04:16 -03: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 f90957e7ed Plane: remove all threat logic in adsb lib in favor of avoidance lib 2016-08-01 15:27:41 -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
Pierre Kancir 07eb170b39 Autotest: correct mavproxy unloaded map error 2016-08-01 10:37:15 -03:00
Gustavo Jose de Sousa bd8526fd68 waf: update to version 1.9.2
- That contains our previous cherry-picked commits.
 - That fixes the issue of builds not storing data in
   `build/<board>/compile_commands.json` files (reported by #4580).
2016-08-01 10:33:30 -03: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