Skip to content
Snippets Groups Projects
Commit 039c603a authored by Andrew Tridgell's avatar Andrew Tridgell
Browse files

autotest: allow testing of elevon planes

this fakes up an elevon plane using the Rascal110
parent 739e3c2b
No related branches found
No related tags found
No related merge requests found
...@@ -66,7 +66,15 @@ def process_sitl_input(buf): ...@@ -66,7 +66,15 @@ def process_sitl_input(buf):
elevator = (pwm[1]-1500)/500.0 elevator = (pwm[1]-1500)/500.0
throttle = (pwm[2]-1000)/1000.0 throttle = (pwm[2]-1000)/1000.0
rudder = (pwm[3]-1500)/500.0 rudder = (pwm[3]-1500)/500.0
if opts.elevon:
# fake an elevon plane
ch1 = aileron
ch2 = elevator
aileron = (ch2-ch1)/2.0
# the minus does away with the need for RC2_REV=-1
elevator = -(ch2+ch1)/2.0
if aileron != sitl_state.aileron: if aileron != sitl_state.aileron:
jsb_set('fcs/aileron-cmd-norm', aileron) jsb_set('fcs/aileron-cmd-norm', aileron)
sitl_state.aileron = aileron sitl_state.aileron = aileron
...@@ -138,6 +146,7 @@ parser.add_option("--fgout", help="FG display output (IP:port)", default="12 ...@@ -138,6 +146,7 @@ parser.add_option("--fgout", help="FG display output (IP:port)", default="12
parser.add_option("--home", type='string', help="home lat,lng,alt,hdg (required)") parser.add_option("--home", type='string', help="home lat,lng,alt,hdg (required)")
parser.add_option("--script", type='string', help='jsbsim model script', default='jsbsim/rascal_test.xml') parser.add_option("--script", type='string', help='jsbsim model script', default='jsbsim/rascal_test.xml')
parser.add_option("--options", type='string', help='jsbsim startup options') parser.add_option("--options", type='string', help='jsbsim startup options')
parser.add_option("--elevon", action='store_true', default=False, help='assume elevon input')
parser.add_option("--wind", dest="wind", help="Simulate wind (speed,direction,turbulance)", default='0,0,0') parser.add_option("--wind", dest="wind", help="Simulate wind (speed,direction,turbulance)", default='0,0,0')
(opts, args) = parser.parse_args() (opts, args) = parser.parse_args()
......
#!/bin/bash
killall -q JSBSim
killall -q ArduPlane.elf
pkill -f runsim.py
set -e
set -x
autotest=$(dirname $(readlink -e $0))
pushd $autotest/../../ArduPlane
make clean sitl
tfile=$(mktemp)
echo r > $tfile
#gnome-terminal -e "gdb -x $tfile --args /tmp/ArduPlane.build/ArduPlane.elf"
gnome-terminal -e /tmp/ArduPlane.build/ArduPlane.elf
#gnome-terminal -e "valgrind -q /tmp/ArduPlane.build/ArduPlane.elf"
sleep 2
rm -f $tfile
gnome-terminal -e '../Tools/autotest/jsbsim/runsim.py --home=-35.362938,149.165085,584,270 --elevon'
sleep 2
popd
# if you wanted to forward packets out a serial link for testing
# andropilot, then add --out /dev/serial/by-id/usb-FTDI* to your
# command line along with a baudrate. You might also like to add --map
# and --console
# for example:
# sim_arduplane.sh --out /dev/serial/by-id/usb-FTDI* --baudrate 57600 --map --console
mavproxy.py --master tcp:127.0.0.1:5760 --sitl 127.0.0.1:5501 --out 127.0.0.1:14550 --out 127.0.0.1:14551 $*
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment