diff --git a/Makefile b/Makefile index b1e524125d..b4413008a2 100644 --- a/Makefile +++ b/Makefile @@ -174,8 +174,7 @@ install : make -f conf/Makefile.install PREFIX=$(PREFIX) uninstall : - ./Makefile.pl -uninstall -destdir $(DESTDIR) - + make -f conf/Makefile.install PREFIX=$(PREFIX) uninstall DISTRO=etch deb : diff --git a/Makefile.ac b/Makefile.ac index 08371f8a04..16fd4efb51 100644 --- a/Makefile.ac +++ b/Makefile.ac @@ -28,8 +28,6 @@ CONF_XML=$(CONF)/conf.xml MESSAGES_XML = $(CONF)/messages.xml ACINCLUDE = $(PAPARAZZI_HOME)/var/$(AIRCRAFT) AIRFRAME_H=$(ACINCLUDE)/airframe.h -CONTROL_H=$(ACINCLUDE)/control.h -CONTROL_C=$(ACINCLUDE)/ap/control.c PERIODIC_H=$(ACINCLUDE)/periodic.h RADIO_H=$(ACINCLUDE)/radio.h FLIGHT_PLAN_H=$(ACINCLUDE)/flight_plan.h @@ -40,7 +38,7 @@ MAKEFILE_AC=$(ACINCLUDE)/Makefile.ac # "make Q=''" to get full echo Q=@ -all: $(AIRFRAME_H) $(RADIO_H) $(CONTROL_H) $(CONTROL_C) $(FLIGHT_PLAN_H) $(FLIGHT_PLAN_XML) $(SETTINGS_H) $(MAKEFILE_AC) $(PERIODIC_H) +all: $(AIRFRAME_H) $(RADIO_H) $(FLIGHT_PLAN_H) $(FLIGHT_PLAN_XML) $(SETTINGS_H) $(MAKEFILE_AC) $(PERIODIC_H) $(AIRFRAME_H) : $(CONF)/$(AIRFRAME) $(CONF_XML) @echo BUILD $@ @@ -57,17 +55,6 @@ $(PERIODIC_H) : $(MESSAGES_XML) $(CONF_XML) $(CONF)/$(TELEMETRY) $(Q)$(TOOLS)/gen_periodic.out $(MESSAGES_XML) $(CONF)/$(TELEMETRY) > $@ $(Q)chmod a+r $@ -$(CONTROL_H) : $(CONF)/$(AIRFRAME) $(CONF_XML) - @echo BUILD $@ - $(Q)$(TOOLS)/gen_control.out h $< > $@ - $(Q)chmod a+r $@ - -$(CONTROL_C) : $(CONF)/$(AIRFRAME) $(CONF_XML) - @echo BUILD $@ - $(Q)mkdir -p $(ACINCLUDE)/ap - $(Q)$(TOOLS)/gen_control.out c $< > $@ - $(Q)chmod a+r $@ - $(FLIGHT_PLAN_H) : $(CONF)/$(FLIGHT_PLAN) $(CONF_XML) $(TOOLS)/gen_flight_plan.out @echo BUILD $@ $(Q)$(TOOLS)/gen_flight_plan.out $< > $@ diff --git a/conf/Makefile.install b/conf/Makefile.install index 10ce801b38..28d874295f 100644 --- a/conf/Makefile.install +++ b/conf/Makefile.install @@ -2,10 +2,11 @@ PREFIX=/usr DESTDIR=$(PREFIX)/share/paparazzi -install: install_data install_conf install_libs install_bin install_demo install_tools install_airborne_sources +install: install_demo install_data install_conf install_bin install_libs install_tools install_airborne_sources install_demo: + install -d $(DESTDIR)/var cp -a var/Twin1 $(DESTDIR)/var cp -a var/Twin2 $(DESTDIR)/var cp -a var/Twin3 $(DESTDIR)/var @@ -41,49 +42,47 @@ install_bin: install -d $(PREFIX)/bin/ install sw/supervision/paparazzi.pl $(PREFIX)/bin/paparazzi install -d $(DESTDIR)/bin/ - install sw/ground_segment/cockpit/map2d $(DESTDIR)/bin/ install sw/simulator/gaia $(DESTDIR)/bin/ install sw/simulator/simsitl.pl $(DESTDIR)/bin/ - install sw/ground_segment/cockpit/cockpit.pl $(DESTDIR)/bin/ + install sw/ground_segment/cockpit/gcs $(DESTDIR)/bin/ install sw/ground_segment/tmtc/server $(DESTDIR)/bin/ + install sw/ground_segment/tmtc/link $(DESTDIR)/bin/ + install sw/ground_segment/tmtc/messages $(DESTDIR)/bin/ + install sw/logalizer/play $(DESTDIR)/bin/ + install sw/logalizer/plot.pl $(DESTDIR)/bin/ install_libs: install -d $(PREFIX)/lib/perl5/Paparazzi install sw/lib/perl/Paparazzi/*.pm $(PREFIX)/lib/perl5/Paparazzi install sw/supervision/Paparazzi/*.pm $(PREFIX)/lib/perl5/Paparazzi - install sw/ground_segment/cockpit/Paparazzi/*.pm $(PREFIX)/lib/perl5/Paparazzi install -d $(DESTDIR)/sw/lib/ocaml install -t $(DESTDIR)/sw/lib/ocaml sw/lib/ocaml/*.cma install -t $(DESTDIR)/sw/lib/ocaml sw/lib/ocaml/*.so install -t $(DESTDIR)/sw/lib/ocaml sw/lib/ocaml/*.a install -t $(DESTDIR)/sw/lib/ocaml sw/lib/ocaml/*.cmi - install -d $(DESTDIR)/sw/tools/ - install sw/tools/gen_aircraft.ml -t $(DESTDIR)/sw/tools - install_tools: install -t $(DESTDIR) Makefile* + install -d $(DESTDIR)/sw/tools/ install -t $(DESTDIR)/conf conf/Makefile* install -t $(DESTDIR)/bin/ sw/tools/*.out install -t $(DESTDIR)/bin/ sw/tools/extract_makefile.ml install -t $(DESTDIR)/bin/ sw/tools/gen_aircraft.ml install -t $(DESTDIR)/bin/ sw/tools/gen_airframe.ml - install -t $(DESTDIR)/bin/ sw/tools/gen_calib.ml - install -t $(DESTDIR)/bin/ sw/tools/gen_control.ml install -t $(DESTDIR)/bin/ sw/tools/gen_flight_plan.ml install -t $(DESTDIR)/bin/ sw/tools/gen_messages.ml install -t $(DESTDIR)/bin/ sw/tools/gen_periodic.ml install -t $(DESTDIR)/bin/ sw/tools/gen_radio.ml + install -t $(DESTDIR)/bin/ sw/tools/gen_settings.ml install -t $(DESTDIR)/bin/ sw/tools/gen_ubx.ml install -d $(DESTDIR)/sw/simulator install -t $(DESTDIR)/sw/simulator sw/simulator/Makefile install_airborne_sources: - install -d $(PREFIX)/sw/ + install -d $(DESTDIR)/sw/ cp -a sw/airborne $(DESTDIR)/sw install_skel: - cp -a conf $(DESTDIR)/ - cp -a data $(DESTDIR)/ - install -d $(DESTDIR)/var - cp -a var/Twin3 $(DESTDIR)/var/ +# cp -a conf $(DESTDIR)/ +# cp -a data $(DESTDIR)/ +# install -d $(DESTDIR)/var diff --git a/debian/changelog.etch b/debian/changelog.etch index 7f37d4ab7a..2c44efb4ba 100644 --- a/debian/changelog.etch +++ b/debian/changelog.etch @@ -1,3 +1,9 @@ +paparazzi (3.1-rc1) unstable; urgency=low + + * Introduction of binary package. + + -- Antoine Drouin Fri, 04 Aug 2006 12:21:28 +0100 + paparazzi (2.99-1) unstable; urgency=low * Initial Release. diff --git a/debian/control.etch b/debian/control.etch index 795cdd9c35..3e72b656ea 100644 --- a/debian/control.etch +++ b/debian/control.etch @@ -10,7 +10,7 @@ Package: paparazzi-base Architecture: any Suggests: mlview, lustre, paparazzi-avr, paparazzi-arm Recommends: eagle, cvs, gs-common, tetex-extra, dia-gnome -Depends: ivy-c-dev, ivy-c, ivy-perl, libsubject-perl, ivy-ocaml, xml-light-ocaml, libxml-dom-perl, libpcre3-dev, liblablgtk2-ocaml-dev, libexpect-perl, libgnomecanvas2-dev, libcamlimages-ocaml-dev, libfile-ncopy-perl, libtext-csv-perl, make, gcc, patch, gnuplot, bzip2, liblablgtk2-gnome-ocaml-dev, boa +Depends: ivy-c-dev, ivy-c, ivy-perl, libsubject-perl, ivy-ocaml, xml-light-ocaml, libxml-dom-perl, libpcre3-dev, libexpect-perl, libgnomecanvas2-dev, libcamlimages-ocaml-dev, libfile-ncopy-perl, libtext-csv-perl, make, gcc, patch, gnuplot, bzip2, boa, liblablgtk2-ocaml-dev, liblablgtk2-gl-ocaml-dev, liblablgtk2-gnome-ocaml-dev Description: Paparazzi Meta Package : common support diff --git a/sw/tools/Makefile b/sw/tools/Makefile index 02c958435e..3163671cfd 100644 --- a/sw/tools/Makefile +++ b/sw/tools/Makefile @@ -27,7 +27,7 @@ OCAMLC=ocamlc -I ../lib/ocaml -I +xml-light OCAMLLEX=ocamllex OCAMLYACC=ocamlyacc -all: gen_aircraft.out gen_airframe.out gen_messages.out gen_ubx.out gen_flight_plan.out gen_radio.out extract_makefile.out gen_control.out gen_periodic.out gen_settings.out +all: gen_aircraft.out gen_airframe.out gen_messages.out gen_ubx.out gen_flight_plan.out gen_radio.out extract_makefile.out gen_periodic.out gen_settings.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/%) diff --git a/sw/tools/gen_control.ml b/sw/tools/gen_control.ml deleted file mode 100644 index 0e2733bc8b..0000000000 --- a/sw/tools/gen_control.ml +++ /dev/null @@ -1,220 +0,0 @@ -(* - * $Id$ - * - * XML preprocessing for airframe parameters - * - * Copyright (C) 2006 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. - * - *) - -open Printf -open Xml2h - -let fos = float_of_string - - -type loop_type = P | PI | PD | PID -let loop_type_of_string = fun s -> - match s with - "P" -> P - | "PI" -> PI - | "PD" -> PD - | "PID" -> PID - | s -> invalid_arg (sprintf "loop_type: %s" s) -let is_i = function (PI | PID) -> true | _ -> false -let is_d = function (PD | PID) -> true | _ -> false -let is_p = fun lt -> lt = P -let is_pd = fun lt -> lt = PD -let is_pid = fun lt -> lt = PID - -type loop = { - name : string; - loop_type : loop_type; - pgain : float; - dgain : float; - igain : float; - isat : string; - data_type : string; - measure : string; - setpoint : string; - output : string; - osat : string; - } - -type mode = C | H - -let mode_of_string = function - "c" -> C - | "h" -> H - | s -> invalid_arg (sprintf "mode_of_string: %s" s) - -let print_mode_inputs = fun s -> - match Xml.tag s with - "input" -> - let input = ExtXml.attrib s "input" - and output = ExtXml.attrib s "output" - and range = ExtXml.attrib s "range" in - printf " %s = %s * %s;\n" output input range - | _ -> () - -let print_mode_loops = fun s -> - match Xml.tag s with - "run" -> - let name = ExtXml.attrib s "name" in - printf " control_run_%s_loops();\n" name - | _ -> () - -let parse_loop = fun s list -> - match Xml.tag s with - "loop" -> - let na = ExtXml.attrib s "name" - and lt = loop_type_of_string (ExtXml.attrib s "loop_type") - and pg = fos (ExtXml.attrib s "pgain") - and dg = fos (ExtXml.attrib_or_default s "dgain" "0") - and ig = fos (ExtXml.attrib_or_default s "igain" "0") - and is = ExtXml.attrib_or_default s "integral_saturation" "0" - and dt = ExtXml.attrib s "data_type" - and mea = ExtXml.attrib s "measure" - and sp = ExtXml.attrib s "setpoint" - and op = ExtXml.attrib s "output" - and os = ExtXml.attrib s "saturation" in - let param = {name = na; loop_type = lt; - pgain = pg; dgain = dg; igain = ig; isat = is; - data_type = dt; measure = mea; setpoint = sp; output = op; osat = os} in - param::list - | _ -> list - - -let declare = fun mode _type name value -> - match mode with - H -> - printf "extern %s %s;\n" _type name - | C -> - printf "%s %s = %s;\n" _type name value - - -let print_loop_declaration = fun mode lp -> - declare mode lp.data_type ("control_"^lp.name^"_setpoint") "0"; - declare mode "float" ("control_"^lp.name^"_pgain") (string_of_float lp.pgain); - if is_d lp.loop_type then - begin - declare mode lp.data_type ("control_"^lp.name^"_last_err") "0"; - declare mode "float" ("control_"^lp.name^"_dgain") (string_of_float lp.dgain); - end; - if is_i lp.loop_type then - begin - declare mode lp.data_type ("control_"^lp.name^"_sum_err") "0"; - declare mode "float" ("control_"^lp.name^"_igain") (string_of_float lp.igain); - end; - nl() - -let print_loop_code = fun _mode lp -> - printf " {\n"; - printf " %s err = %s - %s;\n" lp.data_type lp.measure lp.setpoint; - if is_d lp.loop_type then - begin - printf " %s d_err = err - control_%s_last_err;\n" lp.data_type lp.name; - printf " control_%s_last_err = err;\n" lp.name - end; - if is_i lp.loop_type then - printf " control_%s_sum_err += err;\n" lp.name; - if is_p lp.loop_type then - printf " %s = ChopAbs(%f * err, %s);\n" lp.output lp.pgain lp.osat; - if is_pd lp.loop_type then - printf " %s = ChopAbs(%f * (err + %f * d_err), %s);\n" lp.output lp.pgain lp.dgain lp.osat; - if is_pid lp.loop_type then - printf " %s = ChopAbs(%f * (err + %f * d_err + %f * control_%s_sum_err), %s);\n" lp.output lp.pgain lp.dgain lp.igain lp.name lp.osat; - printf " }\n" - -let parse_control = fun mode s -> - match Xml.tag s with - "level" -> - let loops_params = List.fold_right parse_loop (Xml.children s) [] in - List.iter (print_loop_declaration mode) loops_params; - begin - match mode with - H -> - nl(); - let level_name = ExtXml.attrib s "name" in - printf "static inline void control_run_%s_loops ( void ) {\n" level_name; - List.iter (print_loop_code mode) loops_params; - printf "}\n" - | C -> () - end; - nl() - | "mode" -> - begin - match mode with - H -> - let mode_name = ExtXml.attrib s "name" in - printf "static inline void control_process_radio_control_%s ( void ) {\n" mode_name; - List.iter print_mode_inputs (Xml.children s); - printf "}\n"; - nl(); - printf "static inline void control_run_%s ( void ) {\n" mode_name; - List.iter print_mode_loops (Xml.children s); - printf "}\n"; - nl() - | C -> () - end - | t -> failwith (sprintf "Unexpected tag: %s" t) - -let parse_section = fun mode s -> - match Xml.tag s with - "control" -> - List.iter (parse_control mode) (Xml.children s) - | _ -> () - - -let h_name = "CONTROL_H" -let c_name = "control" - -let _ = - if Array.length Sys.argv <> 3 then - failwith (Printf.sprintf "Usage: %s [c/h] xml_file" Sys.argv.(0)); - let xml_file = Sys.argv.(2) in - let mode = mode_of_string Sys.argv.(1) in - try - begin - match mode with - H -> - let xml = start_and_begin xml_file h_name in - printf "#include \"std.h\"\n"; - printf "#ifdef ESTIMATOR\n"; - printf "#include ESTIMATOR\n"; - printf "#else\n"; - printf "#warning \"-DCONTROL requires an ESTIMATOR\"\n"; - printf "#endif\n"; - printf "#include \"airframe.h\"\n"; - printf "#include \"radio_control.h\"\n"; - printf "#include \"paparazzi.h\"\n"; - nl(); - declare mode "pprz_t" "control_commands[COMMANDS_NB]" ""; - nl(); - List.iter (parse_section mode) (Xml.children xml); - finish h_name - | C -> - let xml = start_and_begin_c xml_file c_name in - declare mode "pprz_t" "control_commands[COMMANDS_NB]" "COMMANDS_FAILSAFE"; - List.iter (parse_section mode) (Xml.children xml); - end - with - Xml.Error e -> prerr_endline (Xml.error e) -