Commit Graph

10592 Commits

Author SHA1 Message Date
Lucas De Marchi cd0e1dff82 AP_HAL_Linux: Add skeleton for I2CDevice
This adds the logic to maintain the I2CDevice's managed by I2CManager.
2016-02-16 19:49:08 -02:00
Lucas De Marchi a117c22c34 AP_HAL_Empty: add I2CDevice 2016-02-16 19:49:08 -02:00
Lucas De Marchi 2250d9d768 AP_HAL: initialize I2C manager
Add I2CManager to AP_HAL's contructor.
2016-02-16 19:49:08 -02:00
Lucas De Marchi f8e6c5b379 AP_HAL: add helper method to read registers
This just forwards to the transfer() method, avoiding the need in driver
code to have a similar method.
2016-02-16 19:49:08 -02:00
Lucas De Marchi b4ff2d7595 AP_HAL: add helper method to write register
This just forwards to the transfer() method, avoiding the need in driver
code to have a similar method.
2016-02-16 19:49:08 -02:00
Lucas De Marchi 872b255384 AP_HAL: Add interface for I2CDevice
This is a new interface to replace I2CDriver in future, when all drivers
are converted.
2016-02-16 19:49:08 -02:00
Lucas De Marchi 0eb450d379 AP_HAL: Add interface for I2C/SPI devices
These interfaces are intended to abstract I2C and SPI devices for
drivers.
2016-02-16 19:49:08 -02:00
Lucas De Marchi 2e60e1b1f2 AP_HAL: utility: Add OwnPtr implementation
This is very similar to std::unique_ptr, but doesn't require including
the <memory> header which pulls lots of c++ headers and cause problems
with nuttx headers. It's header-only. It contains an explanation on what
it solves, how to use and unit tests.
2016-02-16 19:49:08 -02:00
Lucas De Marchi e1ae79688d AP_Common: add directory to add missing C/C++ symbols
Add a cstddef header to allow using std::nullptr_t with those toolchains
that don't provide it. The idea is to make these platforms to use our
wrapper header (see https://gcc.gnu.org/onlinedocs/cpp/Wrapper-Headers.html)
and then we add the missing bits to the header.
2016-02-16 19:49:08 -02:00
Julien Beraud c2db6bfb9d AP_Param: Fix warning
Cast to the original type to use get function.
Still a hack but better than casting a pointer to an object which
memory mapping we are not supposed to know
2016-02-15 15:48:35 -02:00
Tom Pittenger 786d14cd3c AP_RangeFinder: For LightWareSerial, write 'd' to support more devices 2016-02-14 16:05:50 -08:00
Andrew Tridgell b76aff2dcb AP_Arming: allow unconfigured GPS in SITL arming checks
the SITL GPS does not implement the needed protocol negotiation
2016-02-15 07:49:19 +11:00
Lucas De Marchi 7debd14683 AP_HAL_Linux: Scheduler: remove unused _in_io_proc 2016-02-12 23:42:34 -02:00
Lucas De Marchi fbb3bb2fd0 AP_HAL_Linux: Scheduler: remove unused _timer_event_missed 2016-02-12 23:42:34 -02:00
Lucas De Marchi f39a6745d1 Global: remove unused _timer_pending from scheduler 2016-02-12 23:42:34 -02:00
Lucas De Marchi 0ad436c337 AP_HAL_Linux: Scheduler: bring back scheduler table
Use a scheduler table to list threads' properties in a single place.
2016-02-12 23:42:34 -02:00
Lucas De Marchi a1b62b4984 AP_HAL_Linux: Scheduler: use PeriodicThread
Some tasks were not accounting for the time to execute the tasks. Now
that we are using the infra from PeriodicThread all of them are.
2016-02-12 23:42:34 -02:00
Lucas De Marchi 48e81c8589 AP_HAL_Linux: Thread: add PeriodicThread helper
This is a helper class to run a single periodic function like the ones
used in the scheduler.
2016-02-12 23:42:34 -02:00
Lucas De Marchi 860d5aaf84 AP_HAL_Linux: Scheduler: move rpcmem initialization to setup phase
This was the only piece remaining in the timer thread that was used only
to setup the thread.
2016-02-12 23:42:34 -02:00
Lucas De Marchi 0282ebb8ff AP_HAL_Linux: add method to check caller same as thread 2016-02-12 23:42:34 -02:00
Lucas De Marchi e3beef0f77 AP_HAL_Linux: Scheduler: remove unused parameter 2016-02-12 23:42:34 -02:00
Lucas De Marchi 2b61eaf9f2 Global: remove {begin,end}_atomic from scheduler
These are never used and largely not implemented.
2016-02-12 23:42:34 -02:00
Lucas De Marchi 9aa49cda93 Global: remove system_initializing() from scheduler
This is not used anymore.
2016-02-12 23:42:34 -02:00
Lucas De Marchi 9cf9fc152b AP_HAL_Linux: use pthread's barrier instead of polling
Use pthread's barrier so we don't keep waking up threads with possibly
higher priority during initialization phase.

This also synchronizes all of them to a single point. With the previous
approach it was possible (but unlikely) that a thread hadn't reach the
synchronization point when main thread signalize "system initialized".
2016-02-12 23:42:34 -02:00
Lucas De Marchi 2b0e214168 AP_HAL_Linux: Scheduler: move synchronization to common method 2016-02-12 23:42:34 -02:00
Lucas De Marchi 66e6cd60d8 AP_HAL_Linux: Thread: allow to override run method 2016-02-12 23:42:34 -02:00
Lucas De Marchi a183ff8d32 AP_HAL_Linux: Scheduler: use Thread abstraction 2016-02-12 23:42:34 -02:00
Lucas De Marchi 3e0a83ede9 AP_HAL_Linux: add Thread abstraction class 2016-02-12 23:42:34 -02:00
Lucas De Marchi 5e9b45ebc2 AP_HAL_Linux: Scheduler: make microsleep() public
This will be used outside of scheduler class.
2016-02-12 23:42:34 -02:00
Tom Pittenger 12fab6c59a AP_GPS: save cfg only when needed
added GPS_SAVE_CFG param option 2
2016-02-12 15:33:33 -08:00
Tom Pittenger 18163bd01f AP_GPS_UBLOX: save cfg only when needed
added GPS_SAVE_CFG param option 2
2016-02-12 15:33:18 -08:00
Michael du Breuil 55e64b3622 AP_GPS: u-blox: copy paste typo in a #else 2016-02-12 15:33:08 -08:00
Michael du Breuil 217a06322b AP_GPS: u-blox: don't throw 5hz update warnings if no fix
5hz update warnings are only valid if you have a fix, without a fix it adds load
to the GPS without any benefit. Our _5hz time messages are depenend upon GPS fix
time which isn't available yet
2016-02-12 15:32:41 -08:00
Tom Pittenger da01ceee53 AP_TECS: change order of update_speed() so it's not using the previous EAS_dem
bug reported by @NUAAFLY https://github.com/diydrones/ardupilot/issues/1547
2016-02-12 13:23:02 -08:00
Tom Pittenger afe9f544e5 AP_TECS: remove incorrect comment about TECS running at 5Hz, it runs at 10Hz. 2016-02-12 13:04:11 -08:00
Tom Pittenger b38e27cadc AP_SpdHgtControl: 2/3 Land Sink Rate Change 2016-02-12 11:39:12 -08:00
Tom Pittenger 67ce22660e AP_TECS: 1/3 new param TECS_LAND_SRC for Land Sink Rate Change
// @Description: When zero, the flare sink rate (TECS_LAND_SINK) is a fixed sink demand. With this enabled the flare sinkrate will increase/decrease the flare sink demand as you get further beyond the LAND waypoint. Has no effect before the waypoint. This value is added to TECS_LAND_SINK proportional to distance traveled after wp. With an increasing sink rate you can still land in a given distance if you're traveling too fast and cruise passed the land point. A positive value will force the plane to land sooner proportional to distance passed land point. A negative number will tell the plane to slowly climb allowing for a pitched-up stall landing. Recommend 0.2 as initial value.
2016-02-12 11:38:40 -08:00
Tom Pittenger e40bba3d13 AP_TECS: removing mission_cmd in TECS and making it bool is_landing
this is reverse-thrust cleanup
2016-02-12 11:08:47 -08:00
Tom Pittenger 215ecb6b71 AP_SpdHgtControl: removing mission_cmd in TECS and making it bool is_landing 2016-02-12 10:59:35 -08:00
Lucas De Marchi bac29be0b7 AP_Common: remove warnings from headers
Let the warning flag be added by the build system and not when/if the
header AP_Common.h is included. Both waf and make were already updated
to contain these warnings. Besides being in the wrong place, with
clang++ we actually can't add "-Wno-" definitions in build system
because we enable all of the in the header with -Wall.
2016-02-12 20:41:30 +11:00
Tom Pittenger a0755a84e7 AP_TECS: change param TECS_LAND_SPDWGT default from +1 to -1 2016-02-12 20:36:18 +11:00
Michael du Breuil 726bf110cc AP_GPS: update save_cfg description
Saving config is not expected to work on a LEA-6H based on user reports, so the parameter should warn of this
2016-02-12 00:37:05 -08:00
Michael du Breuil 18f55eccea AP_Arming: Add GPS configuration checks to arming 2016-02-12 00:37:04 -08:00
Michael du Breuil 4251ee0e4b AP_GPS: u-blox verify ublox settings
The ublox driver will now continuosly poll for the settings from the GPS and correct any that are found to be in correct.
This status is then reported to the arming library as an additional arming check, allowing the user to be sure that the
gps is correctly configured before using it. If a user has a GPS2 configured that is not present they will fail the arming
checks until after they have disabled the second GPS.

2 new parameters were introduced as well:
  -GPS_AUTO_CONFIG: Will not request any configuration packets to attempt to change them. (If the packet is recieved then
    a update will be sent to it, but in testing this scenario never occured. This is set to 1 or 0 to change the setting.
    (Defaults to 1 enabling auto config)
  -GPS_GNSS_MODE2: Behaves the same way as GPS_GNSS_MODE but only applies to the second GPS.

GPS drivers are now allowed 2 seconds of non responsiveness before being unloaded
2016-02-12 00:37:04 -08:00
Andrew Tridgell a7079b730a AP_GPS: GPVTG can give new velocity 2016-02-11 18:46:01 +11:00
Andrew Tridgell 4beb1748c5 AP_GPS: better handle corrupted NMEA sentences
when a NMEA sentence is corrupted we should discard it
completely. This change prevents us considering a set of sentences
that includes corrupted sentences from being seen as new data
2016-02-11 18:46:01 +11:00
Andrew Tridgell cb60384dc4 AP_HAL_SITL: allow auto-baudrate detection in GPS driver in SITL
this is useful when testing a real GPS in SITL
2016-02-11 18:46:01 +11:00
Tom Pittenger 149cc7c5da AP_TECS: increase range of TECS_LAND_PMAX to include negative 2016-02-10 22:18:08 -08:00
Tom Pittenger f435c5ee50 AP_Baro: tolerate GND_ALT_OFFSET step inputs
large inputs make the EKF angry, this will allow the param update to slew over a few seconds
2016-02-08 21:13:58 -08:00
Andrew Tridgell 13c217c060 AP_TECS: make demanded airspeed during landing stages clearer 2016-02-09 14:18:02 +11:00
Tom Pittenger 5ba2bff85f AP_TECS: Reverse Thrust
Reverse thrust for controlled landings, even with much steeper approach slopes. This is achieved by allowing throttle demand to go negative to maintain a target airspeed. A Pre-Flare stage was added, triggered by an altitude, to allow for a slower airspeed just before land. That lower airspeed can be near stall.
new params TECS_APPR_SMAX - sink rate max during approach
2016-02-09 14:18:02 +11:00
Tom Pittenger 19c7859d04 AP_SpdHgtControl: add mission item to AP_TECS 2016-02-09 14:18:02 +11:00
Tom Pittenger 96833a0b73 AP_Vehicle: new params for pre-flare 2016-02-09 14:18:02 +11:00
Tom Pittenger 5338a76a58 AP_TECS: add flight stage LAND_PREFLARE 2016-02-09 14:18:02 +11:00
Tom Pittenger 4bc30f6479 AP_SpdHgtControl: add new flight stage LAND_PREFLARE and reorder them all 2016-02-09 14:18:02 +11:00
Tom Pittenger f20841f491 SITL: add reverse thrust to Plane Sim 2016-02-09 14:18:01 +11:00
Tom Pittenger 1f714ed75d SITL: handle negative throttle
- negative throttle was causing negative offsets
2016-02-09 14:18:01 +11:00
Tom Pittenger f695f37ca3 AP_HAL_SITL: handle negative throttle
- negative throttle was causing negative voltage offsets
2016-02-09 14:18:01 +11:00
Lucas De Marchi b55294920b AP_Compass: AK8963: remove logging on fail to get semaphore
This is the only driver doing this, using the system_initializing() from
scheduler to log selectively. Remove the check together with removal of
unused wrapper methods to semaphore.
2016-02-08 13:28:32 -02:00
Lucas De Marchi 27999b339d AP_HAL_Linux: Scheduler: include cleanups
While at it also remove some wrong whitespaces.
2016-02-08 13:28:31 -02:00
Randy Mackay adfa03ce69 PID: add parameter descriptions
These actually aren't referred to from anywhere but it makes this class more consistent with other PID classes
2016-02-08 20:42:35 +09:00
mirkix d1babdb0fb AP_OpticalFlow: Enable optical flow onboard for BBBMINI 2016-02-08 08:52:10 -02:00
mirkix 5b8de06beb AP_HAL_Linux: Enable optical flow onboard for BBBMINI 2016-02-08 08:52:10 -02:00
mirkix f777a25de8 AP_HAL: Enable optical flow onboard for BBBMINI 2016-02-08 08:52:10 -02:00
Andrew Tridgell d820eeaec6 SITL: use AP_Motors conventions for multicopters
this makes it easier to add a simulated vehicle to match a
MotorsMatrix frame type
2016-02-08 10:58:56 +11:00
Andrew Tridgell 5efe98a814 SITL: allow quadplane simulator to simulate other frame types 2016-02-08 09:17:22 +11:00
Daniel Frenzel b01406e671 AP_Limits: Remove unused module 2016-02-04 09:43:29 +09:00
Lucas De Marchi 2296139516 AP_HAL_Linux: remove unused constant 2016-02-01 14:18:51 -02:00
Lucas De Marchi 5ba20b1763 AP_Notify: sanitize includes
Due to the way the headers are organized changing a single change in
an AP_Notify driver would trigger a rebuild for most of the files in
the project. Time could be saved by using ccache (since most of the
things didn't change) but we can do better, i.e. re-organize the headers
so we don't have to re-build everything.
2016-02-01 14:18:51 -02:00
Lucas De Marchi 0e09975fa6 AP_HAL_SITL: fix typo 2016-02-01 14:18:51 -02:00
Lucas De Marchi 21b2d5d34c AP_HAL_Linux: AnalogIn_Raspilot: rename classes to follow other names 2016-02-01 14:18:51 -02:00
Lucas De Marchi 87e7704b1c AP_HAL_Linux: ADS1115: rename classes to follow other names
While at it, remove some dead/commented-out code.
2016-02-01 14:18:51 -02:00
Lucas De Marchi 4562c0cffc AP_ADC: ADS1115: coding style fixes
- Clean trailing whitespaces
  - Fix switch
  - Use pragma once
2016-02-01 14:18:51 -02:00
Lucas De Marchi c1d19fa4dc AP_InertialSensor: LSM9DS0: sanitize whitespaces 2016-02-01 14:18:51 -02:00
Lucas De Marchi 9c6bd38e91 AP_InertialSensor: sanitize includes
Due to the way the headers are organized changing a single change in an
inertial sensor driver would trigger a rebuild for most of the files in
the project. Time could be saved by using ccache (since most of the
things didn't change) but we can do better, i.e. re-organize the headers
so we don't have to re-build everything.

With this patch only AP_InertialSensor/AP_InertialSensor.h is exposed to
most users. There are some corner cases to integrate with some example
code, but most of the places now depend only on this header and this
header doesn't depend on the specific backends.

Now changing a single header, e.g. AP_InertialSensor_L3G4200D.h triggers
a rebuild only of these files:

	$ waf copter
	'copter' finished successfully (0.000s)
	Waf: Entering directory `/home/lucas/p/dronecode/ardupilot/build/minlure'
	[ 80/370] Compiling libraries/AP_InertialSensor/AP_InertialSensor.cpp
	[ 84/370] Compiling libraries/AP_InertialSensor/AP_InertialSensor_L3G4200D.cpp
	[310/370] Linking build/minlure/ArduCopter/libArduCopter_libs.a
	[370/370] Linking build/minlure/bin/arducopter
	Waf: Leaving directory `/home/lucas/p/dronecode/ardupilot/build/minlure'
2016-02-01 14:18:51 -02:00
Lucas De Marchi 1ca03006ad AP_InertialSensor: MPU9150: remove driver
This is not used by any board and has a lot of commented out code. For
example, the compass is not enabled.  The comment in the beginning of
the driver says it should serve as an example, but we should rather use
a working driver as an example. If this was at least a bit simpler and
that worked in the past we could refactor it to the new I2CDevice API.
This is not the case.
2016-02-01 14:18:51 -02:00
Lucas De Marchi 22f2a2ee09 AP_InertialSensor: L3G4200D: fix coding style
- remove trailing and leading whitespaces
  - remove unecessary void from functions taking no parameters
2016-02-01 14:18:51 -02:00
Lucas De Marchi 637b53f4ce AP_InertialSensor: L3G4200D: sanitize includes 2016-02-01 14:18:51 -02:00
Lucas De Marchi 5088dca072 AP_InertialSensor: MPU60x0: coding style fixes 2016-02-01 14:18:51 -02:00
Lucas De Marchi ed653f8dbb AP_InertialSensor: MPU60x0: add comment about 8G/16G 2016-02-01 14:18:51 -02:00
Lucas De Marchi 56e4de0bdd AP_Baro: MS56XX: remove initialization to 0 from constructor 2016-02-01 14:18:50 -02:00
Lucas De Marchi 5bb2716081 AP_HAL_Linux: add name to SPI device table
A string name allows to more easily expand the table: the board is
responsible for the name and doesn't have to declare it as a enum or
define. It's also easier to add 2 sensors of the same type.
2016-02-01 14:18:50 -02:00
Lucas De Marchi 9d5fb97819 Global: rename enum SPIDevice to SPIDeviceType
Free the SPIDevice name so to have a consistent name for I2C/SPI device
classes.
2016-02-01 14:18:50 -02:00
Paul Riseborough 8630874ef3 AP_NavEKF2: Send correct data over mavlink status message 2016-02-01 10:02:22 +09:00
Paul Riseborough 1950008248 AP_NavEKF: Send correct data over mavlink status message 2016-02-01 10:02:20 +09:00
Peter Barker f21774d3e8 AP_Vehicle: define vehicle type APM_BUILD_Replay 2016-01-30 12:52:51 -02:00
Peter Barker f0c165f0e4 AP_HAL: ensure CONFIG_MAIN_WITHOUT_ARGC_ARGV is always defined 2016-01-30 12:48:51 -02:00
Peter Barker ede7ffedfc AP_GPS: correct #if from UBLOX_DEBUG to UBLOX_DEBUGGING 2016-01-30 12:48:39 -02:00
Peter Barker afafcbc4f3 AP_BattMonitor: correct names of #defines 2016-01-30 12:48:19 -02:00
Peter Barker 09525e8568 AP_Mount: remove redundant include dependant on bad #define 2016-01-30 12:48:05 -02:00
Peter Barker 4548466701 DataFlash: correct use of #defines
HIL_BOARD_AVR_SITL was renamed
Move use of define to after include where it is defined
2016-01-30 12:46:25 -02:00
Andrew Tridgell e62d6711c3 SITL: added very simple tiltrotor simulation
uses channel 9 to control tilt of rotors
2016-01-30 09:45:43 +11:00
Tom Pittenger eeb77c3413 AP_TECS: updated TECS_LAND_SPDWGT param description 2016-01-30 07:31:10 +11:00
Andrew Tridgell 6f59c4ae53 DataFlash: added GPSAlt to CAM and TRIG log messages
useful for people with RTK GPS
2016-01-29 10:01:51 +11:00
Andrew Tridgell dc998a2eaf AP_Camera: make AP_Camera::control() return bool for picture trigger
this allows a picture to be logged if it is requested
2016-01-29 09:31:40 +11:00
Andrew Tridgell 2099f40d89 AP_Camera: added CAM_FEEDBACK_POL option
allows selection of trigger polarity
2016-01-29 09:19:44 +11:00
Andrew Tridgell 0be28999ea AP_Camera: updated docs for timing of trigger pin 2016-01-29 09:19:44 +11:00
Andrew Tridgell 061ee5e4fd AP_Camera: use timer for faster camera trigger pin detection 2016-01-29 09:19:43 +11:00
Jaime Machuca 1001e53140 DataFlash: added TRIGGER message to Logs
DataFlash.h: added support for Trigger MSG, supressed TAB separations
and file reorganized LogFile.cpp: included Trigger packet
2016-01-29 09:19:43 +11:00
Dario Lindo Andres 2f3510023d AP_Camera: Support for camera feedback signal
Added _feedback_pin;
Added _camera_triggered;
Included FEEDBACK_PIN parameter and his default definition
2016-01-29 09:19:43 +11:00
mirkix b5cb48ba6d AP_BattMonitor: Add BBBMINI defaults 2016-01-28 13:44:44 -02:00
mirkix c622ff1539 AP_HAL_Linux: Enable AnalogIN_IIO for BBBMINI 2016-01-28 13:44:43 -02:00
mirkix fe404c8a5d AP_HAL_Linux: AnalogIIO: Remove unused code, add scaling for BBBMINI, rework 2016-01-28 13:44:43 -02:00
Jonathan Challinger 9a09a86bb8 AP_Motors: add AP_MOTORS_DENSITY_COMP_DISABLED option 2016-01-27 09:18:09 +09:00
Andrew Tridgell 68cf1b6956 HAL_QURT: automatically find broadcast address for UDP network 2016-01-25 19:43:55 +11:00
Jonathan Challinger ac3b5a4400 GCS_MAVLink: add messages to routing switch statement 2016-01-23 10:35:44 +09:00
Jonathan Challinger 5b834330cb AP_Mount: merge SoloGimbal from solo master 2016-01-23 10:35:40 +09:00
Jonathan Challinger eabede692e AP_SmallEKF: move to AP_Mount/SoloGimbalEKF and merge solo version 2016-01-23 10:35:38 +09:00
Jonathan Challinger 02d8b28fa3 DataFlash: add GMB1, GMB2, GMB3 2016-01-23 10:35:37 +09:00
Jonathan Challinger cbf2309023 AP_AHRS: add get_mag_field_NED and get_mag_field_correction 2016-01-23 10:35:36 +09:00
Jonathan Challinger 4c2e6af6ee AP_InertialSensor: statically register with AP_AccelCal 2016-01-23 10:35:34 +09:00
Jonathan Challinger 49ad2d26c6 AP_AccelCal: make client list static 2016-01-23 10:35:33 +09:00
Randy Mackay 081beacb8d AP_InertialSensor: replace sqrt with safe_sqrt to resolve compiler warning
Also add suppressing comment for missing break at end of switch
2016-01-23 10:10:17 +09:00
Gustavo Jose de Sousa c2e3f05dbf waf: ardupilotwaf: prefix build context methods with ap_
It helps to distinguish between things from waf and things from ardupilotwaf.
2016-01-22 20:10:29 -02:00
Gustavo Jose de Sousa a2d2661765 waf: use methods from bld instead of ardupilotwaf for the remaining 2016-01-22 20:10:29 -02:00
Gustavo Jose de Sousa 3d22490397 waf: examples: use methods from bld instead of ardupilotwaf 2016-01-22 20:10:29 -02:00
mirkix 2d9b230be1 AP_RangeFinder: Load .data section for HC-SR04 PRU driver used by BBBMINI
This adds .data section loading to the HC-SR04 range finder driver used by
BBBMINI. The firmware is running inside a PRU. It is necessary to develop more
complex driver software inside the PRU.
2016-01-21 14:02:41 -02:00
Andrew Tridgell 5da6082d78 GCS_MAVLink: raise the waypoint receive timeout to 8s
this fixes a timeout in autotest
2016-01-20 17:23:36 +11:00
Andrew Tridgell 6baae735de SITL: updated fixed wing model based on last_letter skywalker_2013
many thanks to Georacer for this code!
2016-01-20 17:23:36 +11:00
Andrew Tridgell bc5210d6f2 AP_Arming: don't reporting IMU inconsistencies if IMU not enabled 2016-01-19 18:05:08 +11:00
Andrew Tridgell 24d8610013 AP_InertialSensor: use SIM_GYR_SCALE in SITL 2016-01-19 15:29:08 +11:00
Andrew Tridgell a828db792e SITL: added SIM_GYR_SCALE_{X,Y,Z}
allows testing of gyro scale factor learning in EKF2
2016-01-19 15:28:53 +11:00
mirkix 86e335b6b6 AP_HAL_Linux: Prevent buffer overflow 2016-01-19 00:14:48 -02:00
Víctor Mayoral Vilches 5d28fbfa1b Compass: Erle-Brain 2 and PXFmini fix 2016-01-18 23:59:25 -02:00
Andrew Tridgell 640332113c AP_L1_Control: calculate dt for crosstracking 2016-01-19 11:05:56 +11:00
Andrew Tridgell 4f9927beda AP_TECS: added set_pitch_max_limit() API 2016-01-19 11:05:56 +11:00
Andrew Tridgell acb4885989 AP_NavEKF2: use get_delta_angle_dt() API 2016-01-19 09:50:22 +11:00
Andrew Tridgell ee453783eb AP_InertialSensor: added get_delta_angle_dt() API 2016-01-19 09:50:21 +11:00
Lucas De Marchi 2d3a62eae3 AP_HAL_Linux: RCInput_RPI: revert PWM support
This reverts support for RCInput via PWM. This is causing trouble in
some RPI-based boards, receiving a SIGSEGV. Let's revert it for now and
retry this later.

This reverts commit 5629f38b2c.
This reverts commit 51fd0b3d55.
This reverts commit 79d56073f7.
2016-01-18 20:07:42 -02:00
Lucas De Marchi c8947c3e9c AP_HAL_Linux: RCInput_RPI: provide signal information
Otherwise it's difficult to know what signal is causing the program to
exit.
2016-01-18 19:20:44 -02:00
Lucas De Marchi 5629f38b2c AP_HAL_Linux: RCInput_RPI: fix use of uninitiliazed value
../../libraries/AP_HAL_Linux/RCInput_RPI.cpp: In member function ‘virtual void Linux::RCInput_RPI::_timer_tick()’:
../../libraries/AP_HAL_Linux/RCInput_RPI.cpp:489:127: warning: ‘x’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     counter = circle_buffer->bytes_available(curr_pointer, circle_buffer->get_offset(circle_buffer->_virt_pages, (uintptr_t)x));
                                                                                                                               ^
2016-01-18 19:19:36 -02:00
Julien BERAUD 45d668df47 AP_Compass_AK8963: support for timesliced timers
fallback in case the current scheduler doesn't support it
2016-01-18 16:57:48 -02:00
Julien BERAUD d15097f3fc AP_Baro_MS5611: Support for timesliced timers
fallback if current scheduler doesn't support it
2016-01-18 16:57:48 -02:00
Julien BERAUD 4acc121bd6 AP_HAL_Linux: support for timesliced timers
In order for lower frequency timers not to be called at the same iteration
of the main timer loop. This improves scheduling.
2016-01-18 16:57:48 -02:00
Julien BERAUD d5c4917bcd AP_HAL: add default support for timesliced timers
To keep compatibility
2016-01-18 16:57:48 -02:00
Don Gagne c13cf70163 GCS_MAVLink: system id output as severity INFO 2016-01-18 09:40:00 +09:00
Gustavo Jose de Sousa d281067bcc waf: make example binaries be placed in 'examples' dir
This commit makes examples' wscripts use ardupilotwaf.example() instead of
ardupilot.program().
2016-01-15 16:46:41 -02:00
Ricardo de Almeida Gonzaga 4c60dd5e44 AP_HAL_Linux: improve yuyv_to_grey() performance
Based on gbenchmark metrics.

Before:
Benchmark             Time(ns)    CPU(ns) Iterations
----------------------------------------------------
BM_YuyvToGrey/4k          3109       3114     233334
BM_YuyvToGrey/75k        55777      55857      12353
BM_YuyvToGrey/300k      231829     232227       3043

After:
Benchmark             Time(ns)    CPU(ns) Iterations
----------------------------------------------------
BM_YuyvToGrey/4k          1713       1716     411765
BM_YuyvToGrey/75k        32124      32152      21875
BM_YuyvToGrey/300k      128530     128753       5385
2016-01-15 16:43:52 -02:00
Ricardo de Almeida Gonzaga 3748760ead AP_HAL_Linux: improve crop_8bpp() performance
Based on gbenchmark metrics.

Before:
Benchmark             Time(ns)    CPU(ns) Iterations
----------------------------------------------------
BM_Crop8bpp/64/64         3206       3197     198113
BM_Crop8bpp/240/240      38166      38181      18421
BM_Crop8bpp/640/480     193589     193317       3621

After:
Benchmark             Time(ns)    CPU(ns) Iterations
----------------------------------------------------
BM_Crop8bpp/64/64         2652       2657     232103
BM_Crop8bpp/240/240      33532      33506      20792
BM_Crop8bpp/640/480     187848     188201       3684
2016-01-15 16:43:52 -02:00
Ricardo de Almeida Gonzaga 210c90e784 AP_HAL_Linux: add benchmark for crop_8bpp() and yuyv_to_grey()
We had to check for board subtypes in the benchmark since VideoIn.cpp
does these checks.
2016-01-15 16:43:52 -02:00
Julien BERAUD 43307d95c8 OpticalFlow_Onboard: fix body rate calculation
The correct integral of the body rate is (rate + last_rate)/2*dt
and not rate * dt
2016-01-15 16:11:19 -02:00
Ricardo de Almeida Gonzaga 753f7d864a AP_HAL_Linux: add a shrink by software option in OpticalFlow
This shrink must be used when the output camera sizes doesn't fit
the expected output.

We don't need to crop it even when the camera sizes aren't squared since
the shrink_8bpp() function shrinks a selected area.
2016-01-15 16:05:47 -02:00
Ricardo de Almeida Gonzaga 553d36c860 AP_HAL_Linux: add shrink_8bpp() to VideoIn
This function shrinks a selected area on a 8bpp image.

The focus in this function was the performance, so this may not be the
clearer or the most understandable way to write it. The performance
was measured using GoogleBenchmark[1].

[1] - https://github.com/google/benchmark.git
2016-01-15 16:05:47 -02:00
Lucas De Marchi 51fd0b3d55 AP_HAL_Linux: RCInput_RPI: fix coding style
- Remove trailing whitespaces
 - Remove some uneeded comments
 - Fix indentation
 - Replace some breaks inside the loop by checking in the loop itself
2016-01-15 00:16:14 -02:00
Aaron Wang Shi 79d56073f7 AP_HAL_Linux: support PWM input for BH hat 2016-01-15 00:16:14 -02:00
Julien BERAUD f449107563 AP_HAL_Linux: Add Perf Lttng
Support for perf api using lttng.
Some additional build tricks needed for bebop because lttng uses dl_open
which is not compatible with a static link on a different libc as used
on the bebop
2016-01-14 19:13:35 -02:00
bugobliterator d7fcc7cd85 GCS_MAVLink: remove obsolete files from GCS_MAVLink dir 2016-01-15 07:28:47 +11:00
Paul Riseborough 287ebe8e6a AP_NavEKF2: Fix bug in application of sensor bias corrections
Sensor bias corrections were being applied to the incoming IMU data using the wrong delta time.
This was what was driving the different tuning between plane and copter for gyro bias process noise so the same gyro bias process noise default tuning value can now be used for all platform types.
Sensor bias corrections were being applied a a second time to the output observer inertial data.
2016-01-13 08:05:39 +11:00
Paul Riseborough 20923da23a AP_NavEKF2: Allow tuning of non-GPS mode
Eliminate the use of horizontal position states during non-aiding operation to make it easier to tune.
Explicitly set the horizontal position associated Kalman gains to zero and the coresponding covariance entries to zero after avery fusion operation.
Make the horizontal velocity observation noise used during non-aiding operation adjustable.
Use a fixed value of velocity noise during initial alignment so that the flight peformance can be tuned without affecting the initial alignment.
2016-01-13 08:05:39 +11:00
Paul Riseborough 23038e7243 AP_NavEKF2: Use measurement uncertainties to initialise covariance 2016-01-13 08:05:39 +11:00
Lucas De Marchi a3cac102cd AP_HAL_Linux: AnalogIn_Raspilot: rename misleading variables
We are not doing any dma here, it's just an SPI transaction. Name them
only rx/tx (although io_packet_tx/io_packet_rx could be another option).
This also zero-initialize the struct to keep valgrind happy about not
calling ioctl() with uninitialized variables.
2016-01-11 16:03:28 -02:00
Lucas De Marchi 0cff40ed7b AP_HAL_Linux: AnalogIn_Raspilot: remove unused debug 2016-01-11 15:58:49 -02:00
Pritam Ghanghas 60636c1653 AP_HAL_Linux: rename RaspilotAnalogIn.cpp to AnalogIn_Raspilot.cpp 2016-01-11 15:56:20 -02:00
Lucas De Marchi 1fde473afc AP_HAL_Linux: AnalogIn_IIO: normalize names
Use same name for file and classes, preferring AnalogIn_IIO over
IIOAnalogIn.
2016-01-11 15:44:24 -02:00
Lucas De Marchi be2af0877c AP_HAL_Linux: AnalogIn_IIO: formatting fixes
- remove trailing whitespaces
  - use pragma 0 for header guard
2016-01-11 15:44:24 -02:00
Víctor Mayoral Vilches 8195631fac HAL_Linux: AnalogIn_IIO update reopen_pin 2016-01-11 15:44:24 -02:00
Víctor Mayoral Vilches b9c83da8c6 HAL_Linux: AnalogIn_IIO, replace reopen by select
A new select_pin method has been implemented and
set that changes solely the file descriptor (avoids
reopening the file every time we call set_pin).
2016-01-11 15:44:24 -02:00
Víctor Mayoral Vilches da1b529415 HAL_Linux: AnalogIn_IIO add init_pins
initializes all the available analog
sources and stores the corresponding file descriptors
in fd_analog_sources.
2016-01-11 15:44:24 -02:00
Víctor Mayoral Vilches 546fbd1f25 HAL_Linux: mv AnalogIn_PXF to AnalogIn_IIO
Initial implementation used for the PXF moved for
a wider use. The implementation uses the Linux Industrial
I/O Subsystem (IIO) to get Analog Input.
2016-01-11 15:44:24 -02:00
Víctor Mayoral Vilches 4820e0b2c7 HAL_Linux: AnalogIn_PXF changes in AnalogIn
Recent changes in AP_HAL::AnalogIn have made the previous
code not valid anymore. This commit fixes the init()
method and adds common headers.
2016-01-11 15:44:24 -02:00
pkancir c117b41188 AP_BattMonitor: add PXF default pins 2016-01-11 15:44:24 -02:00
pkancir 506db4eaf5 AP_HAL_Linux: add ADC support for PXF cape 2016-01-11 15:44:24 -02:00
Lucas De Marchi 0817fe6033 AP_HAL_Linux: default USE_FRAM to 0 for all boards
This disables FRAM usage in PXF and erleboard. The reason is it's
failing and not being used. Right now we get this on startup:

	root@beaglebone:~# ./ArduCopter.elf
	FRAM: Online
	Storage: FRAM is getting reset to default values
	Failed to read FRAM

Testing with valgrind also reveals some invalid memory reads. Let's
disable it for now to be common with other boards.
2016-01-11 15:44:24 -02:00
Lucas De Marchi 2a33b6bf33 AP_HAL_Linux: OpticalFlow: remove unneeded panic
There's already a panic() below.
2016-01-11 15:34:14 -02:00
Ricardo de Almeida Gonzaga 7adbccac9a AP_HAL_Linux: add support for OpticalFlow to MinnowBoardMax
This commit adds support for OpticalFlow to MinnowBoardMax trying to
leave the OpticalFlow implementation as generic as it already is.

We had to add some format conversion and software crop to the cameras that
do not have this features.
2016-01-11 15:31:27 -02:00
Ricardo de Almeida Gonzaga 8aded390e7 AP_HAL_Linux: add yuyv_to_grey() and crop_8bpp() to VideoIn
Most cameras do not support NV12 or GREY formats, we are adding in this commit
a conversion from YUYV format, that seems pretty common in cameras, to GREY
format (since we do not use Cb and Cr data on OpticalFlow).

Also we are adding a software crop for 8bpp images, such as GREY format. For
the same reason, most cameras do not have support for overlaying (crop, resize
and so on).

These functions are being added in order to be used in the next commits,
where we will add support for OpticalFlow on MinnowBoardMax.
2016-01-11 15:31:27 -02:00
Ricardo de Almeida Gonzaga 27f909319e AP_HAL_Linux: add get_pixel_formats() to VideoIn
This function is being added in order to be used in the next commits,
where we will add support for OpticalFlow on MinnowBoardMax.
2016-01-11 15:31:26 -02:00
Julien BERAUD 979184607d OpticalFlow_Onboard: fix comment
Copy-paste mistake
2016-01-11 14:54:51 -02:00
Andrew Tridgell 097c2011e1 HAL_SITL: prevent abort on select with -1 fd 2016-01-10 21:26:35 +11:00
Andrew Tridgell deb0b9c197 HAL_SITL: read in larger chunks 2016-01-10 17:43:01 +11:00
Andrew Tridgell 655f57ad01 HAL_SITL: cleanup class names
remove SITL prefix
2016-01-10 17:43:01 +11:00
Andrew Tridgell 492c733750 HAL_SITL: added RingBuffers to UART driver
makes for faster log download
2016-01-10 17:43:01 +11:00
Tom Pittenger db8a2f7e8b AP_TECS: changed land_spdwgt to be sliding scale 2016-01-09 13:25:02 +11:00
Tom Pittenger 89ce0b062b AP_SpdHgtControl: added new path_propportion var 2016-01-09 13:25:02 +11:00
Andrew Tridgell ef151944b8 GCS_MAVLink: regenerate headers 2016-01-09 07:38:54 +11:00
Andrew Tridgell ad59cb9f5c AP_Mission: support VTOL_TAKEOFF and VTOL_LAND 2016-01-09 07:38:53 +11:00
Andrew Tridgell 712a45eb22 GCS_MAVLink: added VTOL_TAKEOFF and VTOL_LAND 2016-01-09 07:38:53 +11:00
Andrew Tridgell b3bd83b1c6 AP_TECS: no underspeed when in VTOL 2016-01-09 07:38:52 +11:00
Andrew Tridgell 4f70ca22c1 AP_SpdHgtControl: added VTOL flight stage 2016-01-09 07:38:52 +11:00
Andrew Tridgell b187a0c6eb AP_Motors: added quadplane frame type
this puts the motors on outputs 5 to 8, to leave the first 4 for the
plane
2016-01-09 07:38:51 +11:00
Andrew Tridgell 22e25cc792 HAL_SITL: added Flightaxis support 2016-01-09 07:38:51 +11:00
Andrew Tridgell 7a7bd0607f SITL: first version of FlightAxis SITL support 2016-01-09 07:38:51 +11:00
Andrew Tridgell 76e3ae190a GCS_MAVLink: partial merge of common.xml from upstream 2016-01-09 07:38:51 +11:00
Randy Mackay b742ee9cfb AP_Motors: fix example sketch 2016-01-08 18:36:47 +09:00
Michael du Breuil 8c9eafeb3c AP_GPS: Fix param docs that had incorrect spaces
The spaces between values aren't stirpped by the autodoc tool that generates the XML files
2016-01-08 20:17:54 +11:00
Randy Mackay 8c7f36563c AC_AttControl: bug fix to angle_boost reporting
Thanks to OXINARF for finding this
2016-01-08 10:48:59 +09:00
Michael Oborne a42b286c01 AP_GPS_SBF: update logging based on vendor recommendation. 2016-01-08 10:47:05 +11:00
Andrew Tridgell b54bb757df AP_Param: fixed flymaple build 2016-01-08 10:33:45 +11:00
mirkix 1744bc0850 AP_Notify: Use display with bbbmini 2016-01-07 14:32:56 -02:00
mirkix 2457558624 AP_Notify: Add display support 2016-01-07 14:32:56 -02:00
mirkix dee20a31f1 AP_Notify: Add gps_num_sats 2016-01-07 14:32:56 -02:00
Lucas De Marchi a803cfd1e8 AP_HAL_Linux: RCInput: use GPIO5 for PPMSUM in bhat 2016-01-07 10:28:16 -02:00
Lucas De Marchi 321803919c Revert "AP_HAL_Linux: support PWM input for BH hat"
This reverts commit 8cca0beba9.

The PWM input using the RPI DMA is causing trouble with RPI boards using
PPMSUM. Let's revert it until the solution is found. We still leave the
ifdef in RCInput for BH hat.
2016-01-07 10:27:07 -02:00
Randy Mackay c829ec0c2c AC_PrecLand: add missing parameter description
Thanks to Thomas Stone for finding this
2016-01-07 17:35:18 +09:00
Jonathan Challinger 8fdbb36827 AP_BattMonitor: add is_powering_off 2016-01-07 15:14:07 +09:00
Randy Mackay 5ddd332277 AC_AttControl: add ANGLE_BOOST param
This allows disabling angle boost
2016-01-07 12:31:52 +09:00
Randy Mackay 6c458b07cb MotorsHeli_RSC: resolve compiler warning re init order 2016-01-07 12:31:49 +09:00
Randy Mackay f6b909d0a5 AHRS_NavEKF: resolve compiler warning re signed vs unsigned comparison 2016-01-07 12:31:47 +09:00
Tom Pittenger 70a45680ed AP_TECS: fixed param desc for TECS_LAND_THR 2016-01-07 09:36:54 +11:00
Andrew Tridgell 415d800957 AP_Param: use get_custom_defaults_file() 2016-01-07 09:09:54 +11:00