mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-30 16:00:15 +08:00
restore px4fmu-v2_test
This commit is contained in:
committed by
Lorenz Meier
parent
848e87ff76
commit
2bc74fd5d9
@@ -0,0 +1,201 @@
|
||||
#!nsh
|
||||
#
|
||||
# Standard startup script for PX4FMU v1, v2, v3, v4 onboard sensor drivers.
|
||||
#
|
||||
|
||||
if ver hwcmp PX4FMU_V1
|
||||
then
|
||||
if ms5611 start
|
||||
then
|
||||
fi
|
||||
else
|
||||
# Configure all I2C buses to 100 KHz as they
|
||||
# are all external or slow
|
||||
fmu i2c 1 100000
|
||||
fmu i2c 2 100000
|
||||
|
||||
if ms5611 -s start
|
||||
then
|
||||
fi
|
||||
|
||||
# Blacksheep telemetry
|
||||
if bst start
|
||||
then
|
||||
fi
|
||||
fi
|
||||
|
||||
if adc start
|
||||
then
|
||||
fi
|
||||
|
||||
if ver hwcmp PX4FMU_V2
|
||||
then
|
||||
# External I2C bus
|
||||
if hmc5883 -C -T -X start
|
||||
then
|
||||
fi
|
||||
|
||||
# External I2C bus
|
||||
if lis3mdl -X start
|
||||
then
|
||||
fi
|
||||
|
||||
# Internal I2C bus
|
||||
if hmc5883 -C -T -I -R 4 start
|
||||
then
|
||||
fi
|
||||
|
||||
# external MPU6K is rotated 180 degrees yaw
|
||||
if mpu6000 -X -R 4 start
|
||||
then
|
||||
set BOARD_FMUV3 true
|
||||
else
|
||||
set BOARD_FMUV3 false
|
||||
fi
|
||||
|
||||
if [ $BOARD_FMUV3 == true ]
|
||||
then
|
||||
# external L3GD20H is rotated 180 degrees yaw
|
||||
if l3gd20 -X -R 4 start
|
||||
then
|
||||
fi
|
||||
|
||||
# external LSM303D is rotated 270 degrees yaw
|
||||
if lsm303d -X -R 6 start
|
||||
then
|
||||
fi
|
||||
|
||||
# internal MPU6000 is rotated 180 deg roll, 270 deg yaw
|
||||
if mpu6000 -R 14 start
|
||||
then
|
||||
fi
|
||||
|
||||
if hmc5883 -C -T -S -R 8 start
|
||||
then
|
||||
fi
|
||||
|
||||
if meas_airspeed start -b 2
|
||||
then
|
||||
fi
|
||||
|
||||
else
|
||||
# FMUv2
|
||||
if mpu6000 start
|
||||
then
|
||||
fi
|
||||
|
||||
if l3gd20 start
|
||||
then
|
||||
fi
|
||||
|
||||
if lsm303d start
|
||||
then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if ver hwcmp PX4FMU_V4
|
||||
then
|
||||
# External I2C bus
|
||||
if hmc5883 -C -T -X start
|
||||
then
|
||||
fi
|
||||
|
||||
if lis3mdl -R 2 start
|
||||
then
|
||||
fi
|
||||
|
||||
# Internal SPI bus is rotated 90 deg yaw
|
||||
if hmc5883 -C -T -S -R 2 start
|
||||
then
|
||||
fi
|
||||
|
||||
# Internal SPI bus ICM-20608-G is rotated 90 deg yaw
|
||||
if mpu6000 -R 2 -T 20608 start
|
||||
then
|
||||
fi
|
||||
|
||||
# Internal SPI bus mpu9250 is rotated 90 deg yaw
|
||||
if mpu9250 -R 2 start
|
||||
then
|
||||
fi
|
||||
fi
|
||||
|
||||
if ver hwcmp PX4FMU_V1
|
||||
then
|
||||
# FMUv1
|
||||
if mpu6000 start
|
||||
then
|
||||
fi
|
||||
|
||||
if l3gd20 start
|
||||
then
|
||||
fi
|
||||
|
||||
# MAG selection
|
||||
if param compare SENS_EXT_MAG 2
|
||||
then
|
||||
if hmc5883 -C -I start
|
||||
then
|
||||
fi
|
||||
else
|
||||
# Use only external as primary
|
||||
if param compare SENS_EXT_MAG 1
|
||||
then
|
||||
if hmc5883 -C -X start
|
||||
then
|
||||
fi
|
||||
else
|
||||
# auto-detect the primary, prefer external
|
||||
if hmc5883 start
|
||||
then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if ver hwcmp MINDPX_V2
|
||||
then
|
||||
if mpu6500 start
|
||||
then
|
||||
fi
|
||||
|
||||
if lsm303d start
|
||||
then
|
||||
fi
|
||||
|
||||
if l3gd20 start
|
||||
then
|
||||
fi
|
||||
|
||||
# External I2C bus
|
||||
if hmc5883 -C -T -X start
|
||||
then
|
||||
fi
|
||||
|
||||
if lis3mdl -R 2 start
|
||||
then
|
||||
fi
|
||||
fi
|
||||
|
||||
if meas_airspeed start
|
||||
then
|
||||
else
|
||||
if ets_airspeed start
|
||||
then
|
||||
else
|
||||
if ets_airspeed start -b 1
|
||||
then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if sf10a start
|
||||
then
|
||||
fi
|
||||
|
||||
# Wait 20 ms for sensors (because we need to wait for the HRT and work queue callbacks to fire)
|
||||
usleep 20000
|
||||
if sensors start
|
||||
then
|
||||
fi
|
||||
@@ -116,11 +116,19 @@ else
|
||||
set unit_test_failure_list "${unit_test_failure_list} mavlink_tests"
|
||||
fi
|
||||
|
||||
if commander_tests
|
||||
# TODO: commander_tests is currently broken
|
||||
#if commander_tests
|
||||
#then
|
||||
#else
|
||||
# set unit_test_failure 1
|
||||
# set unit_test_failure_list "${unit_test_failure_list} commander_tests"
|
||||
#fi
|
||||
|
||||
if controllib_test
|
||||
then
|
||||
else
|
||||
set unit_test_failure 1
|
||||
set unit_test_failure_list "${unit_test_failure_list} commander_tests"
|
||||
set unit_test_failure_list "${unit_test_failure_list} controllib_tests"
|
||||
fi
|
||||
|
||||
if uorb test
|
||||
@@ -130,77 +138,10 @@ else
|
||||
set unit_test_failure_list "${unit_test_failure_list} uorb_tests"
|
||||
fi
|
||||
|
||||
# Start all sensors on all boards
|
||||
ms5611 start
|
||||
adc start
|
||||
|
||||
if mpu6000 -X start
|
||||
then
|
||||
fi
|
||||
|
||||
if mpu6000 start
|
||||
then
|
||||
fi
|
||||
|
||||
if l3gd20 -X start
|
||||
then
|
||||
fi
|
||||
|
||||
if l3gd20 start
|
||||
then
|
||||
fi
|
||||
|
||||
# MAG selection
|
||||
if param compare SENS_EXT_MAG 2
|
||||
then
|
||||
if hmc5883 -I start
|
||||
then
|
||||
fi
|
||||
else
|
||||
# Use only external as primary
|
||||
if param compare SENS_EXT_MAG 1
|
||||
then
|
||||
if hmc5883 -X start
|
||||
then
|
||||
fi
|
||||
else
|
||||
# auto-detect the primary, prefer external
|
||||
if hmc5883 start
|
||||
then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if ver hwcmp PX4FMU_V2
|
||||
then
|
||||
if lsm303d -X start
|
||||
then
|
||||
fi
|
||||
|
||||
if lsm303d start
|
||||
then
|
||||
fi
|
||||
|
||||
if ms5611 -X start
|
||||
then
|
||||
fi
|
||||
fi
|
||||
|
||||
if meas_airspeed start
|
||||
then
|
||||
else
|
||||
if ets_airspeed start
|
||||
then
|
||||
else
|
||||
if ets_airspeed start -b 1
|
||||
then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if sensors start
|
||||
then
|
||||
fi
|
||||
#
|
||||
# Sensors System (start before Commander so Preflight checks are properly run)
|
||||
#
|
||||
sh /etc/init.d/rc.sensors
|
||||
|
||||
# Check for flow sensor
|
||||
if px4flow start
|
||||
|
||||
Reference in New Issue
Block a user