Fixed startup behavior for PX4 autostart

This commit is contained in:
Lorenz Meier
2013-08-11 16:54:00 +02:00
parent 79acbfb615
commit cbb5ce8f59
5 changed files with 20 additions and 11 deletions
+4 -6
View File
@@ -75,6 +75,8 @@ px4io min 1200 1200 1200 1200
# Upper limits could be higher, this is on the safe side # Upper limits could be higher, this is on the safe side
# #
px4io max 1800 1800 1800 1800 px4io max 1800 1800 1800 1800
mixer load /dev/pwm_output /etc/mixers/FMU_quad_x.mix
# #
# Start the sensors (depends on orb, px4io) # Start the sensors (depends on orb, px4io)
@@ -95,17 +97,13 @@ gps start
# Start the attitude estimator (depends on orb) # Start the attitude estimator (depends on orb)
# #
attitude_estimator_ekf start attitude_estimator_ekf start
#
# Load mixer and start controllers (depends on px4io)
#
mixer load /dev/pwm_output /etc/mixers/FMU_quad_x.mix
multirotor_att_control start multirotor_att_control start
# #
# Start logging # Start logging
# #
sdlog2 start -r 20 -a -b 16 sdlog2 start -r 50 -a -b 16
# #
# Start system state # Start system state
-3
View File
@@ -36,8 +36,5 @@ fi
# #
if sensors start if sensors start
then then
#
# Check sensors - run AFTER 'sensors start'
#
preflight_check & preflight_check &
fi fi
+14
View File
@@ -16,12 +16,26 @@ fi
sleep 2 sleep 2
mavlink start -b 230400 -d /dev/ttyACM0 mavlink start -b 230400 -d /dev/ttyACM0
# Stop commander
if commander stop
then
echo "Commander stopped"
fi
sleep 1
# Start the commander # Start the commander
if commander start if commander start
then then
echo "Commander started" echo "Commander started"
fi fi
# Stop px4io
if px4io stop
then
echo "PX4IO stopped"
fi
sleep 1
# Start px4io if present # Start px4io if present
if px4io start if px4io start
then then
+1 -1
View File
@@ -780,7 +780,7 @@ start()
int fd; int fd;
if (g_dev != nullptr) if (g_dev != nullptr)
errx(1, "already started"); errx(0, "already started");
/* create the driver */ /* create the driver */
g_dev = new L3GD20(1 /* XXX magic number */, GYRO_DEVICE_PATH, (spi_dev_e)PX4_SPIDEV_GYRO); g_dev = new L3GD20(1 /* XXX magic number */, GYRO_DEVICE_PATH, (spi_dev_e)PX4_SPIDEV_GYRO);
+1 -1
View File
@@ -1370,7 +1370,7 @@ start()
int fd, fd_mag; int fd, fd_mag;
if (g_dev != nullptr) if (g_dev != nullptr)
errx(1, "already started"); errx(0, "already started");
/* create the driver */ /* create the driver */
g_dev = new LSM303D(1 /* XXX magic number */, ACCEL_DEVICE_PATH, (spi_dev_e)PX4_SPIDEV_ACCEL_MAG); g_dev = new LSM303D(1 /* XXX magic number */, ACCEL_DEVICE_PATH, (spi_dev_e)PX4_SPIDEV_ACCEL_MAG);