diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-08-28 14:58:29 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-08-28 14:58:29 +0200 |
commit | 49ef30b834888b91e7238662b23d651addf3b4b4 (patch) | |
tree | 455b6d9aae5c3c95ae742fd9312aee58ace06fe5 /ROMFS/px4fmu_common | |
parent | b7ee1d34294b536c6a92c8e72455f24684a5db4f (diff) | |
download | px4-firmware-49ef30b834888b91e7238662b23d651addf3b4b4.tar.gz px4-firmware-49ef30b834888b91e7238662b23d651addf3b4b4.tar.bz2 px4-firmware-49ef30b834888b91e7238662b23d651addf3b4b4.zip |
Reworked how start scripts work, relying on io detect now
Diffstat (limited to 'ROMFS/px4fmu_common')
-rw-r--r-- | ROMFS/px4fmu_common/init.d/01_fmu_quad_x | 2 | ||||
-rw-r--r-- | ROMFS/px4fmu_common/init.d/08_ardrone | 2 | ||||
-rw-r--r-- | ROMFS/px4fmu_common/init.d/09_ardrone_flow | 2 | ||||
-rw-r--r-- | ROMFS/px4fmu_common/init.d/10_io_f330 | 43 | ||||
-rw-r--r-- | ROMFS/px4fmu_common/init.d/15_io_tbs | 2 | ||||
-rw-r--r-- | ROMFS/px4fmu_common/init.d/30_io_camflyer | 2 | ||||
-rw-r--r-- | ROMFS/px4fmu_common/init.d/31_io_phantom | 2 | ||||
-rw-r--r-- | ROMFS/px4fmu_common/init.d/40_io_segway | 2 | ||||
-rw-r--r-- | ROMFS/px4fmu_common/init.d/666_fmu_q_x550 | 2 | ||||
-rw-r--r-- | ROMFS/px4fmu_common/init.d/rc.boarddetect | 66 | ||||
-rw-r--r-- | ROMFS/px4fmu_common/init.d/rc.hil | 10 |
11 files changed, 35 insertions, 100 deletions
diff --git a/ROMFS/px4fmu_common/init.d/01_fmu_quad_x b/ROMFS/px4fmu_common/init.d/01_fmu_quad_x index f57e4bd68..b106a974f 100644 --- a/ROMFS/px4fmu_common/init.d/01_fmu_quad_x +++ b/ROMFS/px4fmu_common/init.d/01_fmu_quad_x @@ -25,7 +25,7 @@ then param set RC_SCALE_YAW 3 param set SYS_AUTOCONFIG 0 - param save /fs/microsd/params + param save fi # diff --git a/ROMFS/px4fmu_common/init.d/08_ardrone b/ROMFS/px4fmu_common/init.d/08_ardrone index eb9f82f77..f6d82a5ec 100644 --- a/ROMFS/px4fmu_common/init.d/08_ardrone +++ b/ROMFS/px4fmu_common/init.d/08_ardrone @@ -11,7 +11,7 @@ then # TODO param set SYS_AUTOCONFIG 0 - param save /fs/microsd/params + param save fi # diff --git a/ROMFS/px4fmu_common/init.d/09_ardrone_flow b/ROMFS/px4fmu_common/init.d/09_ardrone_flow index 44fbb79b7..794342a0b 100644 --- a/ROMFS/px4fmu_common/init.d/09_ardrone_flow +++ b/ROMFS/px4fmu_common/init.d/09_ardrone_flow @@ -11,7 +11,7 @@ then # TODO param set SYS_AUTOCONFIG 0 - param save /fs/microsd/params + param save fi # diff --git a/ROMFS/px4fmu_common/init.d/10_io_f330 b/ROMFS/px4fmu_common/init.d/10_io_f330 index 7b6509bf8..5af4f97b5 100644 --- a/ROMFS/px4fmu_common/init.d/10_io_f330 +++ b/ROMFS/px4fmu_common/init.d/10_io_f330 @@ -1,6 +1,6 @@ #!nsh -echo "[init] 10_io_f330: PX4FMU+PX4IO on a DJI F330 quad frame" +echo "[init] PX4FMU v1, v2 with or without IO on DJI F330" # # Load default params for this platform @@ -24,7 +24,7 @@ then param set MC_YAWRATE_I 0.2 param set MC_YAWRATE_P 0.3 - param save /fs/microsd/params + param save fi # @@ -32,24 +32,30 @@ fi # MAV_TYPE 2 = quadrotor # param set MAV_TYPE 2 - -# -# Start MAVLink (depends on orb) -# -mavlink start -usleep 5000 -# -# Start and configure PX4IO interface -# -sh /etc/init.d/rc.io +set EXIT_ON_END no # -# Set PWM values for DJI ESCs +# Start and configure PX4IO or FMU interface # -px4io idle 900 900 900 900 -px4io min 1200 1200 1200 1200 -px4io max 1800 1800 1800 1800 +if px4io detect +then + # Start MAVLink (depends on orb) + mavlink start + usleep 5000 + + sh /etc/init.d/rc.io + # Set PWM values for DJI ESCs + px4io idle 900 900 900 900 + px4io min 1200 1200 1200 1200 + px4io max 1800 1800 1800 1800 +else + # Start MAVLink (on UART1 / ttyS0) + mavlink start -d /dev/ttyS0 + usleep 5000 + fmu mode_pwm + set EXIT_ON_END yes +fi # # Load mixer @@ -65,3 +71,8 @@ pwm -u 400 -m 0xff # Start common for all multirotors apps # sh /etc/init.d/rc.multirotor + +if [ $EXIT_ON_END == yes ] +then + exit +fi diff --git a/ROMFS/px4fmu_common/init.d/15_io_tbs b/ROMFS/px4fmu_common/init.d/15_io_tbs index b4f063e52..3fce39403 100644 --- a/ROMFS/px4fmu_common/init.d/15_io_tbs +++ b/ROMFS/px4fmu_common/init.d/15_io_tbs @@ -24,7 +24,7 @@ then param set MC_YAWRATE_I 0.0 param set MC_YAWRATE_P 0.2 - param save /fs/microsd/params + param save fi # diff --git a/ROMFS/px4fmu_common/init.d/30_io_camflyer b/ROMFS/px4fmu_common/init.d/30_io_camflyer index 6a0bd4da8..390649f89 100644 --- a/ROMFS/px4fmu_common/init.d/30_io_camflyer +++ b/ROMFS/px4fmu_common/init.d/30_io_camflyer @@ -11,7 +11,7 @@ then # TODO param set SYS_AUTOCONFIG 0 - param save /fs/microsd/params + param save fi # diff --git a/ROMFS/px4fmu_common/init.d/31_io_phantom b/ROMFS/px4fmu_common/init.d/31_io_phantom index 718313862..45563310c 100644 --- a/ROMFS/px4fmu_common/init.d/31_io_phantom +++ b/ROMFS/px4fmu_common/init.d/31_io_phantom @@ -11,7 +11,7 @@ then # TODO param set SYS_AUTOCONFIG 0 - param save /fs/microsd/params + param save fi # diff --git a/ROMFS/px4fmu_common/init.d/40_io_segway b/ROMFS/px4fmu_common/init.d/40_io_segway index 2890f43be..4b7ed5286 100644 --- a/ROMFS/px4fmu_common/init.d/40_io_segway +++ b/ROMFS/px4fmu_common/init.d/40_io_segway @@ -9,7 +9,7 @@ then # TODO param set SYS_AUTOCONFIG 0 - param save /fs/microsd/params + param save fi # diff --git a/ROMFS/px4fmu_common/init.d/666_fmu_q_x550 b/ROMFS/px4fmu_common/init.d/666_fmu_q_x550 index 2c8218013..938663f0c 100644 --- a/ROMFS/px4fmu_common/init.d/666_fmu_q_x550 +++ b/ROMFS/px4fmu_common/init.d/666_fmu_q_x550 @@ -25,7 +25,7 @@ then param set RC_SCALE_YAW 3 param set SYS_AUTOCONFIG 0 - param save /fs/microsd/params + param save fi # diff --git a/ROMFS/px4fmu_common/init.d/rc.boarddetect b/ROMFS/px4fmu_common/init.d/rc.boarddetect deleted file mode 100644 index f233e51df..000000000 --- a/ROMFS/px4fmu_common/init.d/rc.boarddetect +++ /dev/null @@ -1,66 +0,0 @@ -#!nsh -# -# If we are still in flight mode, work out what airframe -# configuration we have and start up accordingly. -# -if [ $MODE != autostart ] -then - echo "[init] automatic startup cancelled by user script" -else - echo "[init] detecting attached hardware..." - - # - # Assume that we are PX4FMU in standalone mode - # - set BOARD PX4FMU - - # - # Are we attached to a PX4IOAR (AR.Drone carrier board)? - # - if boardinfo test name PX4IOAR - then - set BOARD PX4IOAR - if [ -f /etc/init.d/rc.PX4IOAR ] - then - echo "[init] reading /etc/init.d/rc.PX4IOAR" - usleep 500 - sh /etc/init.d/rc.PX4IOAR - fi - else - echo "[init] PX4IOAR not detected" - fi - - # - # Are we attached to a PX4IO? - # - if boardinfo test name PX4IO - then - set BOARD PX4IO - if [ -f /etc/init.d/rc.PX4IO ] - then - echo "[init] reading /etc/init.d/rc.PX4IO" - usleep 500 - sh /etc/init.d/rc.PX4IO - fi - else - echo "[init] PX4IO not detected" - fi - - # - # Looks like we are stand-alone - # - if [ $BOARD == PX4FMU ] - then - echo "[init] no expansion board detected" - if [ -f /etc/init.d/rc.standalone ] - then - echo "[init] reading /etc/init.d/rc.standalone" - sh /etc/init.d/rc.standalone - fi - fi - - # - # We may not reach here if the airframe-specific script exits the shell. - # - echo "[init] startup done." -fi
\ No newline at end of file diff --git a/ROMFS/px4fmu_common/init.d/rc.hil b/ROMFS/px4fmu_common/init.d/rc.hil index a843b7ffb..eccb2b767 100644 --- a/ROMFS/px4fmu_common/init.d/rc.hil +++ b/ROMFS/px4fmu_common/init.d/rc.hil @@ -14,16 +14,6 @@ mavlink start -b 230400 -d /dev/ttyS1 hil mode_pwm # -# Load microSD params -# -echo "[init] loading microSD params" -param select /fs/microsd/params -if [ -f /fs/microsd/params ] -then - param load /fs/microsd/params -fi - -# # Force some key parameters to sane values # MAV_TYPE 1 = fixed wing, 2 = quadrotor, 13 = hexarotor # see https://pixhawk.ethz.ch/mavlink/ |