Commit Graph

8258 Commits

Author SHA1 Message Date
Víctor Mayoral Vilches e5a90c7a34 AP_HAL: Util, add custom terrain and log methods 2015-06-30 14:36:00 +10:00
Víctor Mayoral Vilches 5c4ae15deb HAL_Linux: Make use of GetOptLong
Use GetOptLong to process long args, support
custom terrain and log directories and update
_usage().
2015-06-30 14:36:00 +10:00
Víctor Mayoral Vilches 309511dc08 HAL_Linux: UARTDriver, const device_path
Class member set to const and set_device_path
accepts a const char* now.
2015-06-30 14:36:00 +10:00
Víctor Mayoral Vilches 790f4ec56c HAL_Linux: Util fix indentation 2015-06-30 14:35:59 +10:00
Andrew Tridgell ac3200fd32 AP_InertialSensor: make max_abs_offsets a single float, not a vector 2015-06-30 10:51:43 +10:00
Gustavo Jose de Sousa 0fcd98c804 AP_InertialSensor: disable debug on LSM9DS0 2015-06-30 10:28:05 +10:00
Gustavo Jose de Sousa c168e19e73 AP_InertialSensor: fix coding style with uncrustify on LSM9DS0
This commit makes backend source code for LSM9DS0 comply with the configuration
files "uncrustify_cpp.cfg" and "uncrustify_headers.cfg".
2015-06-30 10:28:02 +10:00
Gustavo Jose de Sousa 2f2a627002 AP_InertialSensor: use runtime GPIO drdy pins numbers instead C constant macros
As we intend to eventually get board related parameters from a configuration
file, this commit makes the GPIO numbers for data-ready pins be instance
variables instead of from C constant macros.

Another advantage of using instance variables in this context is the
possibility of using more than one LSM9DS0.
2015-06-30 10:27:59 +10:00
Gustavo Jose de Sousa 0ef914adac AP_InertialSensor: don't take SPI semaphore if not necessary on LSM9DS0
If the data-ready polling is done entirely on GPIO pins, it isn't necessary to
hold the semaphore before we now we have data to consume. In that case, only
take the SPI semaphore if there's new data available.

On the other hand, if at least one SPI transaction is done in order to check
for new data, then it makes sense to take the semaphore beforehand.
2015-06-30 10:27:57 +10:00
Gustavo Jose de Sousa a82ab25ed3 AP_InertialSensor: use bitfield macros instead of literal values on LSM9DS0
This commit makes accel and gyro initialization routines use bitfield macros
instead of hardcoding the literal value when wrinting on registers. That is
less prone to typos and a lot of times self-explanatory. Also, due to the
latter, the long comments explaining each register field were removed (any
detail can be checked on the datasheet).
2015-06-30 10:27:54 +10:00
Gustavo Jose de Sousa 1572324315 AP_InertialSensor: add macros for LSM9DS0 registers' bitfields 2015-06-30 10:27:51 +10:00
Gustavo Jose de Sousa 033409c629 AP_InertialSensor: set max abs calibration offset for LSM9DS0 2015-06-30 10:27:48 +10:00
Gustavo Jose de Sousa 42eb73a1d1 AP_InertialSensor: add LSM9DS0 backend
This adds the backend driver for LSM9DS0. This implementation is based on the
legacy driver coded by Víctor Mayoral Vilches (under folder LSM9DS0) and makes
some necessary adaptations and fixes in order to work properly. The legacy
driver folder was removed.
2015-06-30 10:27:46 +10:00
Gustavo Jose de Sousa c340e072f2 AP_InertialSensor: use accel instance max abs offset instead of a constant value
The calibration on LSM9DS0 was giving offsets between 4.0 and 4.2 on x-axis and
around 3.6 on y-axis. It turned out that those offsets were actually right.

The maximum absolute values of calibration offset should be a sensor
characteristic rather than a constant value for all sensors.

The constant value previously used (3.5 m/s/s for all axes) is set here as a
default maximum absolute calibration offset for every instance to keep it
working.
2015-06-30 10:27:44 +10:00
Lucas De Marchi 623c5f0713 AP_HAL_Linux: check if I2C device is chardev 2015-06-30 09:10:54 +10:00
Lucas De Marchi acc571c2c5 AP_HAL_Linux: add function to check if path is chardev
Utility function to allow checking if a certain path is a character
device.
2015-06-30 09:10:54 +10:00
Lucas De Marchi a4c1b0d75f AP_HAL_Linux: add constructor to find I2C bus reliably
The device number in /dev may not be reliable from one boot to another
due to the initialization order of each bus.

For example, in Minnow Board Max, the exposed I2C buses may be i2c-7 and
i2c-8 or i2c-8 and i2c-9 depending if the platform driver in the kernel
is initialized before or after the PCI.

It also may change with different version and configuration of the DT or
UEFI used making another kernel driver to bind to the device. This means that
for Minnow Board Max we need to use something like below to pass to the
constructor:

	static const char * const i2c_devpaths[] = {
	    /* UEFI with lpss set to ACPI */
	    "/devices/platform/80860F41:05",
	    /* UEFI with lpss set to PCI */
	    "/devices/pci0000:00/0000:00:18.6",
	     NULL
	};

The devpath here is the one returned by udev with the following command:

	udevadm info -q path /dev/<i2c-device>

In contrary to the device number in /dev/i2c-N, this path in sysfs is
stable across reboots and can only change if there's a change in the
UEFI firmware or the board's device tree.

This patch assumes the currently supported boards don't have this
problem so it's not touching them.
2015-06-30 09:10:54 +10:00
Lucas De Marchi ec5d0b6c08 AP_HAL_Linux: reorder members and methods and use C++ initializer 2015-06-30 09:10:53 +10:00
Michael du Breuil a382ce2b0c AP_GPS: Add support for logging ublox RXM-RAWX messages
Can only record 32 satellites raw info before memory corruption occurs. (And raised the limit on normal RXM-RAW messages to 22)
2015-06-30 09:05:49 +10:00
Michael du Breuil d665c85c20 DataFlash: Add RXM-RAWX logging messages 2015-06-30 09:05:48 +10:00
mirkix 38a8a772f8 AP_GPS: Add fix status 3D+DGPS 2015-06-30 09:00:31 +10:00
Andrew Tridgell 15efae5a48 HAL_SITL: use SITL_NUM_CHANNELS 2015-06-30 08:55:02 +10:00
Andrew Tridgell f8944ab6be SITL: define number of RC out channels 2015-06-30 08:54:46 +10:00
Vladislav Zakharov be4b6033e4 AP_HAL_Linux: Navio RCInput reimplemented. 2015-06-29 16:45:43 +10:00
Vladislav Zakharov e505eb2cd8 AP_HAL_Linux: Changes in Scheduler: Added defines for delays, RCIN_RERIOD changed 2015-06-29 16:45:42 +10:00
Przemek Lekston 90378b21da AP_BattMonitor: Fix battery monitor Floating Point Exception in SITL
Adds a sanity check to avoid division by zero when BATT_CAPACITY is set to 0.
2015-06-29 16:42:52 +10:00
Andrew Tridgell ff88932091 SITL: setup turbulence in JSBSim 2015-06-29 11:25:59 +10:00
Andrew Tridgell 92c9779d18 HAL_SITL: pass turbulence to simulators 2015-06-29 11:25:44 +10:00
Randy Mackay ef20676c67 GPS: fix INJECT_TO param desc and add definition
No functional change
2015-06-27 16:31:03 +09:00
Randy Mackay 0264b1aa84 AC_Circle: set only xy position targets 2015-06-27 15:43:49 +09:00
Randy Mackay 0b9c7c2a3b SerialManager: add SToRM32 to protocol param description 2015-06-27 11:18:17 +09:00
Víctor Mayoral Vilches ab5f1b3a24 BusTest: Fix compilation error with AP_ADC 2015-06-26 21:59:22 +10:00
Peter Barker 723c37bcf7 DataFlash: backend/frontend split 2015-06-26 16:02:50 +10:00
Andrew Tridgell 21c8a2d94a AP_Common: override new and delete on all platforms to zero memory
this guarantees that all classes get zero initial members when
they are dynamically allocated.
2015-06-26 15:55:19 +10:00
Andrew Tridgell eeb97800ae AC_AttitudeControl: allow for tail pass-thru in ACRO mode
this allows for all channels to be passed through
2015-06-26 12:45:38 +09:00
Michael du Breuil e45f3537cf APM_Control: Remove duplicate include statements 2015-06-25 10:23:47 +10:00
Michael du Breuil aa04c81e3c APM_Control: Fix a typo in the docstring for YAW2SRV_SLIP 2015-06-25 10:22:36 +10:00
Tom Pittenger e6122d1a4e AP_Mission: ensure cache coherence on mission resume
- when resuming a mission we should read the value from storage of the same index to ensure we're not continuing an old cached version of the mission item.
- inherent problem: DO commands will continue and will be unaffected unless the new mission has a different DO_ command structure. If so, a set_current_cmd() or reset() should be issued by the GCS.
2015-06-25 10:21:06 +10:00
Andrew Tridgell a81590f7ac HAL_SITL: prevent FPE on zero range with optflow 2015-06-25 10:08:53 +10:00
Randy Mackay 9f17fc17ab NavEKF: update parameter descriptions 2015-06-24 16:25:14 +09:00
Paul Riseborough 87e6a24154 AP_NavEKF: Add public method to reset EKF height datum and baro alt 2015-06-24 16:25:11 +09:00
Randy Mackay 1e3e65e443 AC_AttControl: add shift_ef_yaw_target
This allows shifting the target heading in case the EKF shifts it's
heading estimate
2015-06-24 11:49:32 +09:00
Paul Riseborough e3ccb74e12 AP_NavEKF: Publish amount of in-flight yaw angle reset 2015-06-24 11:49:29 +09:00
Gustavo Jose de Sousa c72dc9bd45 AP_InertialSensor: make single rotation on MPU9250
The previous implementation made some boards apply two rotations to suit
their default orientation. That was happening because there was an
unconditional rotation being done (commented as "rotate for bbone
default").

This commit makes that unconditional rotation as a default rotation
instead and adjusts the former additional rotations to be single
rotations.
2015-06-22 17:45:20 +10:00
Gustavo Jose de Sousa 3dad768e8b AP_InertialSensor: log failure to initialize after max attempts on MPU9250
This happens for example when you are trying to use an SPI speed that's
above the one supported by the sensor or the controller.
2015-06-22 17:45:20 +10:00
Gustavo Jose de Sousa 587471ab54 AP_InertialSensor: disable I2C on MPU9250
As the datasheet says: "To prevent switching into I2C mode when using
SPI, the I2C interface should be disabled by setting the I2C_IF_DIS
configuration bit."

We also reset the sensor like PX4Firmware does for initializing the
MPU6000.  See: ee1d8cd770/src/drivers/mpu6000/mpu6000.cpp (L695)
2015-06-22 17:45:20 +10:00
Michael du Breuil 6cd81ae1fb APM_Control: Add PID logging to yaw controller 2015-06-22 15:41:44 +10:00
Michael du Breuil 225c946af0 DataFlash: Add PIDS for steering logging 2015-06-22 15:41:44 +10:00
Robert Lefebvre 11214b3414 AP_Motors: move constraints to set_throttle 2015-06-22 13:52:59 +09:00
Grant Morphett 84ac8abc42 AP_Mount: Fixed a bug with wrapping of panning angles. 2015-06-22 09:32:26 +09:00
Andrew Tridgell a424686d2f DataFlash: reduce future merge conflicts
an enum makes it easier to merge new messages
2015-06-20 16:18:50 +10:00
Andrew Tridgell 81e6d88560 StorageManager: fixed hang in erase()
found by coverity
2015-06-20 15:00:57 +10:00
Andrew Tridgell 4eab27abe9 AP_InertialSensor: fixed logic bug in MPU6000 init
thanks to coverity
2015-06-20 14:53:04 +10:00
Andrew Tridgell 131b345ccc APM_Control: cleanup some coverity warnings 2015-06-20 13:30:32 +10:00
Andrew Tridgell 322a61635f SITL: allow extra arguments to be passed to last_letter 2015-06-19 16:39:46 +10:00
Robert Lefebvre 0c92565d23 AP_MotorsHeli: add Critical Rotor Speed param, use to switch off runup_complete 2015-06-19 15:10:53 +09:00
Robert Lefebvre 3ad6700c5d AP_MotorsHeli: add getters for rotor speed 2015-06-19 15:10:51 +09:00
Robert Lefebvre 8b917b82ee AP_MotorsHeli: Simplify set_desired_rotor_speed function definition 2015-06-19 15:10:50 +09:00
Robert Lefebvre 79e8c8f7f7 AP_MotorsHeli: whitespace fixes 2015-06-19 15:10:47 +09:00
Georacer b375a8debf SITL: Allows last_letter to start at the location specified by the SITL arguments 2015-06-19 12:49:29 +10:00
Leonard Hall cfc388934b AC_AttControl: add set_accel_roll_max
Also equivalents for pitch and yaw
2015-06-18 23:06:33 +09:00
mirkix 7c55689aad AP_HAL_Linux: Fix loading Firmware 2015-06-18 10:13:49 +10:00
Paul Riseborough 6ba8cd05ff AP_NavEKF: Fix bug preventing GPS vertical velocity being used
This fixes a bug that prevents GPS velocity being used permanently if there is a temporary unavailability
2015-06-18 09:01:21 +10:00
mirkix a1d478909a AP_BattMonitor: Add Linux support for example 2015-06-18 09:00:01 +10:00
mirkix d169fea9ec AP_AHRS: Add Linux support for example 2015-06-18 08:59:16 +10:00
mirkix 588a16dec2 AP_InertialSensor: Add Linux support for VibTest example 2015-06-18 08:48:23 +10:00
Andrew Tridgell de11b5394e GCS_MAVLink: support NSH shell with SERIAL_CONTROL 2015-06-17 20:30:10 +10:00
Andrew Tridgell a0594bd50e GCS_MAVLink: regenerate headers 2015-06-17 20:30:10 +10:00
Andrew Tridgell bdbe1a7553 GCS_MAVLink: added SERIAL_CONTROL_DEV_SHELL 2015-06-17 20:30:09 +10:00
Andrew Tridgell d909f11ba3 HAL_PX4: added implementation of NSH shell stream 2015-06-17 20:30:09 +10:00
Andrew Tridgell 7f239f5d46 AP_HAL: added get_shell_stream() 2015-06-17 17:04:15 +10:00
Andrew Tridgell 4fe092fead AP_InertialSensor: panic on bad gyro or accel sample rates 2015-06-17 15:01:23 +10:00
Andrew Tridgell d3b85eb792 AP_InertialSensor: use driver supplied sample rate
this will work with a wider range of sensors
2015-06-17 14:44:19 +10:00
Andrew Tridgell e91bfdfc1c AP_InertialSensor: fixed VibTest example build 2015-06-17 14:15:58 +10:00
Andrew Tridgell feb928dcd3 DataFlash: fixed build warnings 2015-06-17 13:10:26 +10:00
Andrew Tridgell c9988d8b37 AP_NavEKF: rely on delta_velocity and delta_angles always being available 2015-06-17 13:10:26 +10:00
Andrew Tridgell bc0ae630a1 AP_InertialSensor: always provide delta_velocity and delta_angles
this makes the NavEKF code simpler
2015-06-17 13:10:26 +10:00
Andrew Tridgell a115182041 AP_NavEKF: fixed minimum deltat to be 100us 2015-06-17 13:10:26 +10:00
Andrew Tridgell c221959d5a AP_NavEKF: fixed corrected del velocity to use both accels 2015-06-17 13:10:25 +10:00
Andrew Tridgell f831c16238 AP_InertialSensor: use fixed sensor sample times
this uses fixed sample times for PX4 IMUs, rather than reported
timestamps. It avoids timing jitter caused by the over-sampling in
the PX4 drivers
2015-06-17 13:03:56 +10:00
Andrew Tridgell f77ffd30f6 AP_GPS: fixed HIL GPS driver to make have vertical velocity sticky 2015-06-17 12:46:56 +10:00
Randy Mackay 9d81856580 InertialSensor: fix name of get_delta_velocity method 2015-06-17 12:46:54 +10:00
Randy Mackay 384755e271 Dataflash: add IMT messages 2015-06-17 12:46:54 +10:00
Andrew Tridgell 727be87d84 AP_InertialSensor: support HIL functions for delta_velocity and delta_angles 2015-06-16 09:53:55 +10:00
Andrew Tridgell 4677c189e0 HAL_SITL: support balloon model 2015-06-15 09:20:56 +10:00
Andrew Tridgell 83cc60a699 SITL: added simple balloon simulator
for testing balloon release code in plane
2015-06-15 09:20:55 +10:00
Andrew Tridgell 5e80f0cf72 APM_Control: allow for multiple stop calls in autotune 2015-06-15 09:20:54 +10:00
Andrew Tridgell 9bd8e215b2 AP_Mission: enable DO_AUTOTUNE_ENABLE 2015-06-15 09:20:54 +10:00
Andrew Tridgell 08acde2766 AP_Mission: added ALTITUDE_WAIT NAV command
used for HAB launch
2015-06-15 09:20:54 +10:00
Andrew Tridgell c415bfe766 GCS_MAVLink: regenerate headers 2015-06-15 09:20:54 +10:00
Andrew Tridgell 3ef44459c8 GCS_MAVLink: added ALTITUDE_WAIT message 2015-06-15 09:17:27 +10:00
Randy Mackay 69e59b2d99 GCS_MAVLink: update version after adding LANDING_TARGET 2015-06-12 21:37:09 +09:00
Randy Mackay 835a203566 GCS_MAVLink: generate after adding LANDING_TARGET 2015-06-12 21:37:07 +09:00
Randy Mackay 94aec19336 GCS_MAVLink: import LANDING_TARGET from upstream 2015-06-12 21:37:04 +09:00
Randy Mackay 76fdfdfcf2 GCS_MAVLink: do not send_vibration on APM2 2015-06-12 21:37:01 +09:00
Randy Mackay 0d239d2746 DataFlash: disable vibration logging on APM2
Also remove unnecessary include
2015-06-12 21:36:59 +09:00
Randy Mackay 8ceccd778d InertialSensor: disable vibration checks on APM2
Also bug fix get_accel_clip_count's instance check
2015-06-12 21:36:56 +09:00
Randy Mackay 642aa74530 GCS_MAVLink: add send_vibration 2015-06-12 21:36:42 +09:00
Randy Mackay 581e43bd0e GCS_MAVLink: update version after adding VIBRATION msg 2015-06-12 21:36:39 +09:00
Randy Mackay afbb670e73 GCS_MAVLink: generate after adding VIBRATION message 2015-06-12 21:36:36 +09:00