Add target jsbsim to compile both simulator independantly

This commit is contained in:
Gautier Hattenberger
2010-03-25 09:27:26 +00:00
parent 82877a65f7
commit 906e17845d
8 changed files with 226 additions and 415 deletions
+3
View File
@@ -159,6 +159,9 @@ BOOTLOADER_DEVICE=/dev/ttyUSB0
tiny_bl.upload: tiny_bl.upload:
lpc21isp -control $(AIRBORNE)/arm7/test/bootloader/bl.hex $(BOOTLOADER_DEVICE) 38400 12000 lpc21isp -control $(AIRBORNE)/arm7/test/bootloader/bl.hex $(BOOTLOADER_DEVICE) 38400 12000
jsbsim jsbsim.compile: ac_h
cd $(AIRBORNE); $(MAKE) TARGET=jsbsim ARCHI=jsbsim all
sim: ac_h sim: ac_h
cd $(AIRBORNE); $(MAKE) TARGET=sim ARCHI=sim all cd $(AIRBORNE); $(MAKE) TARGET=sim ARCHI=sim all
+100
View File
@@ -0,0 +1,100 @@
# Hey Emacs, this is a -*- makefile -*-
#
# $Id: Makefile.sim 3505 2009-06-17 12:59:32Z hecto $
# Copyright (C) 2006 Pascal Brisset, Antoine Drouin
#
# This file is part of paparazzi.
#
# paparazzi is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# paparazzi is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with paparazzi; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
#
# This is the Makefile for the JSBSim target.
# Compilator: g++
#
SRC_ARCH = sim
CC = g++
SIMDIR = $(PAPARAZZI_SRC)/sw/simulator
# Launch with "make Q=''" to get full command display
Q=@
#
# Compilation flags
#
CFLAGS = -W -Wall $(INCLUDES) -I$(PAPARAZZI_SRC)/sw/airborne/$(SRC_ARCH) $($(TARGET).CFLAGS) $(LOCAL_CFLAGS) -O2
LDFLAGS = -lm $($(TARGET).LDFLAGS)
#
# General rules
#
$(TARGET).srcsnd = $(notdir $($(TARGET).srcs))
$(TARGET).objso = $($(TARGET).srcs:%.c=$(OBJDIR)/%.o)
$(TARGET).objs = $($(TARGET).objso:%.S=$(OBJDIR)/%.o)
all compile: $(OBJDIR)/simsitl
$(OBJDIR)/simsitl : $($(TARGET).objs)
@echo LD $@
$(Q)$(CC) $(CFLAGS) -o $@ $($(TARGET).objs) $(LDFLAGS)
%.s: %.c
$(CC) $(CFLAGS) -S -o $@ $<
%.s: %.cpp
$(CC) $(CFLAGS) -S -o $@ $<
$(OBJDIR)/%.s: %.c
@echo CC $@
$(Q)test -d $(dir $@) || mkdir -p $(dir $@)
$(CC) $(CFLAGS) -S -o $@ $<
$(OBJDIR)/%.s: %.cpp
@echo CC $@
$(Q)test -d $(dir $@) || mkdir -p $(dir $@)
$(CC) $(CFLAGS) -S -o $@ $<
$(OBJDIR)/%.o: %.c $(OBJDIR)/../Makefile.ac
@echo CC $@
$(Q)test -d $(dir $@) || mkdir -p $(dir $@)
$(Q)$(CC) $(CFLAGS) -c -o $@ $<
$(OBJDIR)/%.o: %.cpp $(OBJDIR)/../Makefile.ac
@echo CC++ $@
$(Q)test -d $(dir $@) || mkdir -p $(dir $@)
$(Q)$(CC) $(CFLAGS) -c -o $@ $<
#
# Dependencies
#
$(OBJDIR)/.depend:
@test -d $(OBJDIR) || mkdir -p $(OBJDIR)
@echo DEPEND $@
$(Q)$(CC) -MM -MG $(CFLAGS) $($(TARGET).srcs) | sed 's|\([^\.]*\.o\)|$(OBJDIR)/\1|' > $@
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),erase)
-include $(OBJDIR)/.depend
endif
endif
+23 -7
View File
@@ -193,13 +193,19 @@
</section> </section>
<section name="FAILSAFE" prefix="FAILSAFE_"> <section name="FAILSAFE" prefix="FAILSAFE_">
<define name="DELAY_WITHOUT_GPS" value="1" unit="s"/> <define name="DELAY_WITHOUT_GPS" value="1" unit="s"/>
<define name="DEFAULT_THROTTLE" value="0.3" unit="%"/> <define name="DEFAULT_THROTTLE" value="0.3" unit="%"/>
<define name="DEFAULT_ROLL" value="0.3" unit="rad"/> <define name="DEFAULT_ROLL" value="0.3" unit="rad"/>
<define name="DEFAULT_PITCH" value="0.5" unit="rad"/> <define name="DEFAULT_PITCH" value="0.5" unit="rad"/>
<define name="HOME_RADIUS" value="100" unit="m"/> <define name="HOME_RADIUS" value="100" unit="m"/>
</section> </section>
<section name="SIMU">
<define name="JSBSIM_MODEL" value="&quot;Corsica&quot;"/>
<define name="JSBSIM_IR_ROLL_NEUTRAL" value="RadOfDeg(0.)"/>
<define name="JSBSIM_IR_PITCH_NEUTRAL" value="RadOfDeg(0.)"/>
</section>
<makefile> <makefile>
CONFIG = \"tiny_2_1_1.h\" CONFIG = \"tiny_2_1_1.h\"
@@ -258,6 +264,16 @@ sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
sim.srcs += nav_line.c nav_survey_rectangle.c sim.srcs += nav_line.c nav_survey_rectangle.c
# Config for JSBSim simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl_jsbsim.makefile
jsbsim.CFLAGS += -I/home/cocoleon/usr/include/JSBSim
jsbsim.LDFLAGS += -L/home/cocoleon/usr/lib/
jsbsim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
jsbsim.srcs += nav_line.c nav_survey_rectangle.c
jsbsim.srcs += $(SIMDIR)/sim_ac_fw.c
# a test program to setup actuators # a test program to setup actuators
setup_actuators.ARCHDIR = $(ARCHI) setup_actuators.ARCHDIR = $(ARCHI)
+13 -12
View File
@@ -1,15 +1,16 @@
SIM_TYPE = JSBSIM jsbsim.ARCHDIR = $(ARCHI)
sim.ARCHDIR = $(ARCHI) jsbsim.ARCH = sitl
sim.ARCH = sitl jsbsim.TARGET = autopilot
sim.TARGET = autopilot jsbsim.TARGETDIR = autopilot
sim.TARGETDIR = autopilot
# external libraries # external libraries
sim.CFLAGS = -I$(SIMDIR) -I/usr/include `pkg-config glib-2.0 --cflags` jsbsim.CFLAGS = -I$(SIMDIR) -I/usr/include `pkg-config glib-2.0 --cflags`
sim.LDFLAGS += `pkg-config glib-2.0 --libs` -lm -lpcre -lglibivy -L/usr/lib -lJSBSim jsbsim.LDFLAGS += `pkg-config glib-2.0 --libs` -lm -lpcre -lglibivy -L/usr/lib -lJSBSim
sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DINFRARED -DNAV -DLED -DWIND_INFO jsbsim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DINFRARED -DNAV -DLED -DWIND_INFO
sim.srcs = $(SRC_ARCH)/jsbsim_hw.c $(SRC_ARCH)/jsbsim_gps.c $(SRC_ARCH)/jsbsim_ir.c $(SRC_ARCH)/jsbsim_transport.c $(SRC_ARCH)/ivy_transport.c jsbsim.srcs = $(SRC_ARCH)/jsbsim_hw.c $(SRC_ARCH)/jsbsim_gps.c $(SRC_ARCH)/jsbsim_ir.c $(SRC_ARCH)/jsbsim_transport.c $(SRC_ARCH)/ivy_transport.c
sim.srcs += latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl.c fw_v_ctl.c nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c jsbsim.srcs += latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl.c fw_v_ctl.c nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c
sim.srcs += $(SIMDIR)/sim_ac_jsbsim.c jsbsim.srcs += $(SIMDIR)/sim_ac_jsbsim.c
#$(SIMDIR)/sim_ac_fw.c # Choose in your airframe file type of airframe
# jsbsim.srcs += $(SIMDIR)/sim_ac_fw.c
# jsbsim.srcs += $(SIMDIR)/sim_ac_booz.c
+70 -2
View File
@@ -52,8 +52,68 @@
</mass_balance> </mass_balance>
<ground_reactions>
<!--Ground reactions deleted --> <contact type="BOGEY" name="LEFT_MLG">
<location unit="M">
<x> 0.07 </x>
<y> -0.6 </y>
<z> -0.01 </z>
</location>
<static_friction> 0.8 </static_friction>
<dynamic_friction> 0.5 </dynamic_friction>
<rolling_friction> 0.02 </rolling_friction>
<spring_coeff unit="LBS/FT"> 30 </spring_coeff>
<damping_coeff unit="LBS/FT/SEC"> 5 </damping_coeff>
<max_steer unit="DEG"> 0.0 </max_steer>
<brake_group> LEFT </brake_group>
<retractable>0</retractable>
</contact>
<contact type="BOGEY" name="RIGHT_MLG">
<location unit="M">
<x> 0.07 </x>
<y> 0.6 </y>
<z> -0.01 </z>
</location>
<static_friction> 0.8 </static_friction>
<dynamic_friction> 0.5 </dynamic_friction>
<rolling_friction> 0.02 </rolling_friction>
<spring_coeff unit="LBS/FT"> 30 </spring_coeff>
<damping_coeff unit="LBS/FT/SEC"> 5 </damping_coeff>
<max_steer unit="DEG"> 0.0 </max_steer>
<brake_group> RIGHT </brake_group>
<retractable>0</retractable>
</contact>
<contact type="BOGEY" name="TAIL_LG">
<location unit="M">
<x> 0.6 </x>
<y> 0.0 </y>
<z> -0.01 </z>
</location>
<static_friction> 0.8 </static_friction>
<dynamic_friction> 0.5 </dynamic_friction>
<rolling_friction> 0.02 </rolling_friction>
<spring_coeff unit="LBS/FT"> 6 </spring_coeff>
<damping_coeff unit="LBS/FT/SEC"> 5 </damping_coeff>
<max_steer unit="DEG"> 360.0 </max_steer>
<brake_group> NONE </brake_group>
<retractable>0</retractable>
</contact>
<contact type="BOGEY" name="NOSE_LG">
<location unit="M">
<x> 0.01 </x>
<y> 0.0 </y>
<z> -0.01 </z>
</location>
<static_friction> 0.8 </static_friction>
<dynamic_friction> 0.5 </dynamic_friction>
<rolling_friction> 0.02 </rolling_friction>
<spring_coeff unit="LBS/FT"> 6 </spring_coeff>
<damping_coeff unit="LBS/FT/SEC"> 5 </damping_coeff>
<max_steer unit="DEG"> 360.0 </max_steer>
<brake_group> NONE </brake_group>
<retractable>0</retractable>
</contact>
</ground_reactions>
<propulsion> <propulsion>
<engine file="Axi"> <engine file="Axi">
@@ -82,6 +142,14 @@
<p_factor>1.0</p_factor> <p_factor>1.0</p_factor>
</thruster> </thruster>
</engine> </engine>
<tank type="OXIDIZER"> <!-- Tank number 0 -->
<location unit="M">
<x> 0.7 </x>
<y> 0.0 </y>
<z> 0.0 </z>
</location>
<capacity unit="LBS"> 0.001 </capacity>
</tank>
</propulsion> </propulsion>
<flight_control name="Corsica"> <flight_control name="Corsica">
-388
View File
@@ -1,388 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet href="http://jsbsim.sourceforge.net/JSBSim.xsl" type="text/xsl"?>
<fdm_config name="rascal" version="2.0" release="BETA"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd">
<fileheader>
<author> Murat Bronz </author>
<filecreationdate> 18/03/2010 </filecreationdate>
<version> Version </version>
<description> Corsica10 Prototype </description>
</fileheader>
<metrics>
<wingarea unit="M2"> 0.21 </wingarea>
<wingspan unit="M"> 1.5 </wingspan>
<chord unit="M"> 0.14 </chord>
<htailarea unit="M2"> 0.026 </htailarea>
<htailarm unit="M"> 0.6 </htailarm>
<vtailarea unit="M2"> 0.011 </vtailarea>
<vtailarm unit="M"> 0.6 </vtailarm>
<location name="AERORP" unit="IN">
<x> 0 </x>
<y> 0 </y>
<z> 0 </z>
</location>
<location name="EYEPOINT" unit="IN">
<x> 0 </x>
<y> 0 </y>
<z> 0 </z>
</location>
<location name="VRP" unit="IN">
<x> 0 </x>
<y> 0 </y>
<z> 0 </z>
</location>
</metrics>
<mass_balance>
<ixx unit="KG*M2"> 0.125 </ixx>
<iyy unit="KG*M2"> 0.032 </iyy>
<izz unit="KG*M2"> 0.156 </izz>
<ixy unit="KG*M2"> 0 </ixy>
<ixz unit="KG*M2"> -0.003 </ixz>
<iyz unit="KG*M2"> 0 </iyz>
<emptywt unit="KG"> 2.0 </emptywt>
<location name="CG" unit="M">
<x> 0.067 </x>
<y> 0 </y>
<z> 0 </z>
</location>
</mass_balance>
<!--Ground reactions deleted -->
<propulsion>
<engine file="Axi">
<location unit="M">
<x> -0.02 </x>
<y> 0 </y>
<z> 0 </z>
</location>
<orient unit="DEG">
<roll> 0.0 </roll>
<pitch> 0 </pitch>
<yaw> 0 </yaw>
</orient>
<feed>0</feed>
<thruster file="18x8">
<location unit="M">
<x> -0.02 </x>
<y> 0 </y>
<z> 0 </z>
</location>
<orient unit="DEG">
<roll> 0.0 </roll>
<pitch> 0.0 </pitch>
<yaw> 0.0 </yaw>
</orient>
<p_factor>1.0</p_factor>
</thruster>
</engine>
</propulsion>
<flight_control name="Corsica">
<channel name="All">
<summer name="Pitch Trim Sum">
<input>fcs/elevator-cmd-norm</input>
<input>fcs/pitch-trim-cmd-norm</input>
<clipto>
<min>-1</min>
<max>1</max>
</clipto>
</summer>
<aerosurface_scale name="Elevator Control">
<input>fcs/pitch-trim-sum</input>
<range>
<min>-0.5</min>
<max>0.5</max>
</range>
<output>fcs/elevator-pos-rad</output>
</aerosurface_scale>
<aerosurface_scale name="Elevator Normalized">
<input>fcs/elevator-pos-rad</input>
<domain>
<min>-0.5</min>
<max> 0.5</max>
</domain>
<range>
<min>-1</min>
<max> 1</max>
</range>
<output>fcs/elevator-pos-norm</output>
</aerosurface_scale>
<summer name="Roll Trim Sum">
<input>fcs/aileron-cmd-norm</input>
<input>fcs/roll-trim-cmd-norm</input>
<clipto>
<min>-1</min>
<max>1</max>
</clipto>
</summer>
<aerosurface_scale name="Left Aileron Control">
<input>fcs/roll-trim-sum</input>
<range>
<min>-0.5</min>
<max>0.5</max>
</range>
<output>fcs/left-aileron-pos-rad</output>
</aerosurface_scale>
<aerosurface_scale name="Right Aileron Control">
<input>-fcs/roll-trim-sum</input>
<range>
<min>-0.5</min>
<max>0.5</max>
</range>
<output>fcs/right-aileron-pos-rad</output>
</aerosurface_scale>
<aerosurface_scale name="Left aileron Normalized">
<input>fcs/left-aileron-pos-rad</input>
<domain>
<min>-0.5</min>
<max> 0.5</max>
</domain>
<range>
<min>-1</min>
<max> 1</max>
</range>
<output>fcs/left-aileron-pos-norm</output>
</aerosurface_scale>
<aerosurface_scale name="Right aileron Normalized">
<input>fcs/right-aileron-pos-rad</input>
<domain>
<min>-0.5</min>
<max> 0.5</max>
</domain>
<range>
<min>-1</min>
<max> 1</max>
</range>
<output>fcs/right-aileron-pos-norm</output>
</aerosurface_scale>
</channel>
</flight_control>
<aerodynamics>
<axis name="DRAG">
<function name="aero/coefficient/CD0">
<description>Drag_at_zero_lift</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<table>
<independentVar>aero/alpha-deg</independentVar>
<tableData>
-10.0 0.02748
-8.0 0.02243
-6.0 0.02335
-4.0 0.02770
-2.0 0.03369
0.0 0.04284
2.0 0.05454
4.0 0.06868
6.0 0.08515
8.0 0.1055
10.0 0.1595
</tableData>
</table>
</product>
</function>
<!--function name="aero/coefficient/CDbeta">
<description>Drag_due_to_sideslip</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<table>
<independentVar>aero/beta-deg</independentVar>
<tableData>
-10.0 -0.00284
0.0 0.0
10.0 -0.00284
</tableData>
</table>
</product>
</function-->
<function name="aero/coefficient/CDde">
<description>Drag_due_to_Elevator_Deflection</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>fcs/elevator-pos-deg</property>
<value>0.000094</value>
</product>
</function>
</axis>
<axis name="SIDE">
<function name="aero/coefficient/CYb">
<description>Side_force_due_to_beta</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>aero/beta-rad</property>
<value>-0.141391</value>
</product>
</function>
</axis>
<axis name="LIFT">
<function name="aero/coefficient/CLalpha">
<description>Lift_due_to_alpha</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>aero/alpha-rad</property>
<value>5.1460</value>
</product>
</function>
<function name="aero/coefficient/CLde">
<description>Lift_due_to_Elevator_Deflection</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>fcs/elevator-pos-deg</property>
<value>0.003644</value>
</product>
</function>
</axis>
<axis name="ROLL">
<function name="aero/coefficient/Clb">
<description>Roll_moment_due_to_beta</description>
<!-- aka dihedral effect -->
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/bw-ft</property>
<property>aero/beta-rad</property>
<value>-0.04235</value>
</product>
</function>
<function name="aero/coefficient/Clp">
<description>Roll_moment_due_to_roll_rate</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/bw-ft</property>
<property>aero/bi2vel</property>
<property>velocities/p-aero-rad_sec</property>
<value>-0.561207</value>
</product>
</function>
<function name="aero/coefficient/Clr">
<description>Roll_moment_due_to_yaw_rate</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/bw-ft</property>
<property>aero/bi2vel</property>
<property>velocities/r-aero-rad_sec</property>
<value>0.17269</value>
</product>
</function>
<function name="aero/coefficient/Clda">
<description>Roll_moment_due_to_aileron</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/bw-ft</property>
<property>fcs/right-aileron-pos-deg</property>
<value>-0.004076</value>
</product>
</function>
</axis>
<axis name="PITCH">
<function name="aero/coefficient/Cmalpha">
<description>Pitch_moment_due_to_alpha</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/cbarw-ft</property>
<property>aero/alpha-rad</property>
<value>-0.523384</value>
</product>
</function>
<function name="aero/coefficient/Cmde">
<description>Pitch_moment_due_to_elevator</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/cbarw-ft</property>
<property>fcs/elevator-pos-deg</property>
<value>-0.014833</value>
</product>
</function>
<function name="aero/coefficient/Cmq">
<description>Pitch_moment_due_to_pitch_rate</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/cbarw-ft</property>
<property>aero/ci2vel</property>
<property>velocities/q-aero-rad_sec</property>
<value>-15.281710</value>
</product>
</function>
<function name="aero/coefficient/Cmadot">
<description>Pitch_moment_due_to_alpha_rate</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/cbarw-ft</property>
<property>aero/ci2vel</property>
<property>aero/alphadot-rad_sec</property>
<value>-7.0000</value>
</product>
</function>
</axis>
<axis name="YAW">
<function name="aero/coefficient/Cnb">
<description>Yaw_moment_due_to_beta</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/bw-ft</property>
<property>aero/beta-rad</property>
<value>0.039729</value>
</product>
</function>
<function name="aero/coefficient/Cnr">
<description>Yaw_moment_due_to_yaw_rate</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/bw-ft</property>
<property>aero/bi2vel</property>
<property>velocities/r-aero-rad_sec</property>
<value>-0.048425</value>
</product>
</function>
<function name="aero/coefficient/Cnda">
<description>Adverse_yaw</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/bw-ft</property>
<property>fcs/right-aileron-pos-deg</property>
<value>0.00026</value>
</product>
</function>
</axis>
</aerodynamics>
</fdm_config>
+13 -5
View File
@@ -12,14 +12,22 @@ let () =
try try
let rec loop = fun i -> let rec loop = fun i ->
if Sys.argv.(i) = "-a" && (i+1) < n then if Sys.argv.(i) = "-a" && (i+1) < n then
let ac = Sys.argv.(i+1) in let ac = Sys.argv.(i+1) in
(* Shift other args *) (* Shift other args *)
for j = i+2 to n-1 do Sys.argv.(j-2) <- Sys.argv.(j) done; for j = i+2 to n-1 do Sys.argv.(j-2) <- Sys.argv.(j) done;
ac ac
else if i = n then raise Not_found else if i = n then raise Not_found
else loop (i+1) in else loop (i+1) in
let ac = loop 0 in let ac = loop 0 in
let com = paparazzi_home // "var" // ac // "sim/simsitl" in (*let rec sim_type = fun i ->
if Sys.argv.(i) = "-jsbsim" then
"jsbsim"
else if i = n then "sim"
else loop (i+1) in
let sim = sim_type 0 in*)
let sim = "jsbsim" in
let com = paparazzi_home // "var" // ac // sim // "simsitl" in
prerr_endline com;
if not (Sys.file_exists com) then begin if not (Sys.file_exists com) then begin
Printf.fprintf stderr "Error: '%s' is missing. Build target sim for A/C %s ?\n" com ac; Printf.fprintf stderr "Error: '%s' is missing. Build target sim for A/C %s ?\n" com ac;
exit 1 exit 1
+4 -1
View File
@@ -112,7 +112,7 @@ int main ( int argc, char** argv) {
static void ivy_transport_init(void) { static void ivy_transport_init(void) {
IvyInit ("Paparazzi sim " + AC_ID, "READY", NULL, NULL, NULL, NULL); IvyInit ("Paparazzi jsbsim " + AC_ID, "READY", NULL, NULL, NULL, NULL);
IvyStart(ivyBus.c_str()); IvyStart(ivyBus.c_str());
} }
@@ -147,6 +147,9 @@ static void sim_parse_options(int argc, char** argv) {
else if (argument == "-norc") { else if (argument == "-norc") {
// Compatibility with ocaml // Compatibility with ocaml
} }
else if (argument == "-jsbsim") {
// Compatibility with ocaml
}
else if (argument == "-b") { else if (argument == "-b") {
ivyBus = string(argv[++i]); ivyBus = string(argv[++i]);
} }