mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-09 22:49:53 +08:00
compilation of a new plane now works from the system
This commit is contained in:
@@ -61,7 +61,7 @@ configurator: lib
|
||||
cd $(CONFIGURATOR); $(MAKE)
|
||||
|
||||
sim_static :
|
||||
cd $(SIMULATOR); $(MAKE)
|
||||
cd $(SIMULATOR); $(MAKE) PAPARAZZI_SRC=$(PAPARAZZI_SRC)
|
||||
|
||||
sim_sitl :
|
||||
cd $(SIMULATOR); $(MAKE) sim_sitl PAPARAZZI_HOME=$(PAPARAZZI_SRC) PAPARAZZI_SRC=$(PAPARAZZI_SRC) AIRCRAFT=$(AIRCRAFT)
|
||||
|
||||
@@ -41,11 +41,13 @@ $(MESSAGES_H) : $(MESSAGES_XML) $(CONF_XML)
|
||||
TMP_FILE=`mktemp`;\
|
||||
$(TOOLS)/gen_messages.out $< telemetry_ap > $$TMP_FILE;\
|
||||
mv $$TMP_FILE $@
|
||||
chmod a+r $@
|
||||
|
||||
$(FBW_MESSAGES_H) : $(MESSAGES_XML) $(CONF_XML)
|
||||
TMP_FILE=`mktemp`;\
|
||||
$(TOOLS)/gen_messages.out $< telemetry_fbw > $$TMP_FILE;\
|
||||
mv $$TMP_FILE $@
|
||||
chmod a+r $@
|
||||
|
||||
$(UBX_PROTOCOL_H) : $(UBX_XML) $(CONF_XML)
|
||||
$(TOOLS)/gen_ubx.out $< > /tmp/ubx.h
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
# Paparazzi main $Id$
|
||||
# Copyright (C) 2004 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.
|
||||
|
||||
PAPARAZZI_DIR=/usr/share/paparazzi
|
||||
ifeq ($(PAPARAZZI_HOME),)
|
||||
PAPARAZZI_HOME=$(HOME)/paparazzi
|
||||
endif
|
||||
|
||||
ac: ac_h sim_ac ap fbw
|
||||
|
||||
sim_ac : sim_sitl
|
||||
|
||||
ac_h :
|
||||
$(PAPARAZZI_DIR)/bin/gen_aircraft.out $(AIRCRAFT)
|
||||
|
||||
sim_sitl :
|
||||
cd $(PAPARAZZI_DIR)/sw/simulator; $(MAKE) sim_sitl AIRCRAFT=$(AIRCRAFT)
|
||||
|
||||
clean_ac :
|
||||
rm -fr $(PAPARAZZI_HOME)/var/$(AIRCRAFT)
|
||||
|
||||
run_sitl :
|
||||
$(PAPARAZZI_HOME)/var/$(AIRCRAFT)/sim/simsitl
|
||||
|
||||
ap:
|
||||
cd $(PAPARAZZI_DIR)/sw/airborne/autopilot; $(MAKE) all
|
||||
|
||||
fbw:
|
||||
cd $(PAPARAZZI_DIR)/sw/airborne/fly_by_wire; $(MAKE) all
|
||||
|
||||
upload_ap:
|
||||
cd $(PAPARAZZI_DIR)/sw/airborne/autopilot; $(MAKE) upload
|
||||
|
||||
upload_fbw:
|
||||
cd $(PAPARAZZI_DIR)/sw/airborne/fly_by_wire; $(MAKE) upload
|
||||
+11
-16
@@ -15,8 +15,8 @@
|
||||
<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_sim_downlink.out"/>
|
||||
<file name="sw/tools/gen_aircraft.out"/>
|
||||
<file name="sw/tools/gen_airframe.out"/>
|
||||
<file name="sw/tools/gen_calib.out"/>
|
||||
@@ -115,7 +115,8 @@
|
||||
</section>
|
||||
|
||||
<section name="main_makefiles" dest="share/paparazzi/">
|
||||
<file name="Makefile"/>
|
||||
<file name="Makefile.sys"/>
|
||||
<file name="pprz_src_test.sh"/>
|
||||
<file name="Makefile.gen"/>
|
||||
<file name="Makefile.ac"/>
|
||||
</section>
|
||||
@@ -141,6 +142,7 @@
|
||||
|
||||
<section name="sw_tools" dest="share/paparazzi/sw/tools" comment="ocaml objects">
|
||||
<file name="sw/tools/gen_aircraft.ml"/>
|
||||
<file name="sw/tools/gen_sim_downlink.ml"/>
|
||||
<file name="sw/tools/gen_airframe.ml"/>
|
||||
<file name="sw/tools/gen_calib.ml"/>
|
||||
<file name="sw/tools/gen_radio.ml"/>
|
||||
@@ -182,29 +184,16 @@
|
||||
|
||||
<section name="sw_simulator" dest="share/paparazzi/sw/simulator" comment="ocaml objects and C hooks for airborne code simulation">
|
||||
<file name="sw/simulator/Makefile"/>
|
||||
<file name="sw/simulator/data.ml"/>
|
||||
<file name="sw/simulator/events.ml"/>
|
||||
<file name="sw/simulator/flightModel.ml"/>
|
||||
<file name="sw/simulator/flightModel.mli"/>
|
||||
<file name="sw/simulator/flightModelHeli.ml.sav"/>
|
||||
<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.cmi"/>
|
||||
<file name="sw/simulator/sim_ap.c"/>
|
||||
<file name="sw/simulator/sim_gps.c"/>
|
||||
<file name="sw/simulator/sim_ir.c"/>
|
||||
<file name="sw/simulator/simhitl.ml"/>
|
||||
<file name="sw/simulator/simsitl.ml"/>
|
||||
<file name="sw/simulator/simsitl.pl"/>
|
||||
<file name="sw/simulator/sirf.ml"/>
|
||||
<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">
|
||||
@@ -267,7 +256,13 @@
|
||||
</section>
|
||||
|
||||
<section name="var_log" dest="share/paparazzi/var/logs">
|
||||
<!-- <file name="var/logs/04_12_29__15_11_08.log"/> -->
|
||||
<file name="var/logs/04_12_29__15_11_08.log"/>
|
||||
</section>
|
||||
|
||||
<section name="var_include" dest="share/paparazzi/var/include">
|
||||
<file name="var/include/fbw_messages.h"/>
|
||||
<file name="var/include/messages.h"/>
|
||||
<file name="var/include/ubx_protocol.h"/>
|
||||
</section>
|
||||
|
||||
<section name="var_Thon1_sim" dest="share/paparazzi/var/Thon1/sim">
|
||||
|
||||
@@ -82,11 +82,11 @@ warn_conf :
|
||||
@echo
|
||||
|
||||
|
||||
.depend : $(VARINCLUDE)/messages.h $(ACINCLUDE)/flight_plan.h $(VARINCLUDE)/ubx_protocol.h $(ACINCLUDE)/inflight_calib.h $(ACINCLUDE)/airframe.h $(ACINCLUDE)/radio.h
|
||||
main.o : $(VARINCLUDE)/messages.h
|
||||
nav.o : $(ACINCLUDE)/flight_plan.h
|
||||
gps_ubx.o : $(VARINCLUDE)/ubx_protocol.h
|
||||
if_calib.o : $(ACINCLUDE)/inflight_calib.h
|
||||
$(OBJDIR)/.depend : $(VARINCLUDE)/messages.h $(ACINCLUDE)/flight_plan.h $(VARINCLUDE)/ubx_protocol.h $(ACINCLUDE)/inflight_calib.h $(ACINCLUDE)/airframe.h $(ACINCLUDE)/radio.h
|
||||
$(OBJDIR)/main.o : $(VARINCLUDE)/messages.h
|
||||
$(OBJDIR)/nav.o : $(ACINCLUDE)/flight_plan.h
|
||||
$(OBJDIR)/gps_ubx.o : $(VARINCLUDE)/ubx_protocol.h
|
||||
$(OBJDIR)/if_calib.o : $(ACINCLUDE)/inflight_calib.h
|
||||
|
||||
clean : avr_clean
|
||||
rm -f *.out *.cm* messages.h flight_plan.h ubx_protocol.h inflight_calib.h
|
||||
|
||||
@@ -71,7 +71,7 @@ warn_conf :
|
||||
@echo
|
||||
|
||||
|
||||
main.o .depend : $(ACINCLUDE)/radio.h $(ACINCLUDE)/airframe.h
|
||||
$(OBJDIR)/main.o $(OBJDIR)/.depend : $(ACINCLUDE)/radio.h $(ACINCLUDE)/airframe.h
|
||||
|
||||
clean : avr_clean
|
||||
|
||||
|
||||
+11
-16
@@ -47,7 +47,7 @@ VARINCLUDE=$(PAPARAZZI_HOME)/var/include
|
||||
ACINCLUDE = $(PAPARAZZI_HOME)/var/$(AIRCRAFT)
|
||||
|
||||
MESSAGES = ../../conf/messages.xml
|
||||
GEN_DOWNLINK = ./gen_downlink
|
||||
GEN_DOWNLINK = $(TOOLS)/gen_sim_downlink.out
|
||||
|
||||
SIMDIR=$(shell echo `pwd`)
|
||||
|
||||
@@ -71,7 +71,7 @@ $(OBJDIR)/$(SIMSA) : $(SIMSO)
|
||||
touch $(OBJDIR)/dummy.ml
|
||||
cd $(OBJDIR); ocamlmklib -o sims $^ dummy.ml
|
||||
|
||||
$(OBJDIR)/simsitl : $(OBJDIR)/$(SIMSA) sitl.cma $(OBJDIR)/simsitl.ml
|
||||
$(OBJDIR)/simsitl : $(OBJDIR)/$(SIMSA) $(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 $$*' >> $@
|
||||
@@ -89,7 +89,7 @@ $(OBJDIR)/%.o : $(AP)/%.c
|
||||
$(OBJDIR)/main.o : $(OBJDIR)/main.c
|
||||
$(OCAMLCC) -c -o $@ -I $(SIMDIR) -I $(FBW) -I $(AP) -I ../include -I $(VARINCLUDE) $<
|
||||
|
||||
sim_gps.o nav.o main.o sim_ir.o sim_ap.o pid.o estimator.o : $(ACINCLUDE)/flight_plan.h $(ACINCLUDE)/airframe.h
|
||||
$(OBJDIR)/sim_gps.o $(OBJDIR)/nav.o $(OBJDIR)/main.o $(OBJDIR)/sim_ir.o $(OBJDIR)/sim_ap.o $(OBJDIR)/pid.o $(OBJDIR)/estimator.o : $(ACINCLUDE)/flight_plan.h $(ACINCLUDE)/airframe.h
|
||||
|
||||
$(OBJDIR)/main.c : $(OBJDIR)/downlink.h
|
||||
cp $(AP)/main.c $(@)
|
||||
@@ -97,12 +97,6 @@ $(OBJDIR)/main.c : $(OBJDIR)/downlink.h
|
||||
$(OBJDIR)/downlink.h : $(MESSAGES) $(GEN_DOWNLINK)
|
||||
$(GEN_DOWNLINK) $< > $@
|
||||
|
||||
$(GEN_DOWNLINK) : gen_downlink.ml
|
||||
$(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 $@ $<
|
||||
|
||||
@@ -123,11 +117,12 @@ $(OBJDIR)/simsitl.ml : simsitl.ml
|
||||
$(OCAMLC) $(INCLUDES) -c $<
|
||||
|
||||
clean :
|
||||
\rm -f *.cm* *~ *.out .depend *.o $(GEN_DOWNLINK)
|
||||
\rm -f *.cm* *~ *.out .depend *.o
|
||||
|
||||
.depend:
|
||||
ocamldep *.ml* > .depend
|
||||
|
||||
ifneq ($(MAKECMDGOALS),clean)
|
||||
-include .depend
|
||||
endif
|
||||
flightModel.cmo: flightModel.cmi
|
||||
hitl.cmo: hitl.cmi
|
||||
sim.cmo: flightModel.cmi sim.cmi
|
||||
simhitl.cmo: hitl.cmi sim.cmi
|
||||
simsitl.cmo: sim.cmi sitl.cmi
|
||||
sitl.cmo: sitl.cmi
|
||||
sitl.cmi: sim.cmi
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ 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
|
||||
all: gen_aircraft.out gen_airframe.out gen_calib.out gen_messages.out gen_ubx.out gen_flight_plan.out gen_radio.out gen_sim_downlink.out
|
||||
|
||||
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/%)
|
||||
|
||||
@@ -11,7 +11,7 @@ let mkdir = fun d ->
|
||||
|
||||
let _ =
|
||||
if Array.length Sys.argv <> 2 then
|
||||
failwith (sprintf "Usage: %s <xml_airframe_file>" Sys.argv.(0));
|
||||
failwith (sprintf "Usage: %s <A/C ident (conf.xml)>" Sys.argv.(0));
|
||||
let aircraft = Sys.argv.(1) in
|
||||
let conf = Xml.parse_file conf_xml in
|
||||
let aircraft_xml =
|
||||
|
||||
Reference in New Issue
Block a user