2013-04-26 20:14:32 -03:00
|
|
|
#!nsh
|
|
|
|
#
|
2017-10-05 18:29:44 -03:00
|
|
|
# Standard startup script for sensor drivers.
|
2013-04-26 20:14:32 -03:00
|
|
|
#
|
2018-07-26 21:18:53 -03:00
|
|
|
# NOTE: Script variables are declared/initialized/unset in the rcS script.
|
|
|
|
#
|
2013-04-26 20:14:32 -03:00
|
|
|
|
2018-07-20 01:32:11 -03:00
|
|
|
###############################################################################
|
|
|
|
# Begin Setup for board specific configurations. #
|
|
|
|
###############################################################################
|
|
|
|
|
2018-08-11 05:33:43 -03:00
|
|
|
if ! ver hwcmp AEROFC_V1 OMNIBUS_F4SD
|
2015-05-10 05:21:16 -03:00
|
|
|
then
|
2018-08-11 05:33:43 -03:00
|
|
|
if ! ver hwcmp CRAZYFLIE
|
2016-11-08 16:58:32 -04:00
|
|
|
then
|
2017-08-10 15:31:54 -03:00
|
|
|
# Configure all I2C buses to 100 KHz as they
|
|
|
|
# are all external or slow
|
|
|
|
fmu i2c 1 100000
|
|
|
|
fmu i2c 2 100000
|
|
|
|
fi
|
2016-12-04 00:53:50 -04:00
|
|
|
|
2017-08-10 15:31:54 -03:00
|
|
|
if ver hwcmp PX4FMU_V4
|
|
|
|
then
|
|
|
|
# We know there are sketchy boards out there
|
|
|
|
# as chinese companies produce Pixracers without
|
|
|
|
# fully understanding the critical parts of the
|
|
|
|
# schematic and BOM, leading to sensor brownouts
|
|
|
|
# on boot. Original Pixracers following the
|
|
|
|
# open hardware design do not require this.
|
|
|
|
fmu sensor_reset 50
|
|
|
|
fi
|
2016-12-04 00:53:50 -04:00
|
|
|
|
2017-08-10 15:31:54 -03:00
|
|
|
# External SPI
|
|
|
|
ms5611 -S start
|
2016-12-04 00:53:50 -04:00
|
|
|
|
2018-03-06 03:09:19 -04:00
|
|
|
# Internal SPI (auto detect ms5611 or ms5607)
|
|
|
|
ms5611 -T 0 -s start
|
2016-12-04 00:53:50 -04:00
|
|
|
|
2017-08-10 15:31:54 -03:00
|
|
|
# Blacksheep telemetry
|
|
|
|
bst start
|
2015-05-10 05:21:16 -03:00
|
|
|
|
2017-08-06 15:09:52 -03:00
|
|
|
adc start
|
2015-05-10 05:21:16 -03:00
|
|
|
fi
|
2013-04-26 20:14:32 -03:00
|
|
|
|
2018-07-20 01:32:11 -03:00
|
|
|
if ver hwcmp AEROFC_V1
|
2017-06-17 00:00:55 -03:00
|
|
|
then
|
2018-07-20 01:32:11 -03:00
|
|
|
ms5611 -T 0 start
|
|
|
|
mpu9250 -s -R 14 start
|
2017-08-09 22:46:04 -03:00
|
|
|
|
2018-07-20 01:32:11 -03:00
|
|
|
# Possible external compasses
|
|
|
|
hmc5883 -X start
|
2017-08-31 23:39:41 -03:00
|
|
|
|
2018-07-20 01:32:11 -03:00
|
|
|
ist8310 -C -b 1 -R 4 start
|
|
|
|
aerofc_adc start
|
|
|
|
ll40ls start i2c
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ver hwcmp AEROCORE2
|
|
|
|
then
|
|
|
|
l3gd20 -R 12 start
|
|
|
|
lsm303d start
|
2017-06-17 00:00:55 -03:00
|
|
|
fi
|
|
|
|
|
2016-11-23 21:20:23 -04:00
|
|
|
if ver hwcmp AUAV_X21
|
|
|
|
then
|
2017-06-27 08:21:38 -03:00
|
|
|
# External I2C bus
|
2017-08-06 15:09:52 -03:00
|
|
|
hmc5883 -C -T -X start
|
2018-02-12 21:49:29 -04:00
|
|
|
lis3mdl -X start
|
2017-02-15 23:00:36 -04:00
|
|
|
|
2016-11-23 21:20:23 -04:00
|
|
|
# Internal SPI bus ICM-20608-G is rotated 90 deg yaw
|
2017-08-06 15:09:52 -03:00
|
|
|
mpu6000 -R 2 -T 20608 start
|
2016-11-23 21:20:23 -04:00
|
|
|
|
2017-10-14 16:33:24 -03:00
|
|
|
# Internal SPI bus ICM-20602-G is rotated 90 deg yaw
|
|
|
|
mpu6000 -R 2 -T 20602 start
|
|
|
|
|
2016-11-23 21:20:23 -04:00
|
|
|
# Internal SPI bus mpu9250 is rotated 90 deg yaw
|
2017-08-06 15:09:52 -03:00
|
|
|
mpu9250 -R 2 start
|
2016-11-23 21:20:23 -04:00
|
|
|
fi
|
|
|
|
|
2018-07-20 01:32:11 -03:00
|
|
|
if ver hwcmp AV_X_V1
|
|
|
|
then
|
|
|
|
adis16477 -R 8 start
|
|
|
|
|
|
|
|
#adis16497 start
|
|
|
|
|
2018-07-30 00:32:55 -03:00
|
|
|
lps22hb -S start
|
2018-07-20 01:32:11 -03:00
|
|
|
|
|
|
|
lsm303agr -R 4 start
|
|
|
|
|
2018-07-30 01:10:26 -03:00
|
|
|
ms4525_airspeed -T 4515 -b 3 start
|
|
|
|
|
2018-07-20 01:32:11 -03:00
|
|
|
fi
|
|
|
|
|
|
|
|
if ver hwcmp CRAZYFLIE
|
|
|
|
then
|
|
|
|
# Onboard I2C
|
|
|
|
mpu9250 -R 12 start
|
|
|
|
|
|
|
|
# I2C bypass of mpu
|
|
|
|
lps25h start
|
|
|
|
|
|
|
|
# Optical flow deck
|
|
|
|
vl53lxx start
|
|
|
|
pmw3901 start
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ver hwcmp NXPHLITE_V3
|
|
|
|
then
|
2018-06-21 20:01:30 -03:00
|
|
|
# External I2C bus
|
|
|
|
hmc5883 -C -X start
|
|
|
|
|
|
|
|
# Onboard I2C (baro) but an external bus on V3 RC15
|
|
|
|
mpl3115a2 -X start
|
2018-07-20 01:32:11 -03:00
|
|
|
|
|
|
|
# Internal SPI (accel + mag)
|
|
|
|
fxos8701cq start -a 8 -R 0
|
|
|
|
|
|
|
|
# Internal SPI (gyro)
|
|
|
|
fxas21002c start -R 0
|
|
|
|
fi
|
|
|
|
|
2018-08-02 10:21:56 -03:00
|
|
|
# V2 build hwtypecmp is always false
|
|
|
|
set BOARD_FMUV3 0
|
|
|
|
|
2015-02-09 08:57:04 -04:00
|
|
|
if ver hwcmp PX4FMU_V2
|
2014-07-16 10:02:25 -03:00
|
|
|
then
|
2015-02-09 09:50:26 -04:00
|
|
|
# External I2C bus
|
2017-08-06 15:09:52 -03:00
|
|
|
hmc5883 -C -T -X start
|
|
|
|
lis3mdl -X start
|
2018-08-02 10:23:05 -03:00
|
|
|
ist8310 -C start
|
2016-03-19 03:27:09 -03:00
|
|
|
|
2015-02-09 09:50:26 -04:00
|
|
|
# Internal I2C bus
|
2017-08-06 15:09:52 -03:00
|
|
|
hmc5883 -C -T -I -R 4 start
|
2013-12-15 14:35:23 -04:00
|
|
|
|
2016-08-18 16:02:48 -03:00
|
|
|
# Internal SPI bus ICM-20608-G
|
2017-08-06 15:09:52 -03:00
|
|
|
mpu6000 -T 20608 start
|
2016-08-18 16:02:48 -03:00
|
|
|
|
2017-07-21 16:01:43 -03:00
|
|
|
# V3 build hwtypecmp supports V2|V2M|V30
|
|
|
|
if ver hwtypecmp V30
|
2014-07-16 06:26:32 -03:00
|
|
|
then
|
2017-07-21 16:01:43 -03:00
|
|
|
# Check for Pixhawk 2.0 cube
|
|
|
|
# external MPU6K is rotated 180 degrees yaw
|
|
|
|
if mpu6000 -S -R 4 start
|
2016-11-12 07:57:33 -04:00
|
|
|
then
|
2017-07-21 16:01:43 -03:00
|
|
|
set BOARD_FMUV3 20
|
2016-11-12 07:57:33 -04:00
|
|
|
else
|
2017-07-21 16:01:43 -03:00
|
|
|
# Check for Pixhawk 2.1 cube
|
|
|
|
# external MPU9250 is rotated 180 degrees yaw
|
|
|
|
if mpu9250 -S -R 4 start
|
|
|
|
then
|
|
|
|
set BOARD_FMUV3 21
|
|
|
|
fi
|
2016-11-12 07:57:33 -04:00
|
|
|
fi
|
2014-07-16 06:26:32 -03:00
|
|
|
fi
|
2015-02-09 08:57:04 -04:00
|
|
|
|
2018-01-01 12:30:55 -04:00
|
|
|
# Check if a Pixhack (which reports as V2M) is present
|
|
|
|
if ver hwtypecmp V2M
|
|
|
|
then
|
|
|
|
# Pixhawk Mini doesn't have these sensors,
|
|
|
|
# so if they are found we know its a Pixhack
|
|
|
|
|
|
|
|
# external MPU6K is rotated 180 degrees yaw
|
|
|
|
if mpu6000 -S -R 4 start
|
|
|
|
then
|
|
|
|
set BOARD_FMUV3 20
|
|
|
|
else
|
|
|
|
# Check for Pixhack 3.1
|
|
|
|
# external MPU9250 is rotated 180 degrees yaw
|
|
|
|
if mpu9250 -S -R 4 start
|
|
|
|
then
|
|
|
|
set BOARD_FMUV3 21
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2017-07-21 16:01:43 -03:00
|
|
|
if [ $BOARD_FMUV3 != 0 ]
|
2014-07-16 06:26:32 -03:00
|
|
|
then
|
2016-12-04 07:15:16 -04:00
|
|
|
# sensor heating is available, but we disable it for now
|
|
|
|
param set SENS_EN_THERMAL 0
|
|
|
|
|
2015-02-09 08:57:04 -04:00
|
|
|
# external L3GD20H is rotated 180 degrees yaw
|
2017-08-06 15:09:52 -03:00
|
|
|
l3gd20 -X -R 4 start
|
2015-02-09 08:57:04 -04:00
|
|
|
|
|
|
|
# external LSM303D is rotated 270 degrees yaw
|
2017-08-06 15:09:52 -03:00
|
|
|
lsm303d -X -R 6 start
|
2015-02-09 08:57:04 -04:00
|
|
|
|
2017-07-21 16:01:43 -03:00
|
|
|
if [ $BOARD_FMUV3 == 20 ]
|
2015-02-09 08:57:04 -04:00
|
|
|
then
|
2017-07-21 16:01:43 -03:00
|
|
|
# v2.0 internal MPU6000 is rotated 180 deg roll, 270 deg yaw
|
2017-08-06 15:09:52 -03:00
|
|
|
mpu6000 -R 14 start
|
2018-03-06 03:09:19 -04:00
|
|
|
|
2017-07-21 16:01:43 -03:00
|
|
|
# v2.0 Has internal hmc5883 on SPI1
|
2017-08-06 15:09:52 -03:00
|
|
|
hmc5883 -C -T -S -R 8 start
|
2017-07-21 16:01:43 -03:00
|
|
|
fi
|
2017-10-05 18:29:44 -03:00
|
|
|
|
2017-07-21 16:01:43 -03:00
|
|
|
if [ $BOARD_FMUV3 == 21 ]
|
2015-02-09 09:50:26 -04:00
|
|
|
then
|
2017-07-21 16:01:43 -03:00
|
|
|
# v2.1 internal MPU9250 is rotated 180 deg roll, 270 deg yaw
|
2017-08-06 15:09:52 -03:00
|
|
|
mpu9250 -R 14 start
|
2015-02-09 09:50:26 -04:00
|
|
|
fi
|
2017-07-21 16:01:43 -03:00
|
|
|
|
2014-07-16 09:58:43 -03:00
|
|
|
else
|
2017-07-21 16:01:43 -03:00
|
|
|
# $BOARD_FMUV3 == 0 -> FMUv2
|
|
|
|
|
2017-08-06 15:09:52 -03:00
|
|
|
mpu6000 start
|
2014-07-16 09:58:43 -03:00
|
|
|
|
2017-07-21 16:01:43 -03:00
|
|
|
# As we will use the external mag and the ICM-20608-G
|
|
|
|
# V2 build hwtypecmp is always false
|
|
|
|
# V3 build hwtypecmp supports V2|V2M|V30
|
2018-08-11 05:33:43 -03:00
|
|
|
if ! ver hwtypecmp V2M
|
2016-08-23 14:51:57 -03:00
|
|
|
then
|
2017-08-06 15:09:52 -03:00
|
|
|
mpu9250 start
|
2018-08-11 05:33:43 -03:00
|
|
|
# else: On the PixhawkMini the mpu9250 has been disabled due to HW errata
|
2016-08-23 14:51:57 -03:00
|
|
|
fi
|
|
|
|
|
2017-08-06 15:09:52 -03:00
|
|
|
l3gd20 start
|
|
|
|
lsm303d start
|
2015-02-09 08:57:04 -04:00
|
|
|
fi
|
2016-03-29 23:27:39 -03:00
|
|
|
fi
|
|
|
|
|
2017-06-14 20:30:20 -03:00
|
|
|
if ver hwcmp PX4_SAME70XPLAINED_V1
|
|
|
|
then
|
|
|
|
# External I2C bus
|
2017-08-09 22:46:04 -03:00
|
|
|
hmc5883 -C -T -X start
|
2017-06-14 20:30:20 -03:00
|
|
|
|
|
|
|
# Internal SPI bus mpu9250 is rotated 90 deg yaw
|
2017-08-09 22:46:04 -03:00
|
|
|
mpu9250 -R 2 start
|
2017-06-14 20:30:20 -03:00
|
|
|
fi
|
|
|
|
|
2016-03-29 23:27:39 -03:00
|
|
|
if ver hwcmp PX4FMU_V4
|
|
|
|
then
|
|
|
|
# External I2C bus
|
2017-08-06 15:09:52 -03:00
|
|
|
hmc5883 -C -T -X start
|
2017-10-05 18:29:44 -03:00
|
|
|
lis3mdl -X start
|
|
|
|
bmp280 -I start
|
2014-07-16 10:02:25 -03:00
|
|
|
|
2017-10-05 18:29:44 -03:00
|
|
|
# expansion i2c used for BMM150 rotated by 90deg
|
|
|
|
bmm150 -R 2 start
|
2017-02-14 12:37:04 -04:00
|
|
|
|
2018-08-11 05:33:43 -03:00
|
|
|
# hmc5883 internal SPI bus is rotated 90 deg yaw
|
|
|
|
if ! hmc5883 -C -T -S -R 2 start
|
2017-10-05 18:29:44 -03:00
|
|
|
then
|
2018-08-11 05:33:43 -03:00
|
|
|
# lis3mdl internal SPI bus is rotated 90 deg yaw
|
|
|
|
if ! lis3mdl start
|
2017-10-05 18:29:44 -03:00
|
|
|
then
|
|
|
|
# BMI055 gyro internal SPI bus
|
2018-01-18 09:16:44 -04:00
|
|
|
bmi055 -G start
|
2017-10-05 18:29:44 -03:00
|
|
|
fi
|
|
|
|
fi
|
2017-04-23 11:54:39 -03:00
|
|
|
|
2017-10-05 18:29:44 -03:00
|
|
|
# Start either ICM2060X or BMI055. They are both connected to the same SPI bus and use the same
|
2016-12-02 05:03:07 -04:00
|
|
|
# chip select pin. There are different boards with either one of them and the WHO_AM_I register
|
|
|
|
# will prevent the incorrect driver from a successful initialization.
|
|
|
|
|
2018-08-11 05:33:43 -03:00
|
|
|
# ICM20602 internal SPI bus ICM-20608-G is rotated 90 deg yaw
|
|
|
|
if ! mpu6000 -R 2 -T 20602 start
|
2017-10-05 18:29:44 -03:00
|
|
|
then
|
2018-08-11 05:33:43 -03:00
|
|
|
# ICM20608 internal SPI bus ICM-20602-G is rotated 90 deg yaw
|
|
|
|
if ! mpu6000 -R 2 -T 20608 start
|
2017-10-05 18:29:44 -03:00
|
|
|
then
|
|
|
|
# BMI055 accel internal SPI bus
|
|
|
|
bmi055 -A start
|
|
|
|
fi
|
|
|
|
fi
|
2017-02-17 10:54:14 -04:00
|
|
|
|
2017-10-05 18:29:44 -03:00
|
|
|
# Start either MPU9250 or BMI160. They are both connected to the same SPI bus and use the same
|
2017-02-17 10:54:14 -04:00
|
|
|
# chip select pin. There are different boards with either one of them and the WHO_AM_I register
|
|
|
|
# will prevent the incorrect driver from a successful initialization.
|
|
|
|
|
2018-08-11 05:33:43 -03:00
|
|
|
# mpu9250 internal SPI bus mpu9250 is rotated 90 deg yaw
|
|
|
|
if ! mpu9250 -R 2 start
|
2017-10-05 18:29:44 -03:00
|
|
|
then
|
|
|
|
# BMI160 internal SPI bus
|
|
|
|
bmi160 start
|
|
|
|
fi
|
2016-03-29 23:27:39 -03:00
|
|
|
fi
|
|
|
|
|
|
|
|
if ver hwcmp MINDPX_V2
|
|
|
|
then
|
2016-08-17 04:37:19 -03:00
|
|
|
# External I2C bus
|
2017-08-06 15:09:52 -03:00
|
|
|
hmc5883 -C -T -X start
|
2017-10-05 18:29:44 -03:00
|
|
|
|
2016-08-17 04:37:19 -03:00
|
|
|
# Internal I2C bus
|
2017-08-06 15:09:52 -03:00
|
|
|
hmc5883 -C -T -I -R 12 start
|
2017-10-05 18:29:44 -03:00
|
|
|
|
2017-08-06 15:09:52 -03:00
|
|
|
mpu6000 -s -R 8 start
|
|
|
|
mpu9250 -s -R 8 start
|
|
|
|
lsm303d -R 10 start
|
|
|
|
l3gd20 -R 14 start
|
2013-04-26 20:14:32 -03:00
|
|
|
fi
|
|
|
|
|
Initial omnibusf4sd target support
Flight tested: ekf2 w/ mag and compass by @nathantsoi: https://logs.px4.io/plot_app?log=79b81031-cf1e-41f0-890b-d6cd7d559766
NOTE: external I2C devices need a pullup. I have tested with a 3.3v 2.2k pullup.
Working:
- mpu6000, bench tested and verified via nsh
- fmu
- all 6 ch output bench tested w/ pwm and oneshot via nsh
- ppm input bench tested
- dsm input bench tested
- bmp280, bench tested and verified via nsh
- hmc5883, bench tested and verified via nsh, but requires an external i2c pullup
- gps on uart6
- startuplog, nsh, mavlink on uart4, but params are not sent for some reason. RSSI pin is TX, MOTOR 5 is RX (normal mode, 57600 baud)
- rgbled over i2c, bench tested and workingp
- sbus via the shared sbus/ppm pin (which includes an inverter to the mcu SBUS in pin), remove the solder bridge or jumper to the ppm pin before use
Not yet implemented:
- ADC
- OSD: passthrough video is untested, use at your own risk until a basic driver is implemented.
2018-03-27 23:01:20 -03:00
|
|
|
if ver hwcmp OMNIBUS_F4SD
|
|
|
|
then
|
2018-08-11 05:33:43 -03:00
|
|
|
if ! mpu6000 -R 12 -s start
|
2018-07-23 04:30:23 -03:00
|
|
|
then
|
|
|
|
# some boards such as the Hobbywing XRotor F4 G2 use the ICM-20602
|
|
|
|
mpu6000 -R 12 -T 20602 -s start
|
|
|
|
fi
|
Initial omnibusf4sd target support
Flight tested: ekf2 w/ mag and compass by @nathantsoi: https://logs.px4.io/plot_app?log=79b81031-cf1e-41f0-890b-d6cd7d559766
NOTE: external I2C devices need a pullup. I have tested with a 3.3v 2.2k pullup.
Working:
- mpu6000, bench tested and verified via nsh
- fmu
- all 6 ch output bench tested w/ pwm and oneshot via nsh
- ppm input bench tested
- dsm input bench tested
- bmp280, bench tested and verified via nsh
- hmc5883, bench tested and verified via nsh, but requires an external i2c pullup
- gps on uart6
- startuplog, nsh, mavlink on uart4, but params are not sent for some reason. RSSI pin is TX, MOTOR 5 is RX (normal mode, 57600 baud)
- rgbled over i2c, bench tested and workingp
- sbus via the shared sbus/ppm pin (which includes an inverter to the mcu SBUS in pin), remove the solder bridge or jumper to the ppm pin before use
Not yet implemented:
- ADC
- OSD: passthrough video is untested, use at your own risk until a basic driver is implemented.
2018-03-27 23:01:20 -03:00
|
|
|
|
|
|
|
# Possible external compasses
|
|
|
|
hmc5883 -X start
|
|
|
|
|
|
|
|
bmp280 start
|
2018-05-28 02:14:30 -03:00
|
|
|
|
|
|
|
adc start
|
Initial omnibusf4sd target support
Flight tested: ekf2 w/ mag and compass by @nathantsoi: https://logs.px4.io/plot_app?log=79b81031-cf1e-41f0-890b-d6cd7d559766
NOTE: external I2C devices need a pullup. I have tested with a 3.3v 2.2k pullup.
Working:
- mpu6000, bench tested and verified via nsh
- fmu
- all 6 ch output bench tested w/ pwm and oneshot via nsh
- ppm input bench tested
- dsm input bench tested
- bmp280, bench tested and verified via nsh
- hmc5883, bench tested and verified via nsh, but requires an external i2c pullup
- gps on uart6
- startuplog, nsh, mavlink on uart4, but params are not sent for some reason. RSSI pin is TX, MOTOR 5 is RX (normal mode, 57600 baud)
- rgbled over i2c, bench tested and workingp
- sbus via the shared sbus/ppm pin (which includes an inverter to the mcu SBUS in pin), remove the solder bridge or jumper to the ppm pin before use
Not yet implemented:
- ADC
- OSD: passthrough video is untested, use at your own risk until a basic driver is implemented.
2018-03-27 23:01:20 -03:00
|
|
|
fi
|
|
|
|
|
2016-12-12 18:11:25 -04:00
|
|
|
if ver hwcmp PX4FMU_V4PRO
|
|
|
|
then
|
|
|
|
# Internal SPI bus ICM-20608-G
|
2017-08-06 15:09:52 -03:00
|
|
|
mpu6000 -R 2 -T 20608 start
|
2017-06-09 04:20:13 -03:00
|
|
|
|
2017-05-18 06:05:07 -03:00
|
|
|
# Internal SPI bus ICM-20602
|
2017-08-06 15:09:52 -03:00
|
|
|
mpu6000 -R 2 -T 20602 start
|
2016-12-12 18:11:25 -04:00
|
|
|
|
|
|
|
# Internal SPI bus mpu9250
|
2017-08-06 15:09:52 -03:00
|
|
|
mpu9250 -R 2 start
|
2016-12-12 18:11:25 -04:00
|
|
|
|
2017-01-25 10:51:37 -04:00
|
|
|
# Internal SPI bus
|
2017-08-06 15:09:52 -03:00
|
|
|
lis3mdl -R 0 start
|
2017-04-10 04:06:21 -03:00
|
|
|
|
2016-12-12 18:11:25 -04:00
|
|
|
# Possible external compasses
|
2017-08-06 15:09:52 -03:00
|
|
|
hmc5883 -C -T -X start
|
2016-12-12 18:11:25 -04:00
|
|
|
fi
|
|
|
|
|
2016-12-13 21:24:04 -04:00
|
|
|
if ver hwcmp PX4FMU_V5
|
|
|
|
then
|
2017-05-23 09:14:07 -03:00
|
|
|
|
2016-12-13 21:24:04 -04:00
|
|
|
# Internal SPI bus ICM-20602
|
2017-08-06 15:09:52 -03:00
|
|
|
mpu6000 -R 8 -s -T 20602 start
|
2016-12-13 21:24:04 -04:00
|
|
|
|
|
|
|
# Internal SPI bus ICM-20689
|
2017-08-06 15:09:52 -03:00
|
|
|
mpu6000 -R 8 -z -T 20689 start
|
2016-12-13 21:24:04 -04:00
|
|
|
|
2017-04-23 13:20:16 -03:00
|
|
|
# Internal SPI bus BMI055 accel
|
2017-08-06 15:09:52 -03:00
|
|
|
bmi055 -A -R 10 start
|
2017-04-23 13:20:16 -03:00
|
|
|
|
|
|
|
# Internal SPI bus BMI055 gyro
|
2017-08-06 15:09:52 -03:00
|
|
|
bmi055 -G -R 10 start
|
2016-12-13 21:24:04 -04:00
|
|
|
|
|
|
|
# Possible external compasses
|
2017-08-06 15:09:52 -03:00
|
|
|
hmc5883 -C -T -X start
|
2017-08-24 22:28:27 -03:00
|
|
|
|
|
|
|
# Possible external compasses
|
|
|
|
|
|
|
|
ist8310 -C -b 1 start
|
|
|
|
ist8310 -C -b 2 start
|
|
|
|
|
|
|
|
# Possible internal compass
|
2017-12-07 12:29:00 -04:00
|
|
|
ist8310 -C -b 5 start
|
2016-12-13 21:24:04 -04:00
|
|
|
fi
|
|
|
|
|
2018-07-20 01:32:11 -03:00
|
|
|
###############################################################################
|
|
|
|
# End Setup for board specific configurations. #
|
|
|
|
###############################################################################
|
2018-04-27 14:10:42 -03:00
|
|
|
|
2018-07-20 01:32:11 -03:00
|
|
|
###############################################################################
|
|
|
|
# Begin Optional drivers #
|
|
|
|
###############################################################################
|
2017-06-16 12:49:14 -03:00
|
|
|
|
2017-10-05 18:29:44 -03:00
|
|
|
if [ ${VEHICLE_TYPE} == fw -o ${VEHICLE_TYPE} == vtol ]
|
2017-05-22 11:06:29 -03:00
|
|
|
then
|
2017-10-05 18:29:44 -03:00
|
|
|
if param compare CBRK_AIRSPD_CHK 0
|
|
|
|
then
|
2018-06-17 16:04:10 -03:00
|
|
|
sdp3x_airspeed start -a
|
2017-05-22 11:06:29 -03:00
|
|
|
|
2017-10-05 18:29:44 -03:00
|
|
|
# Pixhawk 2.1 has a MS5611 on I2C which gets wrongly
|
|
|
|
# detected as MS5525 because the chip manufacturer was so
|
|
|
|
# clever to assign the same I2C address and skip a WHO_AM_I
|
|
|
|
# register.
|
|
|
|
if [ $BOARD_FMUV3 == 21 ]
|
|
|
|
then
|
|
|
|
ms5525_airspeed start -b 2
|
|
|
|
else
|
2018-06-17 16:04:10 -03:00
|
|
|
ms5525_airspeed start -a
|
2017-10-05 18:29:44 -03:00
|
|
|
fi
|
2017-05-22 11:06:29 -03:00
|
|
|
|
2018-06-17 16:04:10 -03:00
|
|
|
ms4525_airspeed start -a
|
|
|
|
|
|
|
|
ets_airspeed start -a
|
2017-10-05 18:29:44 -03:00
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
2013-09-29 09:07:01 -03:00
|
|
|
|
2017-06-16 12:49:14 -03:00
|
|
|
# Sensors on the PWM interface bank
|
|
|
|
if param compare SENS_EN_LL40LS 1
|
|
|
|
then
|
|
|
|
if pwm_input start
|
|
|
|
then
|
2017-08-06 15:09:52 -03:00
|
|
|
ll40ls start pwm
|
2017-06-16 12:49:14 -03:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Lidar-Lite on I2C
|
|
|
|
if param compare SENS_EN_LL40LS 2
|
|
|
|
then
|
2017-08-06 15:09:52 -03:00
|
|
|
ll40ls start i2c
|
2017-06-16 12:49:14 -03:00
|
|
|
fi
|
|
|
|
|
2018-07-20 01:32:11 -03:00
|
|
|
# Lightware serial lidar sensor
|
2017-10-05 18:29:44 -03:00
|
|
|
if param greater SENS_EN_SF0X 0
|
2017-06-16 12:49:14 -03:00
|
|
|
then
|
2018-06-22 11:14:26 -03:00
|
|
|
sf0x start
|
2017-06-16 12:49:14 -03:00
|
|
|
fi
|
|
|
|
|
2018-07-20 01:32:11 -03:00
|
|
|
# Lightware i2c lidar sensor
|
2017-10-05 18:29:44 -03:00
|
|
|
if param greater SENS_EN_SF1XX 0
|
2017-06-16 12:49:14 -03:00
|
|
|
then
|
2018-06-22 11:10:24 -03:00
|
|
|
sf1xx start -a
|
2017-06-16 12:49:14 -03:00
|
|
|
fi
|
|
|
|
|
|
|
|
# mb12xx sonar sensor
|
2017-10-05 18:29:44 -03:00
|
|
|
if param greater SENS_EN_MB12XX 0
|
2017-06-16 12:49:14 -03:00
|
|
|
then
|
2018-06-22 11:10:24 -03:00
|
|
|
mb12xx start -a
|
2017-06-16 12:49:14 -03:00
|
|
|
fi
|
|
|
|
|
2018-07-20 01:32:11 -03:00
|
|
|
# Teraranger one tof sensor
|
2017-10-05 18:29:44 -03:00
|
|
|
if param greater SENS_EN_TRANGER 0
|
2017-06-16 12:49:14 -03:00
|
|
|
then
|
2018-06-22 11:10:24 -03:00
|
|
|
teraranger start -a
|
2017-06-16 12:49:14 -03:00
|
|
|
fi
|
|
|
|
|
2018-01-01 10:38:55 -04:00
|
|
|
# Benewake TFMini
|
|
|
|
if param greater SENS_EN_TFMINI 0
|
|
|
|
then
|
2018-03-15 14:26:35 -03:00
|
|
|
if ver hwcmp PX4FMU_V2 PX4FMU_V4PRO
|
2018-01-18 09:16:44 -04:00
|
|
|
then
|
|
|
|
# start the driver on serial 4/5
|
|
|
|
tfmini start -d /dev/ttyS6
|
2018-01-31 04:14:34 -04:00
|
|
|
else
|
|
|
|
if ver hwcmp AEROFC_V1
|
|
|
|
then
|
|
|
|
# start the driver on telemetry
|
|
|
|
tfmini start -d /dev/ttyS3
|
|
|
|
else
|
|
|
|
if param compare SYS_COMPANION 0
|
|
|
|
then
|
|
|
|
# start on default mavlink companion device
|
|
|
|
tfmini start -d /dev/ttyS2
|
|
|
|
fi
|
|
|
|
fi
|
2018-01-18 09:16:44 -04:00
|
|
|
fi
|
2018-01-01 10:38:55 -04:00
|
|
|
fi
|
|
|
|
|
2017-11-30 21:30:45 -04:00
|
|
|
# LeddarOne
|
|
|
|
if param greater SENS_EN_LEDDAR1 0
|
|
|
|
then
|
2018-03-15 14:26:35 -03:00
|
|
|
if ver hwcmp PX4FMU_V2 PX4FMU_V4PRO
|
2017-11-30 21:30:45 -04:00
|
|
|
then
|
|
|
|
# start the driver on serial 4/5
|
|
|
|
leddar_one -d /dev/ttyS6 start
|
2018-02-08 20:34:13 -04:00
|
|
|
fi
|
2017-11-30 21:30:45 -04:00
|
|
|
if ver hwcmp AEROFC_V1
|
|
|
|
then
|
|
|
|
# start the driver on telemetry
|
|
|
|
leddar_one -d /dev/ttyS3 start
|
|
|
|
else
|
|
|
|
if param compare SYS_COMPANION 0
|
|
|
|
then
|
|
|
|
# start on default mavlink companion device
|
|
|
|
leddar_one -d /dev/ttyS2 start
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2018-07-20 01:32:11 -03:00
|
|
|
###############################################################################
|
|
|
|
# End Optional drivers #
|
|
|
|
###############################################################################
|
|
|
|
|
2018-08-02 10:21:56 -03:00
|
|
|
unset BOARD_FMUV3
|
|
|
|
|
2015-09-07 10:43:43 -03:00
|
|
|
# Wait 20 ms for sensors (because we need to wait for the HRT and work queue callbacks to fire)
|
|
|
|
usleep 20000
|
2017-10-05 18:29:44 -03:00
|
|
|
sensors start
|