Commit Graph

13283 Commits

Author SHA1 Message Date
priseborough b4961971e0 AP_AHRS: add beacon object to ahrs 2016-11-30 17:56:42 +09:00
priseborough 4482743af5 AP_Beacon: Improve simulator testing of beacons 2016-11-30 17:56:41 +09:00
Randy Mackay 1225e18898 AP_Beacon: add sitl testing parameter file 2016-11-30 17:56:40 +09:00
Andrew Tridgell 5b83fa3a77 AP_Beacon: added SITL backend 2016-11-30 17:56:39 +09:00
Randy Mackay 821fc516fb AP_Beacon: library to accept distances from beacons 2016-11-30 17:56:37 +09:00
Randy Mackay c4aa37525e SerialManager: add beacon to list of protocols 2016-11-30 17:56:35 +09:00
Leonard Hall 8af192ed9d AC_AttControl: allow MOT_THR_MIX_MAX to be 2.0
The parameter description maximum of 0.9 should keep most users from
setting this parameter above 0.9 but there are rare cases for very high powered copters with low hover-throttle values where setting as high as 2.0 improves attitude control
2016-11-30 17:56:34 +09:00
Andrew Tridgell 8468add63e AP_Motors: mark PWM_TYPE as reboot required 2016-11-30 10:53:26 +11:00
Andrew Tridgell ce5ed66b45 HAL_PX4: auto-scale brushed output with ESC output range 2016-11-30 10:53:26 +11:00
Andrew Tridgell ce517384e1 AP_Motors: support MODE_PWM_BRUSHED16KHZ 2016-11-30 10:53:26 +11:00
Andrew Tridgell b3286c3da0 HAL_PX4: support MODE_PWM_BRUSHED16KHZ 2016-11-30 10:53:25 +11:00
Andrew Tridgell fac8f1db03 AP_HAL: added MODE_PWM_BRUSHED16KHZ 2016-11-30 10:53:25 +11:00
Peter Barker bc45ab5409 DataFlash: add a heartbeat for the io thread in DataFlash_File 2016-11-29 15:14:09 -08:00
Peter Barker e11c276b35 DataFlash_File: stop trying to stuff a uint64_t into a uint32_t 2016-11-29 15:14:09 -08:00
Peter Barker fff2068a5a AP_Arming: add arming check for logging actually started 2016-11-29 15:14:09 -08:00
Peter Barker 5776b3fddb AP_Arming: check CardInserted in AP_Arming 2016-11-29 15:14:09 -08:00
Andrew Tridgell a2e92c4054 AP_BoardConfig: increase uavcan bus settle time to 2s
needed to ensure zubax mag has time to come up
2016-11-29 12:51:16 +11:00
Peter Barker 2c8a0a9123 DataFlash: rotate files when vehicle is disarmed 2016-11-28 09:42:09 -08:00
Peter Barker fc79fb4ab4 DataFlash: know about armed state of vehicle 2016-11-28 09:42:09 -08:00
Randy Mackay bac5deed43 AP_IRLock: health reporting based on successful I2C transfer
This change is required because sync messages are only sent if a target is visible
2016-11-28 12:08:36 +09:00
Andrew Tridgell 28b3de91cf AP_Compass: fixed orientation of internal i2c compass for FMUv1
thanks to Peter for noticing
2016-11-28 13:02:15 +11:00
Andrew Tridgell 40bd3a8861 HAL_PX4: tidy up thread wait code
use the same method for all threads. Makes for tidier top output
2016-11-28 10:28:01 +11:00
Andrew Tridgell f039a37971 HAL_PX4: set names on all bus threads 2016-11-28 10:18:52 +11:00
Andrew Tridgell 00ccacb2ab AP_HAL: expose device bus number 2016-11-28 10:18:32 +11:00
Andrew Tridgell f04b186879 HAL_PX4: fixed bug in instantiation of I2C bus threads
we ended up with a thread per device instead of a thread per bus!
2016-11-28 09:53:19 +11:00
Andrew Tridgell 12e0c840e8 HAL_PX4: set thread names for main threads 2016-11-28 09:47:49 +11:00
Andrew Tridgell c62b64a600 AP_IRLock: improved sync protocol for IRLock I2C driver 2016-11-28 08:39:06 +11:00
Andrew Tridgell 50db4d362d AC_PrecLand: use new in-tree IRLock driver 2016-11-28 08:26:58 +11:00
Andrew Tridgell c6ea451c56 AP_IRLock: new in-tree IRLock driver on I2C 2016-11-28 08:26:58 +11:00
Andrew Tridgell 22717f23be AP_OpticalFlow: apply yaw for flow in all drivers 2016-11-28 08:26:57 +11:00
Andrew Tridgell 06dfbc3e09 AP_OpticalFlow: added common driver for PX4Flow
used on Linux and NuttX boards
2016-11-28 08:26:57 +11:00
Andrew Tridgell 52715c5d16 AP_OpticalFlow: fixed default pixart flow scaling 2016-11-28 08:26:57 +11:00
Andrew Tridgell 9b93e12bbb AP_OpticalFlow: retry config register write up to 5 times 2016-11-28 08:26:57 +11:00
Andrew Tridgell ea462d80e6 AP_OpticalFlow: added _applyYaw method to backend
for common handling of yaw correction
2016-11-28 08:26:57 +11:00
Andrew Tridgell abc42c737c AP_OpticalFlow: added update function for Pixart flow driver 2016-11-28 08:26:57 +11:00
Andrew Tridgell 0be1b1aac2 AP_OpticalFlow: give access to AHRS from all backends 2016-11-28 08:26:56 +11:00
Andrew Tridgell def6e014cf HAL_SITL: removed old optflow simulation 2016-11-28 08:26:56 +11:00
Andrew Tridgell 42435e700b SITL: expose height above ground to all models 2016-11-28 08:26:56 +11:00
Andrew Tridgell 2e2f8ad8cf AP_OpticalFlow: added SITL flow driver as normal driver
move away from HAL_SITL embedded drivers
2016-11-28 08:26:56 +11:00
Andrew Tridgell a96ed8c188 AP_HAL: added virtual destructor for Semaphores 2016-11-28 08:26:56 +11:00
Andrew Tridgell 0889b25afa AP_OpticalFlow: initial code for Pixart optical flow chip 2016-11-28 08:26:56 +11:00
Randy Mackay 54a87ad35c AP_Proximity: set minimum boundary distance
AC_Avoidance will not stop if it thinks the vehicle is on or outside the polygon.  Setting a minimum distance ensures the vehicle is always within the polygon.
2016-11-27 15:05:48 +09:00
Randy Mackay 57ae14ab4c AP_Proximity: add get distances, distance_max, distance_min
These are used to send distance-sensor messages to the ground station
2016-11-27 15:05:45 +09:00
Randy Mackay b46cc623a0 AC_Avoidance: adjust_velocity_polygon accepts body-frame points 2016-11-27 15:05:42 +09:00
Randy Mackay 55d79d9a32 AC_Avoidance: proximity sensor method re-uses polygon fence boundary code 2016-11-27 15:05:41 +09:00
Randy Mackay cdee68174d AC_Avoidance: rename adjust_velocity_polygon_fence 2016-11-27 15:05:39 +09:00
Randy Mackay 79280036de AC_Avoidance: rename adjust_velocity_circle_fence method 2016-11-27 15:05:38 +09:00
Randy Mackay 40c4e75ae7 AC_Avoidance: remove unnecessary const float arguments 2016-11-27 15:05:36 +09:00
Randy Mackay 6293fa1595 AP_Proximity: add boundary points for object avoidance
This returns a fence which can be used for object avoidance by AC_Avoidance
2016-11-27 15:05:35 +09:00
Randy Mackay 26332251f5 AP_Proximity: add ignore areas
Only SF40c uses these ignore areas for now at least.
It is safe to increase the eeprom locations for the 2nd proximity instance because we only define a single instance.
2016-11-27 15:05:27 +09:00
Randy Mackay 87dea46f5d AP_Proximity: add get_closet_object for use in pre-arm checks 2016-11-27 12:03:06 +09:00
Randy Mackay a56c9545bd AP_Proximity: SITL driver filles in backend sector data 2016-11-27 12:03:04 +09:00
Randy Mackay f594a5a7d6 AP_Proximity: move sectors to backend
This prepares for sectors to be re-used by the SITL driver
2016-11-27 12:03:01 +09:00
Andrew Tridgell f9845c93b1 AP_InertialSensor: keep transfers nicely setup for DMA on stm32
this avoids using stack based bounce buffers which may not support DMA
on stm32
2016-11-27 11:26:10 +11:00
Andrew Tridgell 37a9a78725 HAL_PX4: avoid bounce buffers for SPI when possible 2016-11-27 11:10:18 +11:00
Andrew Tridgell f3d401abb9 HAL_PX4: fixed FMUv1 build 2016-11-27 07:45:54 +11:00
Andrew Tridgell df60b4252a HAL_PX4: reduced noise in PX4 console 2016-11-26 19:06:15 +11:00
Andrew Tridgell 771cedca3d AP_InertialSensor: reduced number of SPI transfers
use cached copy of temperature in MPU6000 and MPU9250 to detect FIFO
error when possible
2016-11-26 19:02:22 +11:00
Andrew Tridgell fdc94ec28a AP_HAL: fixed frequency init for register checking 2016-11-26 18:36:36 +11:00
Tom Pittenger 40777e9e74 AP_Mission: move jump_to_landing_sequence() to AP_Mission 2016-11-25 19:07:30 -08:00
Tom Pittenger d4d186058d AP_Landing: move jump_to_landing_sequence() to AP_Mission 2016-11-25 19:07:30 -08:00
Tom Pittenger 1a70e2f353 AP_Landing: new param LAND_TYPE to split current behavior into AP_Landing_Slope.cpp 2016-11-25 19:07:30 -08:00
Tom Pittenger c7bbb6998a TECS: set landing params as private and use accessors 2016-11-25 19:07:30 -08:00
Tom Pittenger fe4cd7bbbd AP_Landing: set landing params as private and use accessors 2016-11-25 19:07:30 -08:00
Tom Pittenger 98ae77d6a3 AP_Landing: Migrate the rest of "LAND_" params from Plane to AP_Landing 2016-11-25 19:07:30 -08:00
Tom Pittenger d53b177877 AP_Landing: migrate aparm "LAND_" params from plane to AP_Landing 2016-11-25 19:07:30 -08:00
Tom Pittenger 9035dcbbc5 AP_TECS: migrate aparm "LAND_" params from plane to AP_Landing 2016-11-25 19:07:30 -08:00
Tom Pittenger 15ec551990 AP_Vehicle: migrate aparm "LAND_" params from plane to AP_Landing 2016-11-25 19:07:30 -08:00
Tom Pittenger 8f36fe7705 AP_Landing: migrate aparm "LAND_" params from plane to AP_Landing 2016-11-25 19:07:30 -08:00
Tom Pittenger fc84c61672 AP_Landing: add const to all possible vars in function calls 2016-11-25 19:07:30 -08:00
Tom Pittenger fc2f518f31 Plane: revert auto_state.checked_for_autoland back to Plane 2016-11-25 19:07:30 -08:00
Tom Pittenger 3814b5a38b AP_Landing: resorted functions so they line up with plane/landing for easier compare 2016-11-25 19:07:30 -08:00
Tom Pittenger 75e625fd30 AP_landing: port the rest of plane/landing.cpp 2016-11-25 19:07:30 -08:00
Tom Pittenger 9a79b79f1e AP_Landing: port more from plane 2016-11-25 19:07:30 -08:00
Tom Pittenger 10027b21d6 Plane/AP_Landing: port setup_landing_glide_slope() 2016-11-25 19:07:30 -08:00
Tom Pittenger f556f705e6 Plane: move various g params to aparms 2016-11-25 19:07:30 -08:00
Tom Pittenger d2376b7c8b Plane: migrate two helper functions to AP_Landing
- move functions restart_landing_sequence() and jump_to_landing_sequence() to AP_Landing
- NOTE: jump_to function can not set mode, so it is now done externally in vehicle
2016-11-25 19:07:30 -08:00
Tom Pittenger 896b931a7c Plane: Move auto_state variables to AP_landing members 2016-11-25 19:07:30 -08:00
Tom Pittenger 61b02cb41d AP_Landing: add new library for fixed wing landing abstraction 2016-11-25 19:07:30 -08:00
Tom Pittenger ce8db1fdba Plane: move struct Rangefinder_State to AP_Vehicle 2016-11-25 19:07:30 -08:00
Andrew Tridgell eaf378cbf0 GCS_MAVLink: updated optical flow send 2016-11-26 12:27:41 +11:00
Andrew Tridgell f2246326bb AP_Baro: added MS5611 probing, and support 3 baros on Pixhawk2
this adds sensor probing for barometers, simplifies the MS5611 driver,
and adds support for the I2C external barometers on Pixhawk2
2016-11-25 21:40:11 +11:00
Andrew Tridgell 954728c9e9 AP_HAL: added set_chip_select() API
for devices with unusual timings
2016-11-25 21:26:27 +11:00
Andrew Tridgell 638e89bd1d HAL_PX4: implement set_chip_select for SPI 2016-11-25 21:24:10 +11:00
Andrew Tridgell 60801314e0 HAL_PX4: added different modes for external SPI
and lower bus speed to 1MHz
2016-11-25 21:24:10 +11:00
Andrew Tridgell bcb6663187 HAL_PX4: added table of actual bus speeds for SPI 2016-11-25 20:31:43 +11:00
Andrew Tridgell 27605b0258 AP_InertialSensor: run invensese reg checking at low speed
config register read/write should be at low bus speed.

also change to check every 20 calls to reduce checking cost
2016-11-25 20:31:40 +11:00
Andrew Tridgell 7100272f14 AP_HAL: default to register checking every 10th call
this saves having this in nearly all callers
2016-11-25 20:31:36 +11:00
Andrew Tridgell 0e793e1214 HAL_PX4: lower SPI bus speed on invensense devices
now we are using DMA we don't need such high bus speed, and this makes
SPI reliable with a wider range of devices.
2016-11-25 18:32:19 +11:00
Andrew Tridgell 7d57f00ca0 AP_Compass: removed debug line
this is now common when using in-tree drivers
2016-11-25 18:23:53 +11:00
Andrew Tridgell 0f984290c3 AP_InertialSensor: enable fast sampling by default on some boards 2016-11-25 17:59:54 +11:00
Andrew Tridgell f62972d966 AP_Compass: fixed build on bhat
enable both compasses if found
2016-11-25 17:50:24 +11:00
Andrew Tridgell 1f403b02ef AP_Compass: switch to continuous 155Hz mode for LIS3MDL 2016-11-25 17:50:24 +11:00
Andrew Tridgell 62805f59fa AP_Compass: added AK09916 driver
yet another magnetometer!
2016-11-25 17:50:24 +11:00
Andrew Tridgell 17a117b324 AP_Compass: be a bit less verbose in startup 2016-11-25 17:50:23 +11:00
Andrew Tridgell 0e4b8781b2 AP_Compass: auto-detect LIS3MDL compass 2016-11-25 17:50:23 +11:00
Andrew Tridgell b6b2919126 AP_Compass: don't panic on too many compasses
just use the first ones found. Panicing because you have too many
isn't useful
2016-11-25 17:50:23 +11:00
Andrew Tridgell 40ef68f104 AP_Compass: added a LIS3MDL compass driver 2016-11-25 17:50:23 +11:00
Andrew Tridgell f3a778f980 AP_InertialSensor: fixed freeing of fifo buffer 2016-11-25 17:50:19 +11:00
Andrew Tridgell 6f28c61c8d AP_InertialSensor: changed SIZE to LEN
thanks to Lucas for suggestion
2016-11-25 17:50:19 +11:00
hiro2233 cb7f46d653 AP_InertialSensor: fixed handling of user_ctrl register
with aux bus implementations
2016-11-25 17:50:18 +11:00
Andrew Tridgell 29bbee421e HAL_PX4: enable sharing of SPI bus with PX4 with DMA 2016-11-25 17:50:18 +11:00
Andrew Tridgell 9b4c588c09 AP_InertialSensor: adapt drivers for SPI-DMA capable systems
no longer need accumulate() transfers with SPI enabled DMA on stm32
2016-11-25 17:49:58 +11:00
Andrew Tridgell 3fad5ca065 HAL_PX4: implement DMA allocation routines 2016-11-25 17:49:58 +11:00
Andrew Tridgell e42bb20052 AP_HAL: added dma allocation routines to hal.util 2016-11-25 17:49:58 +11:00
Andrew Tridgell 28daddaaf2 AP_InertialSensor: don't use accumulate approach on Linux or I2C 2016-11-25 17:49:57 +11:00
Andrew Tridgell d9c8db7024 AP_InertialSensor: implement a new strategy for fast sampling
this moves to using a 1p filter on the high rate data, followed by
averaging down to 1kHz then a 2p filter to apply configured cutoff
frequency.

It also fixes the FIFO reset to not cause data corruption. We need to
disable all FIFO channels before doing the reset, and wait for the
FIFO to stop in the sensor.

Finally it moves sampling of the MPU6000 and MPU9250 into the main
thread. That significantly improves scheduling performance as we no
longer get long FIFO SPI transfers happening during other tasks. All
transfers happen at the start of the fast loop. That makes timing much
more predictable.

Thanks to Leonard and Paul for help with this design!
2016-11-25 17:49:57 +11:00
Andrew Tridgell b165e025d9 Filter: added new constructor for 1p filter
allow both sample rate and cutoff to be specified in constructor
2016-11-25 17:49:57 +11:00
Andrew Tridgell 7220dc15f9 HAL_PX4: adjusted bus speeds on invensense sensors 2016-11-25 17:49:57 +11:00
Andrew Tridgell 5934a099a4 AP_HAL: added support for more SRXL varients
based on work by Roman Seb <roman-29188@gmx.de>
2016-11-24 22:54:23 +11:00
priseborough 0a177d04fd AP_NavEKF2: Simply core switch implementation
Functionally equivalent
2016-11-24 19:58:10 +09:00
priseborough 7d48054e6f AP_NavEKF2: Group GPS innovation tests when compiling error score 2016-11-24 19:58:07 +09:00
Randy Mackay e9ea06bd10 AP_NavEKF2: minor comment fix 2016-11-24 19:58:03 +09:00
Randy Mackay a32068a973 AC_WPNav: remove ekf position reset handler
This has been migrated to the position control library
2016-11-24 19:58:00 +09:00
Randy Mackay 1012333eef AC_PosControl: add ekf position reset handling
Previously this was in AC_WPNav and used only for loiter but it should work for any flight modes that use horizontal or vertical position control
2016-11-24 19:57:56 +09:00
Randy Mackay c615bac1cd AP_AHRS: add getLastPosDownReset accessor 2016-11-24 19:57:53 +09:00
Randy Mackay 6406e34016 AC_WPNav: remove unused _loiter_step member 2016-11-24 19:57:50 +09:00
priseborough 0df45703f1 AP_NavEKF2: Fix errors in position reset delta publishing 2016-11-24 19:57:47 +09:00
priseborough f6021c959d AP_NavEKF2: capture and publish vertical position reset deltas
Calculate the change in vertical position due to a internal EKF state reset or a EKF core switch
2016-11-24 19:57:45 +09:00
priseborough e62863f9a1 AP_NavEKF2: Reduce unnecessary EKF core switching
1) Do not switch to a core until its states have been updated.
2) Distinguish between mandated switches required for health failure and optional switches required due to innovation checks failing.
3) Apply hyseresis to innovation check levels
2016-11-24 19:57:41 +09:00
murata de153ce1d7 AP_NavEKF: Correct the setting process of variable dAngBiasSigma. 2016-11-24 03:24:18 +00:00
murata ec42ddfb4e AP_NavEKF: style changes (tab to spaces, etc.)
AP_NavEKF: style changes (tab to spaces, etc.)

AP_NavEKF: style changes (tab to spaces, etc.)
2016-11-24 03:24:18 +00:00
ShingoMatsuura e9feb7bdda AP_RangeFilnder: moved the const buffer definition to the header and changed from '8' to 'sizeof(send_request_buffer)' 2016-11-23 10:28:38 -08:00
ShingoMatsuura f97ede9865 AP_RangeFilnder: change send_request_buffer member variable to const and other fixes 2016-11-23 10:28:38 -08:00
ShingoMatsuura e8ff156fa6 AP_RangeFilnder: add clear buffer at INIT state and change send_buffer to member variable to reduce CRC computation for sending request 2016-11-23 10:28:38 -08:00
ShingoMatsuura c1c643e56e AP_RangeFinder: remove clear buffer in send_request 2016-11-23 10:28:38 -08:00
Leonard Hall ea0e413b04 AC_AttControl: do not limit rate if ATC_ACCEL_MAX param is zero 2016-11-23 14:43:29 +09:00
murata ae927e1775 DataFlash: Adjust the return value to the type of the method.
DataFlash: Adjust the return value to the type of the method.
2016-11-22 10:07:16 -08:00
Lucas De Marchi f9b0f9164a AP_HAL_Linux: add TODO to AnalogIn_Raspilot
This is especially bad for raspilot since it has a spi bus shared for
all the peripherals.
2016-11-21 18:11:31 -02:00
Lucas De Marchi 87c6d5da13 AP_InertialSensor: replace panic() with return
When blocking forever there's no reason to call panic later since it
will never going to be reached. This reduces binary size in a few bytes
since the message isn't required anymore.
2016-11-21 18:04:10 -02:00
Andrew Tridgell c2125a0078 AP_Baro: wait forever for semaphore on startup 2016-11-21 18:04:10 -02:00
Andrew Tridgell 6f82ec0642 HAL_Linux: convert RASPilot drivers to thread per bus 2016-11-21 18:04:10 -02:00
Andrew Tridgell 6129b1abb6 AP_InertialSensor: wait forever for semaphore on startup
some boards take a silly amount of time to get semaphore on startup
2016-11-21 17:57:21 -02:00
Julien Beraud d50fd3a6cd AP_OpticalFlow: fix onboard init
mistake in patch to avoid segfault which enabled
AP_OpticalFlow_Linux instead of AP_OpticalFlow_Onboard.
Store a reference to ahrs in order to execute init later, when
ahrs is initialized.
2016-11-21 16:38:59 -02:00
Michael du Breuil d97861d685 AP_GPS: Ublox: Skip SBAS request if we don't want to alter it 2016-11-21 14:15:19 +09:00
Randy Mackay b7f95d9c25 AP_RangeFinder: remove serial.end and begin
Also some formatting changes
2016-11-21 14:07:01 +09:00
Randy Mackay 99fafcb495 RangeFinder: add uLanding to TYPE parameter description 2016-11-21 13:52:15 +09:00
Ricardo de Almeida Gonzaga 148fa03d6b AP_RangeFinder: support MaxBotix Serial rangefinders
This has been tested with LV-MaxSonar®-EZ1 MB1010
2016-11-21 11:21:56 +09:00
Randy Mackay 44c5fee90d AP_RangeFinder: formatting fixes for uLanding 2016-11-21 11:07:41 +09:00
davidaroyer 69bc4c42c9 AP_RangeFinder: Add support for Aerotenna uLanding radar altimeter 2016-11-21 11:07:41 +09:00
davidaroyer faa534cf64 AP_SerialManager: Add support for Aerotenna uLanding radar altimeter 2016-11-21 11:07:41 +09:00
Jonathan Challinger 22517422f9 AP_Motors: add option to disable motor PWM output while disarmed 2016-11-21 10:49:21 +09:00
Andrew Tridgell 6c09758447 AP_RangeFinder: removed momentary spikes in PulsedLight I2C Lidar 2016-11-21 10:30:04 +11:00
Andrew Tridgell 252f90ba36 HAL_PX4: drop I2C speed to 100kHz
reduce I2C errors on long cables for all sensors
2016-11-21 10:29:52 +11:00
Andrew Tridgell b3ac4fcb72 GCS_MAVLINK: speed up USB log download
makes it about 2x as fast on Pixhawk
2016-11-20 18:41:25 +11:00
Lucas De Marchi 504de3ea9e AP_HAL_Linux: RCInput_RPI: fix whitespaces
Also add/change some minor coding style issues, reducing scope of
variables.
2016-11-19 14:05:22 -02:00
Lucas De Marchi aadc1643fc AP_HAL_Linux: reduce speed of MPU* devices
After introducing the temperature check we are resetting the fifo
several times due to difference in temperature.
2016-11-19 14:05:22 -02:00
Lucas De Marchi 8d3361cef4 AP_HAL_Linux: RCInput_RPI: fix using Util class on constructor
Program received signal SIGSEGV, Segmentation fault.
0x000b8760 in Linux::UtilRPI::get_rpi_version() const ()
(gdb) bt
 #0  0x000b8760 in Linux::UtilRPI::get_rpi_version() const ()
 #1  0x000b57ac in Linux::RCInput_RPI::RCInput_RPI() ()
 #2  0x0000acfc in _GLOBAL__sub_I__ZN9HAL_LinuxC2Ev ()
 #3  0x000e1600 in __libc_csu_init ()
 #4  0x76cad228 in __libc_start_main (main=0x7efff774, argc=1994186752,
     argv=0x76cad228 <__libc_start_main+168>, init=0xe15b4 <__libc_csu_init>,
     fini=0xe1614 <__libc_csu_fini>, rtld_fini=0x76fdf464 <_dl_fini>,
     stack_end=0x7efff774) at libc-start.c:246
 #5  0x0000afa4 in _start ()
2016-11-19 14:05:22 -02:00
Lucas De Marchi bc476e1987 AP_ADC: fix ADS1115 instantiation
This can't be called on constructor since hal may not be initialized at
that time.
2016-11-19 14:05:22 -02:00
Andrew Tridgell 216cf53922 AP_InertialSensor: handle FIFO overflow for MPU6k and 9250
this prevents temporary corruption of INS data on FIFO overflow
2016-11-19 12:54:22 +11:00
Lucas De Marchi c6b0a71c47 AP_Compass: Calibrator: use inplace initializer on array 2016-11-18 20:03:30 -02:00
Siddharth Bharat Purohit b36ee10e7c AP_Compass: fix wrong memset in compass calibrator 2016-11-18 20:03:30 -02:00
Siddharth Bharat Purohit 451c2f146d AP_AccelCal: fix bug preventing accel cal fit to run more than one iteration
The check for fitness being smaller than the last value should use the
absolute value, to mean the fitness isn't changing since last iteration.
It's currently always quiting the function after the first iteration.

However for Gauss Newton we anyway want to run as many iterations as we
can, because there are ups and downs along the iteration so we might get
say best result where before and after iterations were bad. The lines
above takes care that sane and the best is selected.
2016-11-18 20:03:30 -02:00
Tom Pittenger 11229d2588 SITL: fix whitespace 2016-11-18 10:42:10 -08:00
ori ganoni 631b5c3ebc adding turbulance to SITL 2016-11-17 20:06:35 -08:00
Andrew Tridgell 18d4286166 AP_InertialSensor: fixed pixfalcon 9250 detection 2016-11-18 14:24:39 +11:00
Peter Barker fd5f79b238 AC_PrecLand: a pure-ArduPilot simulated SITL precision land backend 2016-11-18 09:41:56 +09:00
Peter Barker 4df4ba1956 AC_PrecLand: make SITL_Gazebo an alternate backend
Preprocessor directives were used to hack in the use
of AP_IRLock_SITL.  Instead, make it a full backend itself.
2016-11-18 09:41:56 +09:00
Peter Barker d2285ace6c AC_PrecLand: remove unneeded empty handle_msg 2016-11-18 09:41:56 +09:00
Peter Barker 03710beb18 AC_PrecLand: make handle_msg impure and do nothing 2016-11-18 09:41:56 +09:00
Peter Barker 1eca4e128d AC_WPNav: method to retrieve current desired pilot accels 2016-11-18 09:41:56 +09:00
Andrew Tridgell cb1a5d4c74 AP_InertialSensor: take semaphore for update of accumulators
this fixes a race in update of delta angle and delta velocity between
backend and frontend
2016-11-18 06:32:17 +11:00
Pierre Kancir 84aaca7c6e SITL: add missing break 2016-11-17 13:46:10 +00:00
Peter Barker cf5ed25c9e AP_HAL_Linux: do not attempt realtime when compiling Replay 2016-11-16 22:25:18 -02:00
Julien Beraud ac3f49b06f RPIOUART_Driver: fix warning
cast PKT_MAX_REGS to uint32_t to be able to compare without a warning
2016-11-16 17:37:15 -02:00
Julien Beraud dc86a53862 OpticalFlow: move onboard alloc to init()
No reason to keep it in the constructor
2016-11-16 20:38:00 +11:00
Andrew Tridgell f3f1f6b0b6 AP_InertialSensor: fixed gyro orientation on l3gd20H on pixhawk 2016-11-16 20:33:56 +11:00
Michael Oborne fbeafa0d0a Update AP_BoardConfig.cpp 2016-11-16 16:00:12 +11:00
Michael Oborne e7e3478a58 AP_BoardConfig: add extra uavcan options
this enables the display of dynamic id assignment, which prevents the need for a serial connection to the esc, for first config.
2016-11-16 16:00:12 +11:00
Peter Barker 37c2c0a822 AP_Stats: fix variable reset time bug
Use Jan 1st 2016 as epoch time rather than Unix epoch.

PixHawk's 32-bit floats can't store a 32-bit timestamp.
2016-11-16 09:14:01 +09:00
Andrew Tridgell 6af00027ab AP_InertialSensor: removed unused variables
thanks to Francisco for noticing
2016-11-16 08:41:06 +11:00
Pierre Kancir 86c8145bd9 SITL: Change Flighgear port with instance number 2016-11-16 08:27:48 +11:00
Pierre Kancir c4b5bd4bd9 SITL: revert fg view to activate by default and use flag to disable it 2016-11-16 08:27:48 +11:00
Pierre Kancir e2b939df39 SITL: rename simin to rcin for better readability 2016-11-16 08:27:48 +11:00
Pierre Kancir 59c84c637e SITL: make fg view optional 2016-11-16 08:27:48 +11:00
Francisco Ferreira bfbb275577 AP_InertialSensor: on accel cal failure don't save values to zero
When the accel calibration fails leave the previous values saved but set them to defaults (scale default is ones, not zeros) and notify the GCS
This fixes an arithmetic exception when doing a second accel cal after the first one failed
2016-11-15 11:42:54 -08:00
Francisco Ferreira a3fcebc501 AP_Param: add set_and_notify to vectors 2016-11-15 11:42:54 -08:00
Francisco Ferreira e763896b6a AP_AccelCal: send and receive MAV_CMD_ACCELCAL_VEHICLE_POS
Message is sent at a maximum of 1Hz
Status text is sent, but if command is received it stops and only uses commands
2016-11-15 11:42:54 -08:00
Francisco Ferreira 7463d4c8f7 GCS_MAVLink: add function to send command requesting vehicle position during accel cal 2016-11-15 11:42:54 -08:00
Francisco Ferreira bc661f013e AP_AccelCal: use vehicle position values from MAVLink enum 2016-11-15 11:42:54 -08:00
Francisco Ferreira c07f377eb1 AP_AccelCal: make collect_sample responsible for state changes
Also only set the snoop if the step has changed
2016-11-15 11:42:54 -08:00
Andrew Tridgell 624178f3be AP_InertialSensor: added INS_FAST_SAMPLE parameter
this allows enable/disable of fast sampling per IMU, making
experimentation easier.

It also fixes the fast sampling to always average over 8 samples, and
fixes the 9250 to use the correct accumulator when not doing fast
sampling
2016-11-15 21:16:40 +11:00
Andrew Tridgell c0303ffe8a AP_InertialSensor: temporarily disable fast sampling
a problem has been found with the filtering with fast sampling on
ICM-20608 and MPU9250. Disable until it is solved.
2016-11-14 18:18:17 +11:00
Andrew Tridgell ae2dc5570e AP_Proximity: added SITL proximity backend
using fence points for avoidance
2016-11-14 15:53:43 +09:00
Andrew Tridgell b16226dddf AP_Baro: fixed a bug with corrupted conversions in MS5611 driver
the datasheet says that if you get back zero in an ADC read that the
next value can be corrupt. I have seen this happen on the FMUv1,
leading to bad altitude readings
2016-11-13 17:08:06 +11:00
Andrew Tridgell ac4b100ae4 AP_BoardConfig: use in-tree drivers for FMUv1 2016-11-13 16:21:17 +11:00
Andrew Tridgell 14a26bee6c AP_HAL: fixed ms5611 address on FMUv1 2016-11-13 16:21:05 +11:00
Andrew Tridgell 00938f7dbb HAL_PX4: fixed enabled channels in init
now this is called from AP_BoardConfig we need to not clear enabled
channels
2016-11-13 13:16:22 +11:00
Andrew Tridgell 0502eca7fc HAL_PX4: removed unused variable 2016-11-13 13:16:22 +11:00
Andrew Tridgell c794ad9ee8 AP_InertialSensor: use smaller FIFO buffers
this allows for reading multiple chunks from the fifo per callback
2016-11-13 13:16:22 +11:00
Michael Oborne c62050dc1b AP_GPS_SBF: fix accuracy reported by driver 2016-11-12 16:42:35 +09:00
Andrew Tridgell 5f3c14ea01 AP_RangeFinder: fixed tabs -> spaces 2016-11-12 14:18:15 +11:00
Andrew Tridgell 41018feb3a HAL_PX4: split I2C transfers
this avoids SCL low with a stop condition, which doesn't work with
some devices
2016-11-12 14:18:14 +11:00
Andrew Tridgell 0c7dd99d7e AP_RangeFinder: support LidarLite V2 using in-tree driver
needs to run in continuous mode
2016-11-12 14:18:14 +11:00
Andrew Tridgell fd7b313e34 AP_RangeFinder: removed pwm_input_main
thanks to Francisco
2016-11-11 15:49:53 +11:00
Andrew Tridgell a69ff34c80 AP_RangeFinder: try bus 0 and 1 for PulsedLightI2C rangefinder 2016-11-11 15:49:53 +11:00
Andrew Tridgell 516141edf3 AP_RangeFinder: start PX4 rangefinder drivers on demand 2016-11-11 15:49:53 +11:00
Andrew Tridgell 0fb959a309 AP_RPM: make pwm_input driver start on demand 2016-11-11 15:49:53 +11:00
Andrew Tridgell 08f770125e AP_BoardConfig: moved optional sensor startup out of AP_BoardConfig 2016-11-11 15:49:53 +11:00
Andrew Tridgell 8d19808152 AP_InertialSensor: fixed missing checked register goto
thanks to Francisco for spotting
2016-11-11 08:08:56 +11:00
Andrew Tridgell 49856c37f2 AP_InertialSensor: reduce checked register count
thanks to Francisco for spotting this
2016-11-11 08:08:56 +11:00
Andrew Tridgell 4be8f05ad4 AP_InertialSensor: added register checking for LSM9DS0 2016-11-11 08:08:56 +11:00
Andrew Tridgell 77a83c091a AP_InertialSensor: added register checking for MPU6000/ICM20608 2016-11-11 08:08:56 +11:00
Andrew Tridgell 95a849f472 AP_InertialSensor: added register checking for MPU9250 2016-11-11 08:08:56 +11:00
Andrew Tridgell 3289e90134 AP_InertialSensor: added error count increments in drivers 2016-11-11 08:08:55 +11:00
Andrew Tridgell bc614de4b3 AP_HAL: added checked registers interface
allow drivers to easily monitor and correct critical registers
2016-11-11 08:08:55 +11:00
Andrew Tridgell 4ebf3309f7 AP_InertialSensor: auto-handle invensense sensor changes
some boards swap out MPU6000 for MPU9250 or ICM20608
2016-11-11 08:08:55 +11:00
Andrew Tridgell 8e61b15384 HAL_PX4: added ICM20608_EXT SPI device 2016-11-11 08:08:55 +11:00
Andrew Tridgell e4454c5056 AP_Compass: setup for new PX4 board IDs 2016-11-11 08:08:55 +11:00
Andrew Tridgell 41b132e576 AP_Baro: setup for new board PX4 IDs 2016-11-11 08:08:55 +11:00
Andrew Tridgell 4f50d67790 AP_BoardConfig: added board type auto-detection
using SPI probing
2016-11-11 08:08:55 +11:00
Andrew Tridgell c565c9df35 AP_HAL: added ICM20608 external SPI name 2016-11-11 08:08:55 +11:00
Andrew Tridgell af0ec41652 AP_InertialSensor: fixed accel clip detection with fast sampling
we need to check on every sample at the full rate
2016-11-10 13:39:17 +11:00
Andrew Tridgell 0eac781559 AP_Compass: don't run the AK8963 on the external MPU9250
this saves us one mag slot for another external mag, and leaves the
primary MPU9250 undisturbed by the mag traffic on the bus
2016-11-10 13:05:22 +11:00
Andrew Tridgell 70c27a85de AP_InertialSensor: on PH2 run the first MPU9250 at 8kHz 2016-11-10 13:04:15 +11:00
Andrew Tridgell 73122adb78 AP_BoardConfig: removed unused startup functions for Pixracer 2016-11-10 12:55:22 +11:00
Andrew Tridgell 3d5c57c5dc AP_Compass: fixed orientation of PH2 in-tree compass drivers 2016-11-10 11:44:52 +11:00
Andrew Tridgell 4ba00720aa AP_Compass: make init() private
not called from frontend
2016-11-10 11:44:52 +11:00
Andrew Tridgell 1ea4c6938c AP_InertialSensor: allow auxiliary bus with fast sampling 2016-11-10 11:44:52 +11:00
Andrew Tridgell 8da42b7a8b AP_InertialSensor: fixed temperature for fast sampling case 2016-11-10 11:44:52 +11:00
Andrew Tridgell cb70bae167 AP_InertialSensor: use in-tree drivers for PH2SLIM 2016-11-10 11:44:52 +11:00
Andrew Tridgell c68a6451cb AP_Compass: use in-tree drivers for PH2SLIM 2016-11-10 11:44:52 +11:00
Andrew Tridgell d716bbedee AP_Baro: use in-tree drivers for PH2SLIM 2016-11-10 11:44:52 +11:00
Andrew Tridgell e7a9de9b41 AP_BoardConfig: use in-tree drivers for PH2SLIM 2016-11-10 11:44:52 +11:00
Andrew Tridgell fea7040aff AP_Baro: don't panic when we can't find MS5611
this makes booting a PH2 without its sensor hat on much easier
2016-11-10 11:44:51 +11:00
Andrew Tridgell e27a76e460 AP_InertialSensor: fixed auxiliary bus with FIFO enabled
make sure fifo reset doesn't check I2C master enable
2016-11-10 11:44:51 +11:00
Andrew Tridgell 46785e8ecf AP_InertialSensor: improved method for FIFO integrity checking
check temperature every 255 samples against FIFO data
2016-11-10 11:44:51 +11:00
Andrew Tridgell 8a3f6a8902 AP_InertialSensor: use FIFO and implement fast sampling for MPU9250 2016-11-10 11:44:51 +11:00
Andrew Tridgell f94e4b4375 Filter: allow 1P LowPassFilter to work without alpha recalc per sample
this makes the 1P filter optionally syntax compatible with the 2P
filter and much more CPU efficient.
2016-11-10 11:43:29 +11:00
murata f9add59b58 Global: Aggregate the same definitions.
Global: Aggregate the same definitions.
2016-11-09 11:46:55 -03:00
Lucas De Marchi c1647b13eb AP_HAL_Linux: fix leaking strings 2016-11-09 11:44:05 -03:00
Andrew Tridgell e25a391a8f AP_InertialSensor: fixed typo 2016-11-09 17:08:15 +11:00
Andrew Tridgell d2f6a514b9 AP_InertialSensor: catch FIFO alignment errors using temperature reading
Two cases of what seems to be FIFO alignment errors have been seen on
a Pixracer-beta board with a ICM-20608. At a cost of 2 extra bytes per
transfer we can catch these by looking for sudden temperature changes
caused by bad data in the temperature registers.
2016-11-09 17:08:15 +11:00
Andrew Tridgell 4602b4d679 AP_Compass: improve init and calibration of hmc5843 2016-11-09 17:08:15 +11:00
Andrew Tridgell d248b33104 AP_InertialSensor: simplify config of MPU6000
use zero sample rate divider on both MPU6000 and ICM20608
2016-11-09 17:08:14 +11:00
Andrew Tridgell 7137d5c6f2 AP_InertialSensor: switch pixracer to always use in-tree drivers 2016-11-09 17:08:14 +11:00
Andrew Tridgell 3d48a72f59 AP_C0mpass: switch pixracer to always use in-tree drivers 2016-11-09 17:08:14 +11:00
Andrew Tridgell b8c789cf35 AP_Baro: switch pixracer to always use in-tree drivers 2016-11-09 17:08:14 +11:00
Andrew Tridgell b0b93f8928 AP_BoardConfig: switch pixracer to always use in-tree drivers 2016-11-09 17:08:14 +11:00
Andrew Tridgell 84c3e29891 AP_InertialSensor: use AP_HAL rotations for MPU6000 2016-11-09 17:08:14 +11:00
Andrew Tridgell fd8955a737 AP_HAL: define default rotations for mpu6000 based boards 2016-11-09 17:08:14 +11:00
Andrew Tridgell 2f01dfe81c AP_InertialSensor: fixed from review by Lucas 2016-11-09 17:08:13 +11:00
Andrew Tridgell 81b933d9d0 AP_InertialSensor: use int32_t summation for fast sampling
very slightly faster
2016-11-09 17:08:13 +11:00
Andrew Tridgell b00fd95725 AP_Math: define Vector3l for += op 2016-11-09 17:08:13 +11:00
Andrew Tridgell 565f1986e0 AP_Baro: fixed FMUv1 baro and enable in-tree driver for PHMINI 2016-11-09 17:08:13 +11:00
Andrew Tridgell fcf0a4ea59 AP_BoardConfig: use in-tree drivers for PHMINI 2016-11-09 17:08:13 +11:00
Andrew Tridgell b363a65c2e AP_Compass: enable in-tree drivers for PHMINI 2016-11-09 17:08:13 +11:00
Andrew Tridgell 03b7bc9e65 AP_InertialSensor: use internal drivers for PHMINI
this gets us fast sampling
2016-11-09 17:08:12 +11:00
Andrew Tridgell af1c5fd6d3 AP_InertialSensor: always use FIFO on MPU6000
and enable fast sampling on ICM20608 if on SPI
2016-11-09 17:08:12 +11:00
Andrew Tridgell 96e42696b7 HAL_PX4: added icm20608-am SPI device 2016-11-09 17:08:12 +11:00
Andrew Tridgell d778ee2db0 AP_HAL: define device for icm20608 on ACCEL_MAG CS line on px4
for PHMINI
2016-11-09 17:08:12 +11:00
Andrew Tridgell b34ab2956b HAL_PX4: added access to external SPI connector on FMUv2 2016-11-09 17:08:12 +11:00
Andrew Tridgell fde80a9408 AP_InertialSensor: modify LSM303D settings to match PX4 driver
this allows existing accel calibration to be used
2016-11-09 17:08:12 +11:00
Andrew Tridgell 875fa60452 AP_Compass: fixed external I2C HMC5983 rotation on pixhawk 2016-11-09 17:08:11 +11:00
Andrew Tridgell 01fadb6e90 HAL_PX4: added per-device perf counter for I2C devices 2016-11-09 17:08:11 +11:00
Andrew Tridgell a9a5e50bd1 AP_InertialSensor: removed timer callback for MPU6000
Thanks to Lucas for pointing out this is not needed
2016-11-09 17:08:11 +11:00
Andrew Tridgell 42f242a07b HAL_PX4: fixed build on PX4-v1 2016-11-09 17:08:11 +11:00
Andrew Tridgell bd8867be38 AP_Compass: cope with NULL dev pointer in driver probe functions 2016-11-09 17:08:11 +11:00
Andrew Tridgell ba9b475782 AP_HAL: added MS5611 on I2C for px4-v1 2016-11-09 17:08:11 +11:00
Andrew Tridgell 4cf6dd1818 HAL_Linux: removed panic on bad SPI device 2016-11-09 17:08:11 +11:00
Andrew Tridgell 20cd165476 HAL_PX4: allow for missing SPIDevice table entries
removed panic
2016-11-09 17:08:10 +11:00
Andrew Tridgell bd84e592f8 AP_InertialSensor: check for NULL device pointer in probe()
handle missing devices
2016-11-09 17:08:10 +11:00
Andrew Tridgell 3b53caad87 AP_Compass: keep old hmc5843 ID
prevent re-use. thanks to Lucas
2016-11-09 17:08:10 +11:00
Andrew Tridgell 02c2ba1331 AP_Compass: fixed dup semaphore bug
thanks to Lucas for spotting this!
2016-11-09 17:08:10 +11:00
Andrew Tridgell f31a017ace AP_Compass: changes to HMC5843 driver
this makes the HMC5843 use single-shot mode, which makes it more
robust to bus resets. It also adds WHOAMI checking and enables
automatic temperature compensation.

Unfortunately this makes existing calibration values incompatible, so
a re-cal is required. The device ID has been changed to reflect the
driver change.
2016-11-09 17:08:10 +11:00
Andrew Tridgell f62851f780 GCS_MAVLink: added remote device operations
this makes debugging devices much easier. You can even write a
primitive SPI or I2C device driver over mavlink.

Support for this is in the devop MAVProxy module
2016-11-09 17:08:10 +11:00
Andrew Tridgell 922d5a74f7 HAL_PX4: print msg when I2C device is closed 2016-11-09 17:08:09 +11:00
Andrew Tridgell da7ed73051 GCS_MAVLlink: added handle_common_message()
this will make it easier to add common functions for mavlink messages
without having to do a commit for each vehicle
2016-11-09 17:08:09 +11:00
Andrew Tridgell e5a4dd4e56 HAL_PX4: added perf counter on SPI devices 2016-11-09 17:08:09 +11:00
Andrew Tridgell 8bca8545a2 HAL_PX4: removed unused devname field in SPIDevice 2016-11-09 17:08:08 +11:00
Andrew Tridgell 05769640d1 AP_Compass: support rotations on AK8963 2016-11-09 17:08:08 +11:00
Andrew Tridgell 2716ab8408 AP_Compass: added support for per-instance rotations 2016-11-09 17:08:08 +11:00
Andrew Tridgell fac895b0e6 AP_Compass: setup read flag for SPI transfers 2016-11-09 17:08:08 +11:00
Andrew Tridgell 18df213069 HAL_PX4: fixed initial SPI bus speed and report new SPI instances 2016-11-09 17:08:08 +11:00
Andrew Tridgell 3d7d773883 AP_InertialSensor: added support for ICM20608 on Pixracer 2016-11-09 17:08:08 +11:00
Andrew Tridgell 4dc5dc87b5 HAL_PX4: added ICM20608 to SPI table 2016-11-09 17:08:08 +11:00
Andrew Tridgell ea74f8c12c AP_HAL: added ICM20608 INS name 2016-11-09 17:08:07 +11:00
Andrew Tridgell 2c1e9024f1 AP_InertialSensor: detect missing accels or gyros 2016-11-09 17:08:07 +11:00
Andrew Tridgell 106a91c64c AP_InertialSensor: use init_gyro() on startup
this saves the calibration parameters which should be done on
calibration
2016-11-09 17:08:07 +11:00
Andrew Tridgell 408593465f AP_InertialSensor: fixed rotation for mpu9250 on pixracer 2016-11-09 17:08:07 +11:00
Andrew Tridgell 790dd4769b AP_InertialSensor: simplify rotations for MPU9250 2016-11-09 17:08:07 +11:00
Andrew Tridgell 38a1f51b53 AP_HAL: define rotations for the MPU9250 in board/linux.h 2016-11-09 17:08:07 +11:00
Andrew Tridgell 147b253e65 AP_Compass: make device IDs match PX4 drivers
match in-tree drivers to PX4Firmware drivers
2016-11-09 17:08:06 +11:00
Andrew Tridgell aa4025bdf9 AP_InertialSensor: make INS sensor IDs match for PX4
in-tree driver IDs now match PX4Firmware driver IDs on Pixhawk2
2016-11-09 17:08:06 +11:00
Andrew Tridgell 76b2759317 AP_OpticalFlow: fixed shadowed variable build warning 2016-11-09 17:08:06 +11:00
Andrew Tridgell 9e7e1b2f01 AP_InertialSensor: fixed merge conflicts with patches from Lucas 2016-11-09 17:08:06 +11:00
Andrew Tridgell 1990aa96e1 AP_HAL: added get_bus_id_devtype()
used to do versioning on device types
2016-11-09 17:08:06 +11:00
Lucas De Marchi 104e29acf2 AP_InertialSensor: MPU6000: change accel scale to 16G
Also change the ID of MPU6000 so previous calibration values are not
considered valid.
2016-11-09 17:08:06 +11:00
Lucas De Marchi dc09661b9e AP_InertialSensor: MPU6000: save driver version
When registering accel and gyro we use the upper 16bits of the id to
store the driver version. When changing the driver behavior in
non-compatible ways, changing this version will trigger a request for
calibration.
2016-11-09 17:08:06 +11:00
Lucas De Marchi 0d3adef8b2 AP_InertialSensor: MPU6000: remove TODO leftover
This will never be done as blindly changing speed is not the way to fix
communication issues.
2016-11-09 17:08:05 +11:00
Andrew Tridgell 0a1616cc71 AP_InertialSensor: use correct device IDs on PX4 driver 2016-11-09 17:08:05 +11:00
Lucas De Marchi 469efb00f6 AP_InertialSensor: save id for gyro and accel instances
This allows each sensor to be uniquely identified in the system by using
either the index inside the backend or for those that use the Device
interface, to use the bus type, location, and device id.

We leave 16-bit for each sensor to be able to change its own
identification in future, which allows them to be changed in an
incompatible manner forcing a re-calibration.
2016-11-09 17:08:05 +11:00
Lucas De Marchi bbb9bfa95e AP_InertialSensor: save only gyro calibration
When we are initializing the gyro and then saving the calibration we are
also saving the calibration values for the accelerometers. Right now
this is non-problematic, but we want to check that the ID of the
accelerometer corresponds to the ID of the sensor detected. If we also
save accel calibrations we would actually override the ID of the
accelerometer.

Rename the method to _save_gyro_calibration() and save only on gyro
values.
2016-11-09 17:08:05 +11:00
Lucas De Marchi f81dba2100 AP_InertialSensor: add doc to get_id() of backend
This is different from get_id() of Device and ultimately from each
sensor this this is identifying the backend, not the sensor.
2016-11-09 17:08:05 +11:00
Lucas De Marchi 6b88f3367b AP_Common: remove AP_PRODUCT_ID_* macros
These are not used anymore.
2016-11-09 17:08:05 +11:00
Lucas De Marchi ace61087a1 AP_InertialSensor: remove product_id
We only leave the parameter there for backward-compatibility. However
product id on the inertial sensor is not much useful since it's only
kept for the first instance.

A better implementation per-gyro and per-accel is needed in order to
avoid problems with sensors taking the offsets configured for another
sensor.
2016-11-09 17:08:05 +11:00
Andrew Tridgell a6ac02b61f HAL_Linux: implement device IDs for I2C and SPI 2016-11-09 17:08:04 +11:00
Andrew Tridgell de7913e8e9 AP_Compass: implement device IDs for compass drivers 2016-11-09 17:08:04 +11:00
Andrew Tridgell 64a5d3938c AP_InertialSensor: implement device IDs for MPU6000 and MPU9250 AuxilaryBus 2016-11-09 17:08:04 +11:00
Andrew Tridgell ac2c25539b AP_InertialSensor: implement device IDs for AuxilaryBus 2016-11-09 17:08:04 +11:00
Andrew Tridgell 16489d2a13 HAL_PX4: implement device IDs for I2C and SPI 2016-11-09 17:08:04 +11:00
Andrew Tridgell 3d48b6bb3a AP_HAL: added device id tuples to Device class
this allows a bus connection and device type tuple to be identifed as
a 24 bit number for use in user visible device IDs. Every bus
connection has a unique device ID.
2016-11-09 17:08:04 +11:00
Andrew Tridgell 4ef92b5e39 AP_InertialSensor: enable all 3 IMUs on PH2 2016-11-09 17:08:04 +11:00
Andrew Tridgell e08babb7df HAL_PX4: added new SPI devices for PH2 2016-11-09 17:08:03 +11:00
Andrew Tridgell 26ca2dd392 AP_HAL: added more px4 SPI device names 2016-11-09 17:08:03 +11:00
Andrew Tridgell ac0ea12b42 AP_Compass: enable HMC5843 on SPI for PH2 2016-11-09 17:08:03 +11:00
Andrew Tridgell 88e24dd8bd AP_BoardConfig: added board type 103
for PH2 in-tree drivers
2016-11-09 17:08:03 +11:00
Andrew Tridgell 66026100c3 AP_Baro: enable dual baro on PH2 2016-11-09 17:08:03 +11:00
Andrew Tridgell 4df9b093c3 AP_Baro: fixed missed samples in ms5611 driver 2016-11-09 17:08:03 +11:00
Andrew Tridgell 7c36e14524 AP_ADC: fixed thread usage in AP_ADC_ADS1115 2016-11-09 17:08:03 +11:00
Andrew Tridgell dbd192971f AP_Notify: fixed threading on toshibaled i2c 2016-11-09 17:08:02 +11:00
Andrew Tridgell a9cb03ad74 AP_Notify: fixed threading in two notify backends 2016-11-09 17:08:02 +11:00
Andrew Tridgell 6e2fbf1988 AP_OpticalFlow: fixed threading in opticalflow for linux 2016-11-09 17:08:02 +11:00
Andrew Tridgell 5cf768ced2 AP_InertialSensor: fixed missing return 2016-11-09 17:08:02 +11:00
Andrew Tridgell 4f231f9355 AP_BattMonitor: fixed thread usage for SMBus_I2C 2016-11-09 17:08:02 +11:00
Andrew Tridgell e88519364f AP_RangeFinder: fixed maxbotix I2C semaphore and bus usage 2016-11-09 17:08:02 +11:00
Andrew Tridgell bedee31f61 AP_Baro: fixed semaphore and thread usage in baro drivers 2016-11-09 17:08:02 +11:00
Andrew Tridgell 38ff8b3536 AP_InertialSensor: removed unused product_id function in L3G4200D 2016-11-09 17:08:01 +11:00
Andrew Tridgell 1c631ea037 AP_Compass: cleanup use of backend semaphores
fixed drivers that didn't protect accumulation counters
2016-11-09 17:08:01 +11:00
Andrew Tridgell 9afd51350e AP_Compass: use thread per bus in more drivers
and removed use of timer suspend
2016-11-09 17:08:01 +11:00
Andrew Tridgell 974827aa82 AP_Compass: enabled AK8963 on PX4 2016-11-09 17:08:01 +11:00
Andrew Tridgell a06137bb68 AP_HAL: define 9250 devices 2016-11-09 17:08:01 +11:00
Andrew Tridgell 4bc5b715bf HAL_PX4: define 9250 and fix SPI bus speeds 2016-11-09 17:08:01 +11:00
Andrew Tridgell a5c5e033d2 AP_InertialSensor: fixed threading and locking in remaining backends
use a backend semaphore for shared data and use thread per bus where
available
2016-11-09 17:08:01 +11:00
Andrew Tridgell 2e4151d14e AP_Compass: enable lsm303d mag on FMUv2 2016-11-09 17:08:00 +11:00
Andrew Tridgell 36190ba545 AP_Compass: use thread per bus for lsm303d mag 2016-11-09 17:08:00 +11:00
Andrew Tridgell b92c48548a AP_InertialSensor: added per-instance rotation for LSM9DS0 2016-11-09 17:08:00 +11:00
Andrew Tridgell 2df6ed08c2 AP_InertialSensor: added optional per-instance orientation
this is needed for multi-sensor boards to get orientation right for
each sensor
2016-11-09 17:08:00 +11:00
Andrew Tridgell ac2572384d AP_InertialSensor: added start() method for LSM9DS0
needed to get sensor ordering right on multi-sensor boards
2016-11-09 17:08:00 +11:00
Andrew Tridgell b9e1490740 AP_BoardConfig: added px4io auto-update to AP_BoardConfig 2016-11-09 17:08:00 +11:00
Andrew Tridgell 7e803df221 AP_BoardConfig: startup core peripherals for PX4 2016-11-09 17:07:59 +11:00
Andrew Tridgell 84f93439ca HAL_PX4: delay peripheral starup
moved to AP_BoardConfig
2016-11-09 17:07:59 +11:00
Andrew Tridgell 497b87fa65 AP_Airspeed: switched to in-tree I2C driver for all boards 2016-11-09 17:07:59 +11:00
Andrew Tridgell 0c13c73aa0 AP_BoardConfig: removed PX4 airspeed drivers 2016-11-09 17:07:59 +11:00
Andrew Tridgell 7832f1a1b6 AP_InertialSensor: allow for in-tree drivers for PX4 2016-11-09 17:07:58 +11:00
Andrew Tridgell 7bd52eb112 AP_Compass: allow for in-tree drivers for PX4 2016-11-09 17:07:58 +11:00
Andrew Tridgell 72c2e3a4d5 AP_Baro: select in-tree vs PX4 drivers at runtime 2016-11-09 17:07:58 +11:00
Andrew Tridgell ce174489c3 AP_BoardConfig: added get_board_type() for PX4
used to decide what drivers to start
2016-11-09 17:07:58 +11:00
Andrew Tridgell e91b1318fb HAL_PX4: reformat 2016-11-09 17:07:58 +11:00
Andrew Tridgell 1bb450c722 HAL_PX4: moved to common DeviceBus class for thread management in I2C and SPI 2016-11-09 17:07:58 +11:00
Andrew Tridgell 972f85c490 HAL_PX4: go direct to NuttX for SPI transfers 2016-11-09 17:07:58 +11:00
Andrew Tridgell bf0b0c1773 AP_HAL: fixed HAL_SEMAPHORE_BLOCK_FOREVER to be zero
all implementations assume this
2016-11-09 17:07:57 +11:00
Andrew Tridgell c7bef33ab7 HAL_PX4: fixed lsm303d SPI name 2016-11-09 17:07:57 +11:00
Andrew Tridgell b697c978e6 AP_HAL: fixed lsm303d SPI name 2016-11-09 17:07:57 +11:00
Andrew Tridgell 919aa61918 AP_InertialSensor: support AuxiliaryBus without register_periodic_callback() 2016-11-09 17:07:57 +11:00
Andrew Tridgell e79b4f1c11 AP_HAL: added defines for ms5611 on other SPI buses 2016-11-09 17:07:57 +11:00
Andrew Tridgell 5db65cdb6d AP_HAL: added subtype for PX4 FMUv4 2016-11-09 17:07:57 +11:00
Andrew Tridgell 254b71468c HAL_PX4: added ms5611_int SPI descriptor 2016-11-09 17:07:57 +11:00
Andrew Tridgell 0a28a3a83a HAL_PX4: run SPI priority above boost prioriity
otherwise ins sample wait can end up waiting on blocked SPI
2016-11-09 17:07:56 +11:00
Andrew Tridgell 3aa36185e4 HAL_PX4: drop mpu6000 speed to 11MHz
match previous driver
2016-11-09 17:07:56 +11:00