mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-25 00:31:36 +08:00
Fixed startup behavior for PX4 autostart
This commit is contained in:
@@ -75,6 +75,8 @@ px4io min 1200 1200 1200 1200
|
||||
# Upper limits could be higher, this is on the safe side
|
||||
#
|
||||
px4io max 1800 1800 1800 1800
|
||||
|
||||
mixer load /dev/pwm_output /etc/mixers/FMU_quad_x.mix
|
||||
|
||||
#
|
||||
# Start the sensors (depends on orb, px4io)
|
||||
@@ -95,17 +97,13 @@ gps start
|
||||
# Start the attitude estimator (depends on orb)
|
||||
#
|
||||
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
|
||||
|
||||
#
|
||||
# Start logging
|
||||
#
|
||||
sdlog2 start -r 20 -a -b 16
|
||||
sdlog2 start -r 50 -a -b 16
|
||||
|
||||
#
|
||||
# Start system state
|
||||
|
||||
@@ -36,8 +36,5 @@ fi
|
||||
#
|
||||
if sensors start
|
||||
then
|
||||
#
|
||||
# Check sensors - run AFTER 'sensors start'
|
||||
#
|
||||
preflight_check &
|
||||
fi
|
||||
|
||||
@@ -16,12 +16,26 @@ fi
|
||||
sleep 2
|
||||
mavlink start -b 230400 -d /dev/ttyACM0
|
||||
|
||||
# Stop commander
|
||||
if commander stop
|
||||
then
|
||||
echo "Commander stopped"
|
||||
fi
|
||||
sleep 1
|
||||
|
||||
# Start the commander
|
||||
if commander start
|
||||
then
|
||||
echo "Commander started"
|
||||
fi
|
||||
|
||||
# Stop px4io
|
||||
if px4io stop
|
||||
then
|
||||
echo "PX4IO stopped"
|
||||
fi
|
||||
sleep 1
|
||||
|
||||
# Start px4io if present
|
||||
if px4io start
|
||||
then
|
||||
|
||||
@@ -780,7 +780,7 @@ start()
|
||||
int fd;
|
||||
|
||||
if (g_dev != nullptr)
|
||||
errx(1, "already started");
|
||||
errx(0, "already started");
|
||||
|
||||
/* create the driver */
|
||||
g_dev = new L3GD20(1 /* XXX magic number */, GYRO_DEVICE_PATH, (spi_dev_e)PX4_SPIDEV_GYRO);
|
||||
|
||||
@@ -1370,7 +1370,7 @@ start()
|
||||
int fd, fd_mag;
|
||||
|
||||
if (g_dev != nullptr)
|
||||
errx(1, "already started");
|
||||
errx(0, "already started");
|
||||
|
||||
/* create the driver */
|
||||
g_dev = new LSM303D(1 /* XXX magic number */, ACCEL_DEVICE_PATH, (spi_dev_e)PX4_SPIDEV_ACCEL_MAG);
|
||||
|
||||
Reference in New Issue
Block a user