mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-05 06:03:02 +08:00
rcS: startup for a passthrough Snapdragon option
This adds a custom passthrough "vehicle" to be used on Pixhawk/Pixfalcon/Pixracer together with Snapdragon for RC input and PWM output.
This commit is contained in:
@@ -0,0 +1,12 @@
|
|||||||
|
#!nsh
|
||||||
|
#
|
||||||
|
# @name Passthrough mode for Snapdragon
|
||||||
|
#
|
||||||
|
# @type custom
|
||||||
|
#
|
||||||
|
# @maintainer Julian Oes <julian@oes.ch>
|
||||||
|
#
|
||||||
|
# This startup can be used on Pixhawk/Pixfalcon/Pixracer for the
|
||||||
|
# passthrough of RC input and PWM output.
|
||||||
|
|
||||||
|
set PASSTHROUGH yes
|
||||||
@@ -133,6 +133,7 @@ then
|
|||||||
set GPS yes
|
set GPS yes
|
||||||
set GPS_FAKE no
|
set GPS_FAKE no
|
||||||
set FAILSAFE none
|
set FAILSAFE none
|
||||||
|
set PASSTHROUGH no
|
||||||
|
|
||||||
#
|
#
|
||||||
# Set AUTOCNF flag to use it in AUTOSTART scripts
|
# Set AUTOCNF flag to use it in AUTOSTART scripts
|
||||||
@@ -806,19 +807,41 @@ then
|
|||||||
# Try to get an USB console
|
# Try to get an USB console
|
||||||
nshterm /dev/ttyACM0 &
|
nshterm /dev/ttyACM0 &
|
||||||
else
|
else
|
||||||
|
# Don't start mavlink in passthrough mode because we currently can't seem to stop it.
|
||||||
|
if [ $PASSTHROUGH == no ]
|
||||||
|
then
|
||||||
mavlink start -r 800000 -d /dev/ttyACM0 -m config -x
|
mavlink start -r 800000 -d /dev/ttyACM0 -m config -x
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# XXX Do not run any mavlink instances since we need the serial port for communication with snapdragon
|
|
||||||
|
# For snapdragon, we need a passthrough mode
|
||||||
|
# Do not run any mavlink instances since we need the serial port for
|
||||||
|
# communication with Snapdragon.
|
||||||
|
if [ $PASSTHROUGH == yes ]
|
||||||
|
then
|
||||||
mavlink stop-all
|
mavlink stop-all
|
||||||
|
|
||||||
# XXX Stop multicopter attitude controller, the controls come from snapdragon
|
# Stop multicopter attitude controller if it is running, the controls come
|
||||||
|
# from Snapdragon.
|
||||||
if mc_att_control stop
|
if mc_att_control stop
|
||||||
then
|
then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# XXX Start snapdragon interface on serial port. On pixfalcon this is the standard telemetry port.
|
# Start snapdragon interface on serial port.
|
||||||
|
if ver hwcmp PX4FMU_V2
|
||||||
|
then
|
||||||
|
# On Pixfalcon use the standard telemetry port (Telem 1).
|
||||||
snapdragon_rc_pwm start -d /dev/ttyS1
|
snapdragon_rc_pwm start -d /dev/ttyS1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ver hwcmp PX4FMU_V4
|
||||||
|
then
|
||||||
|
# On Pixracer use Telem 2 port (TL2).
|
||||||
|
snapdragon_rc_pwm start -d /dev/ttyS2
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ $EXIT_ON_END == yes ]
|
if [ $EXIT_ON_END == yes ]
|
||||||
then
|
then
|
||||||
|
|||||||
Reference in New Issue
Block a user