ocaml applications -> dynamic compil and link

"make deb" creates a valid (???) deb package
paparazzi_demo to play s simple example
This commit is contained in:
Pascal Brisset
2005-02-24 13:22:14 +00:00
parent 175d65779e
commit c1622f28ed
26 changed files with 231 additions and 129 deletions
+4 -4
View File
@@ -114,13 +114,13 @@ clean_ac :
rm -fr $(PAPARAZZI_HOME)/var/$(AIRCRAFT)
run_sitl :
$(PAPARAZZI_HOME)/var/$(AIRCRAFT)/sim/simsitl.out
$(PAPARAZZI_HOME)/var/$(AIRCRAFT)/sim/simsitl
install : all
./Makefile.pl -install -destdir $(DESTDIR)
install :
./Makefile.pl -install -destdir $(DESTDIR)/usr
uninstall :
./Makefile.pl -uninstall -destdir $(DESTDIR)
./Makefile.pl -uninstall -destdir $(DESTDIR)/usr
deb :
chmod u+x debian/rules
+2 -2
View File
@@ -1,11 +1,11 @@
DESTDIR=/usr
DESTDIR=/
ifeq ($(PAPARAZZI_HOME),)
PAPARAZZI_HOME=$(HOME)/paparazzi
endif
ifeq ($(PAPARAZZI_SRC),)
TOOLS=$(DESTDIR)/share/paparazzi/bin
TOOLS=$(DESTDIR)/usr/share/paparazzi/bin
else
TOOLS=$(PAPARAZZI_SRC)/sw/tools
endif
+67 -20
View File
@@ -2,19 +2,20 @@
<section name="binaries" dest="bin" comment="main program">
<file name="sw/supervision/paparazzi.pl"/>
<!-- TMP --> <file name="paparazzi_demo"/>
</section>
<section name="priv_binaries" dest="share/paparazzi/bin" comment="helpers program">
<file name="sw/configurator/medit.out"/>
<file name="sw/ground_segment/cockpit/cockpit.pl"/>
<file name="sw/ground_segment/cockpit/map.pl"/>
<file name="sw/ground_segment/cockpit/map2d.opt"/>
<file name="sw/ground_segment/cockpit/map2d"/>
<file name="sw/ground_segment/speech/paparazzi_speak.pl"/>
<file name="sw/ground_segment/tmtc/messages.opt"/>
<file name="sw/ground_segment/tmtc/receive.opt"/>
<file name="sw/ground_segment/visu3d/mapGL.opt"/>
<file name="sw/logalizer/play.opt"/>
<file name="sw/simulator/gen_downlink.out"/>
<file name="sw/ground_segment/tmtc/messages"/>
<file name="sw/ground_segment/tmtc/receive"/>
<file name="sw/ground_segment/visu3d/mapGL"/>
<file name="sw/logalizer/play"/>
<file name="sw/simulator/gen_downlink"/>
<file name="sw/simulator/simsitl.pl"/>
<file name="sw/tools/gen_aircraft.out"/>
<file name="sw/tools/gen_airframe.out"/>
@@ -66,7 +67,7 @@
<file name="conf/ubx.dtd"/>
<file name="conf/conf.xml"/>
<file name="conf/control_panel.xml.sys" new_name="control_panel.xml"/>
<file name="conf/ground_segment.xml"/>
<!-- <file name="conf/ground_segment.xml"/> -->
<file name="conf/hosts_wavecard.xml"/>
<file name="conf/messages.xml"/>
<file name="conf/wavecard.xml"/>
@@ -119,17 +120,64 @@
<file name="Makefile.ac"/>
</section>
<section name="sw_tmtc" dest="share/paparazzi/sw/ground_segment/tmtc" comment="ocaml objects">
<file name="sw/ground_segment/tmtc/modem.cmo"/>
<file name="sw/ground_segment/tmtc/modem.cmi"/>
<file name="sw/ground_segment/tmtc/receive.ml"/>
<file name="sw/ground_segment/tmtc/messages.ml"/>
</section>
<section name="sw_cockpit" dest="share/paparazzi/sw/ground_segment/cockpit" comment="ocaml objects">
<file name="sw/ground_segment/cockpit/map2d.ml"/>
</section>
<section name="sw_visu3d" dest="share/paparazzi/sw/ground_segment/visu3d" comment="ocaml objects">
<file name="sw/ground_segment/visu3d/mapGL.ml"/>
</section>
<section name="sw_log" dest="share/paparazzi/sw/logalizer" comment="ocaml objects">
<file name="sw/logalizer/play.ml"/>
</section>
<section name="sw_tools" dest="share/paparazzi/sw/tools" comment="ocaml objects">
<file name="sw/tools/gen_aircraft.ml"/>
<file name="sw/tools/gen_airframe.ml"/>
<file name="sw/tools/gen_calib.ml"/>
<file name="sw/tools/gen_radio.ml"/>
<file name="sw/tools/gen_ubx.ml"/>
<file name="sw/tools/gen_messages.ml"/>
<file name="sw/tools/gen_flight_plan.ml"/>
<file name="sw/tools/fp_syntax.cmo"/>
<file name="sw/tools/fp_parser.cmo"/>
<file name="sw/tools/fp_lexer.cmo"/>
<file name="sw/tools/fp_proc.cmo"/>
<file name="sw/tools/fp_proc.cmi"/>
<file name="sw/tools/fp_syntax.cmi"/>
</section>
<section name="sw_lib_ocaml" dest="share/paparazzi/sw/lib/ocaml" comment="ocaml objects and libs needed during airborne code generation">
<file name="sw/lib/ocaml/env.cmo"/>
<file name="sw/lib/ocaml/env.cmi"/>
<file name="sw/lib/ocaml/extXml.cmo"/>
<file name="sw/lib/ocaml/extXml.cmi"/>
<file name="sw/lib/ocaml/latlong.cmo"/>
<file name="sw/lib/ocaml/latlong.cmi"/>
<file name="sw/lib/ocaml/xml2h.cmo"/>
<file name="sw/lib/ocaml/xml2h.cmi"/>
<file name="sw/lib/ocaml/lib.cma"/>
<file name="sw/lib/ocaml/liblib.a"/>
<file name="sw/lib/ocaml/serial.cmi"/>
<file name="sw/lib/ocaml/pprz.cmi"/>
<file name="sw/lib/ocaml/debug.cmi"/>
<file name="sw/lib/ocaml/geometry_2d.cmi"/>
<file name="sw/lib/ocaml/geometry_3d.cmi"/>
<file name="sw/lib/ocaml/gtk_3d.cmi"/>
<file name="sw/lib/ocaml/gtk_tools.cmi"/>
<file name="sw/lib/ocaml/srtm.cmi"/>
<file name="sw/lib/ocaml/ocaml_tools.cmi"/>
<file name="sw/lib/ocaml/mapCanvas.cmi"/>
<file name="sw/lib/ocaml/mapTrack.cmi"/>
<file name="sw/lib/ocaml/mapWaypoints.cmi"/>
<file name="sw/lib/ocaml/lib-pprz.cma"/>
<file name="sw/lib/ocaml/liblib-pprz.a"/>
<file name="sw/lib/ocaml/dlllib-pprz.so"/>
<file name="sw/lib/ocaml/xlib-pprz.cma"/>
<file name="sw/lib/ocaml/libxlib-pprz.a"/>
<file name="sw/lib/ocaml/dllxlib-pprz.so"/>
</section>
<section name="sw_simulator" dest="share/paparazzi/sw/simulator" comment="ocaml objects and C hooks for airborne code simulation">
@@ -139,13 +187,11 @@
<file name="sw/simulator/flightModel.ml"/>
<file name="sw/simulator/flightModel.mli"/>
<file name="sw/simulator/flightModelHeli.ml.sav"/>
<file name="sw/simulator/gen_downlink.ml"/>
<file name="sw/simulator/gps.ml"/>
<file name="sw/simulator/gui.ml"/>
<file name="sw/simulator/hitl.ml"/>
<file name="sw/simulator/hitl.mli"/>
<file name="sw/simulator/sim.ml"/>
<file name="sw/simulator/sim.mli"/>
<file name="sw/simulator/sim.cmi"/>
<file name="sw/simulator/sim_ap.c"/>
<file name="sw/simulator/sim_gps.c"/>
<file name="sw/simulator/sim_ir.c"/>
@@ -153,11 +199,12 @@
<file name="sw/simulator/simsitl.ml"/>
<file name="sw/simulator/simsitl.pl"/>
<file name="sw/simulator/sirf.ml"/>
<file name="sw/simulator/sitl.ml"/>
<file name="sw/simulator/sitl.mli"/>
<file name="sw/simulator/sitl.cma"/>
<file name="sw/simulator/sitl.cmi"/>
<file name="sw/simulator/stdlib.ml"/>
<file name="sw/simulator/timer.h"/>
<file name="sw/simulator/types.ml"/>
<file name="sw/simulator/gen_downlink.ml"/>
</section>
<section name="sw_include" dest="share/paparazzi/sw/include" comment="common headers for airborne code">
@@ -224,11 +271,11 @@
</section>
<section name="var_Thon1_sim" dest="share/paparazzi/var/Thon1/sim">
<file name="var/Thon1/sim/simsitl.out"/>
<file name="var/Thon1/sim/simsitl"/>
</section>
<section name="var_Thon2_sim" dest="share/paparazzi/var/Thon2/sim">
<file name="var/Thon2/sim/simsitl.out"/>
<file name="var/Thon2/sim/simsitl"/>
</section>
</install>
+1
View File
@@ -0,0 +1 @@
4
+1 -1
View File
@@ -6,7 +6,7 @@ Build-Depends: debhelper (>= 4.0.0)
Standards-Version: 3.6.1
Package: paparazzi
Architecture: any
Architecture: i386
Depends: ivy-c-dev, ivy-c, ivy-perl, libsubject-perl, zinc-perl, zinc-tk, ivy-ocaml, xml-light-ocaml, libxml-dom-perl, libpcre3-dev, liblablgtk2-ocaml-dev, gcc-avr, avr-libc, binutils-avr, libexpect-perl, libgnomecanvas2-dev, libcamlimages-ocaml-dev, uisp, libfile-ncopy-perl, libtext-csv-perl, digikit
Description: Paparazzi Meta Package
+5 -5
View File
@@ -34,8 +34,8 @@ build-stamp: configure-stamp
dh_testdir
# Add here commands to compile the package.
# $(MAKE)
#docbook-to-man debian/paparazzi.sgml > paparazzi.1
$(MAKE)
#docbook-to-man debian/ivy-ocaml.sgml > ivy-ocaml.1
touch build-stamp
@@ -45,7 +45,7 @@ clean:
rm -f build-stamp configure-stamp
# Add here commands to clean up after the build process.
# -$(MAKE) clean
-$(MAKE) clean
dh_clean
@@ -55,8 +55,8 @@ install: build
dh_clean -k
dh_installdirs
# Add here commands to install the package into debian/paparazzi.
# $(MAKE) install DESTDIR=$(CURDIR)/debian/paparazzi
# Add here commands to install the package into debian/ivy-ocaml.
$(MAKE) install DESTDIR=$(CURDIR)/debian/paparazzi
# Build architecture-independent files here.
Executable
+15
View File
@@ -0,0 +1,15 @@
#! /bin/sh
mkdir -p $HOME/paparazzi
cp -a /usr/share/paparazzi/var $HOME/paparazzi
cp -a /usr/share/paparazzi/conf $HOME/paparazzi
cp -a /usr/share/paparazzi/data $HOME/paparazzi
PATH=$PATH:/usr/share/paparazzi/bin
cockpit.pl &
sleep 1
map2d -m muret_UTM.xml &
sleep 1
$HOME/paparazzi/var/Thon1/sim/simsitl &
sleep 1
$HOME/paparazzi/var/Thon2/sim/simsitl &
sleep 1
receive
+4
View File
@@ -0,0 +1,4 @@
#! /bin/sh
if test -z "$PAPARAZZI_SRC"; then
PAPARAZZI_SRC=/usr/share/paparazzi
fi
+15 -6
View File
@@ -23,16 +23,25 @@
OCAMLC=ocamlc -g -I +labltk -I +lablgtk2 -I ../lib/ocaml
SRC = env_conf.ml notebook.ml tty.ml varXml.ml console.ml tkXml.ml flasher.ml welcome.ml hardware.ml radio.ml servos.ml adc.ml infrared.ml attitude.ml autopilot.ml airframe.ml flightplan.ml upload.ml simulator.ml monitor.ml logalizer.ml main.ml
CMO = $(SRC:.ml=.cmo)
CMO = env_conf.cmo notebook.cmo tty.cmo varXml.cmo console.cmo tkXml.cmo flasher.cmo welcome.cmo hardware.cmo radio.cmo servos.cmo adc.cmo infrared.cmo attitude.cmo autopilot.cmo airframe.cmo flightplan.cmo upload.cmo simulator.cmo monitor.cmo logalizer.cmo main.ml
all : configurator medit.out
ABS_CMO = $(CMO:%=$$PAPARAZZI_SRC/sw/configurator/%)
all : configurator medit
configurator : $(CMO)
$(OCAMLC) -custom -o $@ unix.cma str.cma xml-light.cma labltk.cma jpflib.cma lib.cma $^
$(OCAMLC) -custom -o /dev/null unix.cma str.cma xml-light.cma labltk.cma jpflib.cma lib-pprz.cma $^ # To check
cat ../../pprz_src_test.sh > $@
echo 'ocaml -I +labltk -I $$PAPARAZZI_SRC/sw/lib/ocaml -I $$PAPARAZZI_SRC/sw/configurator unix.cma str.cma xml-light.cma labltk.cma jpflib.cma lib-pprz.cma $(ABS_CMO) $$*' >> $@
chmod a+x $@
medit : medit.ml
$(OCAMLC) -o /dev/null str.cma unix.cma xml-light.cma glibivy-ocaml.cma -I +lablgtk2 lablgtk.cma lablgnomecanvas.cma gtkInit.cmo lib-pprz.cma $^ # To check
cat ../../pprz_src_test.sh > $@
echo 'lablgtk2 -I $$PAPARAZZI_SRC/sw/lib/ocaml str.cma unix.cma xml-light.cma glibivy-ocaml.cma lib-pprz.cma $$PAPARAZZI_SRC/sw/configurator/$< $$*' >> $@
chmod a+x $@
medit.out : medit.cmo
$(OCAMLC) -o $@ str.cma unix.cma xml-light.cma glibivy-ocaml.cma -I +lablgtk2 lablgtk.cma lablgnomecanvas.cma gtkInit.cmo lib.cma $^
%.cmo : %.ml
$(OCAMLC) -c $<
+7 -14
View File
@@ -1,25 +1,18 @@
OCAMLC=ocamlc -g
OCAMLOPT=ocamlopt
INCLUDES=-I +lablgtk2 -I +camlimages -I ../../lib/ocaml
LIBS=glibivy-ocaml.cma lablgtk.cma ci_core.cma ci_png.cma ci_gif.cma ci_jpeg.cma ci_tiff.cma ci_bmp.cma ci_ppm.cma ci_ps.cma lib.cma lablgnomecanvas.cma xlib.cma
LIBS=glibivy-ocaml.cma lablgtk.cma ci_core.cma ci_png.cma ci_gif.cma ci_jpeg.cma ci_tiff.cma ci_bmp.cma ci_ppm.cma ci_ps.cma lib-pprz.cma lablgnomecanvas.cma xlib-pprz.cma
CMXA=$(LIBS:.cma=.cmxa)
SRC = map2d.ml
CMO = $(SRC:.ml=.cmo)
CMX = $(SRC:.ml=.cmx)
all : map2d.opt
all : map2d
map2d.out : $(CMO)
$(OCAMLC) $(INCLUDES) $(LIBS) gtkInit.cmo $(CMO) -o $@
map2d.opt : $(CMX)
$(OCAMLOPT) str.cmxa unix.cmxa xml-light.cmxa $(INCLUDES) $(CMXA) gtkInit.cmx $(CMX) -o $@
map2d.run:
lablgtk2 str.cma unix.cma xml-light.cma -I +camlimages -I ../../lib/ocaml glibivy-ocaml.cma ci_core.cma ci_png.cma ci_gif.cma ci_jpeg.cma ci_tiff.cma ci_bmp.cma ci_ppm.cma ci_ps.cma lib.cma xlib.cma map2d.ml
map2d : map2d.ml
$(OCAMLC) -custom $(INCLUDES) $(LIBS) gtkInit.cmo $(CMO) -o /dev/null #to Check
cat ../../../pprz_src_test.sh > $@
echo 'lablgtk2 str.cma unix.cma xml-light.cma -I +camlimages glibivy-ocaml.cma ci_core.cma ci_png.cma ci_gif.cma ci_jpeg.cma ci_tiff.cma ci_bmp.cma ci_ppm.cma ci_ps.cma -I $$PAPARAZZI_SRC/sw/lib/ocaml lib-pprz.cma xlib-pprz.cma $$PAPARAZZI_SRC/sw/ground_segment/cockpit/$< $$*' >> $@
chmod a+x $@
.SUFFIXES: .ml .mli .cmo .cmi .cmx
+1 -1
View File
@@ -18,7 +18,7 @@ let gen_flight_plan =
try
Sys.getenv "PAPARAZZI_SRC" // "sw/tools/gen_flight_plan.out"
with
Not_found -> "/usr/bin/paparazzi gen_flight_plan"
Not_found -> "/usr/share/paparazzi/bin/gen_flight_plan.out"
type aircraft = {
+12 -17
View File
@@ -22,37 +22,32 @@
include ../../../conf/Makefile.local
all: messages.cmo modem.cmo receive.cmo receive.opt messages.opt
all: receive messages
clean:
rm -f receive *.bak *~ core *.o .depend *.opt *.out *.cm*
rm -f receive messages *.bak *~ core *.o .depend *.opt *.out *.cm*
OCAMLC = ocamlc
OCAMLOPT = ocamlopt
INCLUDES= -I ../../lib/ocaml -I +lablgtk2
messages.opt : messages.ml
$(OCAMLOPT) $(INCLUDES) -o $@ unix.cmxa xml-light.cmxa glibivy-ocaml.cmxa -I +lablgtk2 lablgtk.cmxa gtkInit.cmx str.cmxa lib.cmxa $^
strip $@
messages: messages.ml
$(OCAMLC) $(INCLUDES) -o /dev/null unix.cma xml-light.cma glibivy-ocaml.cma -I +lablgtk2 lablgtk.cma gtkInit.cmo str.cma lib-pprz.cma $^ # To check
cat ../../../pprz_src_test.sh > $@
echo 'lablgtk2 str.cma ivy-ocaml.cma -I $$PAPARAZZI_SRC/sw/lib/ocaml lib-pprz.cma $$PAPARAZZI_SRC/sw/ground_segment/tmtc/$< $$*' >> $@
chmod a+x $@
messages.run:
lablgtk2 str.cma -I ../../lib/ocaml ivy-ocaml.cma lib.cma messages.cmo
receive.opt : modem.ml receive.ml
$(OCAMLOPT) $(INCLUDES) -o $@ str.cmxa unix.cmxa xml-light.cmxa glibivy-ocaml.cmxa -I +lablgtk2 lablgtk.cmxa lib.cmxa $^
strip $@
receive : modem.cmo receive.ml
$(OCAMLC) $(INCLUDES) -o $@ str.cma unix.cma xml-light.cma glibivy-ocaml.cma -I +lablgtk2 lablgtk.cma lib-pprz.cma $^ #To check
cat ../../../pprz_src_test.sh > $@
echo 'lablgtk2 str.cma glibivy-ocaml.cma -I $$PAPARAZZI_SRC/sw/lib/ocaml lib-pprz.cma -I $$PAPARAZZI_SRC/sw/ground_segment/tmtc $$PAPARAZZI_SRC/sw/ground_segment/tmtc/modem.cmo $$PAPARAZZI_SRC/sw/ground_segment/tmtc/receive.ml $$*' >> $@
chmod a+x $@
listen.opt : listen.ml
$(OCAMLOPT) $(INCLUDES) -o $@ str.cmxa unix.cmxa xml-light.cmxa glibivy-ocaml.cmxa -I +lablgtk2 lablgtk.cmxa lib.cmxa $^
strip $@
receive.out : modem.ml receive.ml
$(OCAMLC) -g $(INCLUDES) -o $@ str.cma unix.cma xml-light.cma glibivy-ocaml.cma -I +lablgtk2 lablgtk.cma lib.cma $^
receive.run:
lablgtk2 str.cma -I ../../lib/ocaml ivy-ocaml.cma lib.cma modem.cmo receive.ml
%.cmo : %.ml
$(OCAMLC) $(INCLUDES) -c $<
+9 -9
View File
@@ -12,22 +12,22 @@ OBJS= $(SRC:.ml=.cmo)
LINK= $(OCAMLC) $(MLFLAGS)
LIBS_CI = ci_core.cma ci_gif.cma ci_jpeg.cma ci_tiff.cma ci_bmp.cma ci_ppm.cma ci_png.cma \
ci_xpm.cma ci_ps.cma ci_freetype.cma
STDLIBS = unix.cma str.cmxa xml-light.cma lablgtk.cma lablgl.cma lablgtkgl.cma $(LIBS_CI)
ADD_LIBS = lib.cma xlib.cma glibivy-ocaml.cma
STDLIBS = unix.cma str.cma xml-light.cma lablgtk.cma lablgnomecanvas.cma lablgl.cma lablgtkgl.cma $(LIBS_CI)
ADD_LIBS = lib-pprz.cma xlib-pprz.cma glibivy-ocaml.cma
CLIBS = -cclib -lpthread
all: mapGL.opt
all: mapGL
clean:
\rm -f *.cm* *.o *.a *~ *.opt *.out *.top *.output *obj *exe \
\rm -f mapGL *.cm* *.o *.a *~ *.opt *.out *.top *.output *obj *exe \
stars_lexer.ml stars_parser.mli stars_parser.ml .depend
# Executables
mapGL.out: $(OBJS)
$(OCAMLC) $(MLFLAGS) $(STDLIBS) gtkInit.cmo $(ADD_LIBS) -o $@ $(OBJS_3D) $(OBJS) $(CLIBS)
mapGL.opt: $(OBJS:.cmo=.cmx)
$(OCAMLOPT) $(MLFLAGS) $(STDLIBS:.cma=.cmxa) gtkInit.cmx $(ADD_LIBS:.cma=.cmxa) -o $@ $(OBJS:.cmo=.cmx) $(CLIBS)
mapGL: mapGL.ml
$(OCAMLC) $(MLFLAGS) $(STDLIBS) gtkInit.cmo $(ADD_LIBS) -o $@ $< $(CLIBS) # To check
cat ../../../pprz_src_test.sh > $@
echo 'ocaml -I +lablgtk2 -I +lablGL -I +camlimages -I $$PAPARAZZI_SRC/sw/lib/ocaml $(STDLIBS) gtkInit.cmo $(ADD_LIBS) $$PAPARAZZI_SRC/sw/ground_segment/visu3d/$< $$*' >> $@
chmod a+x $@
# Do not edit below this line
+10 -10
View File
@@ -395,7 +395,7 @@ let build_interface = fun map_file mission_file ->
let (window, vbox, factory, accel_group, menus, menu_help) =
Gtk_tools.create_window_with_menubar_help ("Visu Drone v"^version)
width height liste_menus in
window#connect#destroy ~callback:GMain.Main.quit;
ignore (window#connect#destroy ~callback:GMain.Main.quit);
(* Creation du Widget OpenGL *)
let view3d = new widget_3d vbox#add false "" in
@@ -407,27 +407,27 @@ let build_interface = fun map_file mission_file ->
(* Creation des menus : Sol *)
let factory = new GMenu.factory menus.(!nb_menus) ~accel_group in
incr nb_menus ;
factory#add_item "Load Background"
~callback:(on_load_surface window view3d id_sol) ;
ignore (factory#add_item "Load Background"
~callback:(on_load_surface window view3d id_sol)) ;
(* Creation des menus : Trajectoires *)
let factory = new GMenu.factory menus.(!nb_menus) ~accel_group in
incr nb_menus ;
factory#add_item "Load Track" ~callback:(load_trajectory view3d lst_ids_trajs) ;
factory#add_item "Edit Tracks"
~callback:(build_lst_traj tooltips view3d lst_ids_trajs) ;
ignore (factory#add_item "Load Track" ~callback:(load_trajectory view3d lst_ids_trajs)) ;
ignore (factory#add_item "Edit Tracks"
~callback:(build_lst_traj tooltips view3d lst_ids_trajs)) ;
(* Creation des menus : Parametres *)
let factory = new GMenu.factory menus.(!nb_menus) ~accel_group in
incr nb_menus ;
factory#add_item "Edit" ~callback:(fun () -> ()) ;
ignore (factory#add_item "Edit" ~callback:(fun () -> ())) ;
(* Aide *)
let factory = new GMenu.factory menu_help in
factory#add_item "A propos" ~callback:build_fen_about ;
factory#add_item "Help keys/mouse"
ignore (factory#add_item "A propos" ~callback:build_fen_about) ;
ignore (factory#add_item "Help keys/mouse"
~callback:(fun () -> Gtk_tools.display_file filename_help_keys
"Aide touches clavier" 370 500 tooltips (Some "fixed")) ;
"Aide touches clavier" 370 500 tooltips (Some "fixed"))) ;
(* Affichage de la fenetre principale *)
window#show () ;
+7 -4
View File
@@ -22,7 +22,7 @@
include ../../../conf/Makefile.local
all: wind.opt
all: wind
INCLUDES= -I ../../lib/ocaml -I +lablgtk2
@@ -33,9 +33,12 @@ OCAMLDEP= ocamldep $(INCLUDES)
wind.opt : wind.cmx
$(OCAMLOPT) -o $@ xml-light.cmxa glibivy-ocaml.cmxa lablgtk.cmxa str.cmxa lib.cmxa $<
strip $@
wind : wind.ml
$(OCAMLC) -o $@ xml-light.cma glibivy-ocaml.cma lablgtk.cma str.cma lib-pprz.cma $< # To check
cat ../../../pprz_src_test.sh > $@
echo 'ocaml -I +lablgtk2 -I $$PAPARAZZI_SRC/sw/lib/ocaml xml-light.cma glibivy-ocaml.cma lablgtk.cma str.cma lib-pprz.cma $$PAPARAZZI_SRC/sw/ground_segment/wind/$< $$*' >> $@
chmod a+x $@
.SUFFIXES:
.SUFFIXES: .ml .mli .mly .mll .cmi .cmo .cmx .out .opt .p.cmx .popt
+12 -11
View File
@@ -21,7 +21,7 @@
#
INCLUDES= -I +lablgl -I +camlimages -I +lablgtk2
OCAMLC=ocamlc -g $(INCLUDES)
OCAMLC=ocamlc $(INCLUDES)
OCAMLOPT=ocamlopt $(INCLUDES)
@@ -34,22 +34,23 @@ XCMO = $(XSRC:.ml=.cmo)
XCMX = $(XSRC:.ml=.cmx)
all : lib.cma lib.cmxa xlib.cma xlib.cmxa xml_get.out
all : lib-pprz.cma xlib-pprz.cma xml_get.out
# lib-pprz.cmxa xlib-pprz.cmxa
lib.cma : $(CMO)
ocamlmklib -custom -o lib str.cma xml-light.cma unix.cma $^
lib-pprz.cma : $(CMO)
ocamlmklib -o lib-pprz str.cma xml-light.cma unix.cma $^
lib.cmxa : $(CMX)
ocamlmklib -custom -o lib $^
lib-pprz.cmxa : $(CMX)
ocamlmklib -o lib-pprz $^
xlib.cma : $(XCMO)
ocamlmklib -custom -o xlib $^
xlib-pprz.cma : $(XCMO)
ocamlmklib -o xlib-pprz $^
xlib.cmxa : $(XCMX)
ocamlmklib -custom -o xlib $^
xlib-pprz.cmxa : $(XCMX)
ocamlmklib -o xlib-pprz $^
xml_get.out : lib.cma xml_get.cmo
xml_get.out : lib-pprz.cma xml_get.cmo
$(OCAMLC) -o $@ str.cma xml-light.cma -I . $^
ignutm.opt : latlong.cmx ignutm.ml
+11 -6
View File
@@ -53,7 +53,8 @@ type type_descr = {
let (//) = Filename.concat
let messages_xml = Xml.parse_file (Env.paparazzi_src // "conf" // "messages.xml")
let lazy_messages_xml = lazy (Xml.parse_file (Env.paparazzi_src // "conf" // "messages.xml"))
let messages_xml = fun () -> Lazy.force lazy_messages_xml
external float_of_bytes : string -> int -> float = "c_float_of_indexed_bytes"
external int32_of_bytes : string -> int -> int32 = "c_int32_of_indexed_bytes"
@@ -85,8 +86,9 @@ let field_of_xml = fun xml ->
(** Table of msg classes indexed by name. Each class is a table of messages
indexed by ids *)
let classes = Hashtbl.create 13
let _ =
let lazy_classes =
lazy
(let h = Hashtbl.create 13 in
List.iter
(fun xml_class ->
let by_id = Hashtbl.create 13
@@ -105,9 +107,12 @@ let _ =
with _ ->
fprintf stderr "Warning: Ignoring '%s'\n" (Xml.to_string xml_msg))
(Xml.children xml_class);
Hashtbl.add classes (ExtXml.attrib xml_class "name") (by_id, by_name)
Hashtbl.add h (ExtXml.attrib xml_class "name") (by_id, by_name)
)
(Xml.children messages_xml)
(Xml.children (messages_xml ()));
h)
let classes = fun () -> Lazy.force lazy_classes
let magic = fun x -> (Obj.magic x:('a,'b,'c) Pervasives.format)
@@ -129,7 +134,7 @@ module Protocol(Class:CLASS) = struct
let index_start = fun buf ->
String.index buf stx
let messages_by_id, messages_by_name = Hashtbl.find classes Class.name
let messages_by_id, messages_by_name = Hashtbl.find (classes ()) Class.name
let message_of_id = fun id -> Hashtbl.find messages_by_id (id (*** +1 ***))
let message_of_name = fun name -> Hashtbl.find messages_by_name name
+9 -6
View File
@@ -20,13 +20,16 @@
# Boston, MA 02111-1307, USA.
#
OCAMLC = ocamlc -I ../lib/ocaml
OCAMLOPT = ocamlopt -I ../lib/ocaml
OCAMLC = ocamlc
OCAMLOPT = ocamlopt
all: play.opt
all: play
clean:
rm -f *.opt *.out *~ core *.o *.bak .depend *.cm*
rm -f *.opt *.out *~ core *.o *.bak .depend *.cm* play
play.opt : play.ml
$(OCAMLOPT) -o $@ unix.cmxa glibivy-ocaml.cmxa -I +lablgtk2 lablgtk.cmxa gtkInit.cmx $^
play : play.ml
$(OCAMLC) -o $@ unix.cma glibivy-ocaml.cma -I +lablgtk2 lablgtk.cma gtkInit.cmo $^ # to check
cat ../../pprz_src_test.sh > $@
echo 'lablgtk2 unix.cma glibivy-ocaml.cma $$PAPARAZZI_SRC/sw/logalizer/$< $$*' >> $@
chmod a+x $@
+17 -7
View File
@@ -34,6 +34,7 @@ SIMSCMO=$(SIMSML:%.ml=%.cmo)
SIMSCMX=$(SIMSML:%.ml=%.cmx)
SIMSC = sim_ir.c sim_gps.c sim_ap.c estimator.c pid.c nav.c main.c
SIMSO=$(SIMSC:%.c=$(OBJDIR)/%.o)
SIMSA=sims.cma
OCAMLC = ocamlc
OCAMLOPT=ocamlopt -p
@@ -46,7 +47,7 @@ VARINCLUDE=$(PAPARAZZI_HOME)/var/include
ACINCLUDE = $(PAPARAZZI_HOME)/var/$(AIRCRAFT)
MESSAGES = ../../conf/messages.xml
GEN_DOWNLINK = ./gen_downlink.out
GEN_DOWNLINK = ./gen_downlink
SIMDIR=$(shell echo `pwd`)
@@ -55,7 +56,7 @@ SIMDIR=$(shell echo `pwd`)
#all : simhitl.out sitl.cma $(GEN_DOWNLINK)
all : sitl.cma $(GEN_DOWNLINK)
sim_sitl : $(OBJDIR)/simsitl.out
sim_sitl : $(OBJDIR)/simsitl
simhitl.out : $(SIMHCMO) simhitl.cmo
$(OCAMLC) $(INCLUDES) -o $@ str.cma xml-light.cma unix.cma lib.cma lablgtk.cma gtkInit.cmo $^
@@ -66,8 +67,15 @@ sitl.cma : $(SIMSCMO)
sitl.cmxa : $(SIMSCMX)
ocamlopt -o $@ -a $^
$(OBJDIR)/simsitl.out : sitl.cma $(SIMSO) $(OBJDIR)/simsitl.cmo
$(OCAMLC) $(INCLUDES) -custom -o $@ glibivy-ocaml.cma xml-light.cma unix.cma lib.cma lablgtk.cma gtkInit.cmo $(SIMSO) sitl.cma $(OBJDIR)/simsitl.cmo
$(OBJDIR)/$(SIMSA) : $(SIMSO)
touch $(OBJDIR)/dummy.ml
cd $(OBJDIR); ocamlmklib -o sims $^ dummy.ml
$(OBJDIR)/simsitl : $(OBJDIR)/$(SIMSA) sitl.cma $(OBJDIR)/simsitl.ml
$(OCAMLC) $(INCLUDES) -o $@ glibivy-ocaml.cma xml-light.cma unix.cma lib-pprz.cma lablgtk.cma gtkInit.cmo -I $(OBJDIR) $(SIMSA) sitl.cma $(OBJDIR)/simsitl.ml # To check
cat ../../pprz_src_test.sh > $@
echo 'lablgtk2 -I $$PAPARAZZI_SRC/sw/lib/ocaml -I $(OBJDIR) glibivy-ocaml.cma xml-light.cma lib-pprz.cma $(SIMSA) $$PAPARAZZI_SRC/sw/simulator/sitl.cma -I $$PAPARAZZI_SRC/sw/simulator $(OBJDIR)/simsitl.ml $$*' >> $@
chmod a+x $@
$(OBJDIR)/simsitl.opt : $(SIMSO) $(OBJDIR)/simsitl.cmx
$(OCAMLOPT) $(INCLUDES) -o $@ str.cmxa glibivy-ocaml.cmxa xml-light.cmxa unix.cmxa lib.cmxa lablgtk.cmxa gtkInit.cmx $(SIMSO) sitl.cmxa $(OBJDIR)/simsitl.cmx
@@ -90,8 +98,10 @@ $(OBJDIR)/downlink.h : $(MESSAGES) $(GEN_DOWNLINK)
$(GEN_DOWNLINK) $< > $@
$(GEN_DOWNLINK) : gen_downlink.ml
$(OCAMLC) $(INCLUDES) -o $@ str.cma xml-light.cma lib.cma $<
$(OCAMLC) $(INCLUDES) -o $@ str.cma xml-light.cma lib-pprz.cma $< # To check
cat ../../pprz_src_test.sh > $@
echo 'ocaml -I $$PAPARAZZI_SRC/sw/lib/ocaml str.cma xml-light.cma lib-pprz.cma $$PAPARAZZI_SRC/sw/simulator/$< $$*' >> $@
chmod a+x $@
$(OBJDIR)/simsitl.cmo : $(OBJDIR)/simsitl.ml
$(OCAMLC) $(INCLUDES) -c -o $@ $<
@@ -113,7 +123,7 @@ $(OBJDIR)/simsitl.ml : simsitl.ml
$(OCAMLC) $(INCLUDES) -c $<
clean :
\rm -f *.cm* *~ *.out .depend *.o
\rm -f *.cm* *~ *.out .depend *.o $(GEN_DOWNLINK)
.depend:
ocamldep *.ml* > .depend
+2
View File
@@ -76,6 +76,8 @@ let one_message = fun m ->
printf "}\n\n"
let _ =
if Array.length Sys.argv <> 2 then
failwith (sprintf "Usage: %s <xml message file>" Sys.argv.(0));
let xml = Xml2h.start_and_begin Sys.argv.(1) h_name in
let xml = ExtXml.child xml ~select:(fun x -> Xml.attrib x "name"="telemetry_ap") "class" in
let messages = (Xml.children xml) in
+1 -1
View File
@@ -120,7 +120,7 @@ module Make(AircraftItl : AIRCRAFT_ITL) = struct
let gust_norm_max_adj = GData.adjustment ~value:0. ~lower:(0.) ~upper:20. ~step_incr:0.1 () in
let gust_norm_ch_fact_adj = GData.adjustment ~value:0. ~lower:(0.) ~upper:20. ~step_incr:0.1 () in
let gust_dir_ch_fact_adj = GData.adjustment ~value:0. ~lower:(0.) ~upper:20. ~step_incr:0.1 () in
let infrared_contrast_adj = GData.adjustment ~value:0. ~lower:(0.) ~upper:1010. ~step_incr:10. () in
let infrared_contrast_adj = GData.adjustment ~value:500. ~lower:(0.) ~upper:1010. ~step_incr:10. () in
let run = ref false in
let scheduler =
+10 -3
View File
@@ -1,13 +1,17 @@
OCAML=ocaml
OCAMLC=ocamlc -g -I ../lib/ocaml
OCAMLLEX=ocamllex
OCAMLYACC=ocamlyacc
all: gen_aircraft.out gen_airframe.out gen_calib.out gen_messages.out gen_ubx.out gen_flight_plan.out gen_radio.out
FP_CMO = fp_syntax.cmo fp_parser.cmo fp_lexer.cmo fp_proc.cmo gen_flight_plan.cmo
FP_CMO = fp_syntax.cmo fp_parser.cmo fp_lexer.cmo fp_proc.cmo gen_flight_plan.ml
ABS_FP = $(FP_CMO:%=$$PAPARAZZI_SRC/sw/tools/%)
gen_flight_plan.out : $(FP_CMO)
$(OCAMLC) lib.cma $^ -o $@
cat ../../pprz_src_test.sh > $@
echo '$(OCAML) -I $$PAPARAZZI_SRC/sw/lib/ocaml -I $$PAPARAZZI_SRC/sw/tools lib-pprz.cma $(ABS_FP) $$*' >> $@
chmod a+x $@
fp_parser.cmo : fp_parser.cmi fp_syntax.cmi
fp_parser.cmi : fp_parser.ml fp_syntax.cmi
@@ -18,7 +22,10 @@ fp_syntax.cmo : fp_syntax.cmi
%.out : %.ml
$(OCAMLC) lib.cma $< -o $@
$(OCAMLC) -o /dev/null lib-pprz.cma $< # To check
cat ../../pprz_src_test.sh > $@
echo '$(OCAML) -I $$PAPARAZZI_SRC/sw/lib/ocaml lib-pprz.cma $$PAPARAZZI_SRC/sw/tools/$< $$*' >> $@
chmod a+x $@
%.cmo : %.ml
$(OCAMLC) -c $<
+2
View File
@@ -10,6 +10,8 @@ let mkdir = fun d ->
Unix.mkdir d 0o755
let _ =
if Array.length Sys.argv <> 2 then
failwith (sprintf "Usage: %s <xml_airframe_file>" Sys.argv.(0));
let aircraft = Sys.argv.(1) in
let conf = Xml.parse_file conf_xml in
let aircraft_xml =
+3 -1
View File
@@ -358,12 +358,14 @@ let check_distance = fun (hx, hy) max_d wp ->
let _ =
let xml_file = ref "fligh_plan.xml"
let xml_file = ref ""
and dump = ref false in
Arg.parse [("-dump", Arg.Set dump, "Dump compile result");
("-nocheck", Arg.Clear check_expressions, "Disable expression checking")]
(fun f -> xml_file := f)
"Usage:";
if !xml_file = "" then
failwith (sprintf "Usage: %s <xml-flight-plan-file>" Sys.argv.(0));
try
let xml = Xml.parse_file !xml_file in
let dir = Filename.dirname !xml_file in
+1 -1
View File
@@ -239,7 +239,7 @@ end
let _ =
if Array.length Sys.argv <> 3 then begin
fprintf stderr "Usage: %s <.xml file> <class_name>" Sys.argv.(0)
failwith (sprintf "Usage: %s <.xml file> <class_name>" Sys.argv.(0))
end;
let filename = Sys.argv.(1) in
let class_name = Sys.argv.(2) in
+3
View File
@@ -100,6 +100,9 @@ let parse_class = fun c ->
let _ =
if Array.length Sys.argv <> 2 then begin
failwith (sprintf "Usage: %s <.xml ubx protocol file>" Sys.argv.(0))
end;
let xml_file = Sys.argv.(1) in
try
let xml = Xml.parse_file xml_file in