10 changes: 5 additions & 5 deletions sw/logalizer/play_core.ml
Expand Up @@ -24,8 +24,8 @@

open Printf

module Ground_Pprz = Pprz.Messages(struct let name = "ground" end)
module Tm_Pprz = Pprz.Messages(struct let name = "telemetry" end)
module Ground_Pprz = PprzLink.Messages(struct let name = "ground" end)
module Tm_Pprz = PprzLink.Messages(struct let name = "telemetry" end)

let (//) = Filename.concat
let replay_dir = Env.paparazzi_home // "var" // "replay"
Expand Down Expand Up @@ -83,7 +83,7 @@ let store_conf = fun conf acs ->
write_xml (replay_dir // "conf" // "conf.xml") orig_conf

let store_messages = fun protocol ->
write_xml (replay_dir // "conf" // "messages.xml") protocol
write_xml (replay_dir // "var" // "messages.xml") protocol

let time_of = fun (t, _, _) -> t

Expand Down Expand Up @@ -163,7 +163,7 @@ let run = fun serial_port log adj i0 speed no_gui ->
try
let msg_id, vs = Tm_Pprz.values_of_string m in
let payload = Tm_Pprz.payload_of_values msg_id (int_of_string ac) vs in
let buf = Pprz.Transport.packet payload in
let buf = Pprz_transport.Transport.packet payload in
Debug.call 'o' (fun f -> fprintf f "%s\n" (Debug.xprint buf));
fprintf channel "%s%!" buf
with
Expand Down Expand Up @@ -220,7 +220,7 @@ let init = fun () ->
end in

let world_update_time = fun _ vs ->
speed#set_value (Pprz.float_assoc "time_scale" vs)
speed#set_value (PprzLink.float_assoc "time_scale" vs)
in

ignore (Ground_Pprz.message_bind "WORLD_ENV" world_update_time);
Expand Down
20 changes: 10 additions & 10 deletions sw/logalizer/plotter.ml
Expand Up @@ -34,13 +34,13 @@ let set_float_value = fun (a:GData.adjustment) v ->
a#set_value v

let pprz_float = function
Pprz.Int i -> float i
| Pprz.Float f -> f
| Pprz.Int32 i -> Int32.to_float i
| Pprz.Int64 i -> Int64.to_float i
| Pprz.String s -> float_of_string s
| Pprz.Char c -> float_of_string (String.make 1 c)
| Pprz.Array _ -> 0.
PprzLink.Int i -> float i
| PprzLink.Float f -> f
| PprzLink.Int32 i -> Int32.to_float i
| PprzLink.Int64 i -> Int64.to_float i
| PprzLink.String s -> float_of_string s
| PprzLink.Char c -> float_of_string (String.make 1 c)
| PprzLink.Array _ -> 0.


let dnd_targets = [ { Gtk.target = "STRING"; flags = []; info = 0} ]
Expand Down Expand Up @@ -496,14 +496,14 @@ let rec plot_window = fun window ->
let cb = fun _sender values ->
let (field_name, index) = base_and_index field_descr in
let value =
match Pprz.assoc field_name values with
Pprz.Array array -> array.(index)
match PprzLink.assoc field_name values with
PprzLink.Array array -> array.(index)
| scalar -> scalar in
let float = pprz_float value in
let v = float *. a +. b in
plot#add_value name v in

let module P = Pprz.Messages (struct let name = class_name end) in
let module P = PprzLink.Messages (struct let name = class_name end) in
let binding =
if sender = "*" then
P.message_bind msg_name cb
Expand Down
48 changes: 24 additions & 24 deletions sw/logalizer/sd2log.ml
Expand Up @@ -31,10 +31,10 @@ let default_logs_path = var_path // "logs"
let conf_xml = Xml.parse_file (Env.paparazzi_home // "conf" // "conf.xml")


module Tm_Pprz = Pprz.Messages (struct let name = "telemetry" end)
module Dl_Pprz = Pprz.Messages (struct let name = "datalink" end)
module Tm_Pprz = PprzLink.Messages (struct let name = "telemetry" end)
module Dl_Pprz = PprzLink.Messages (struct let name = "datalink" end)

module Parser = Serial.Transport(Logpprz.Transport)
module Parser = Protocol.Transport(Pprzlog_transport.Transport)

let run_command = fun com ->
if Sys.command com <> 0 then begin
Expand All @@ -60,41 +60,41 @@ let log_xml = fun ac_id ->
make_element
"configuration"
[]
[expanded_conf; Pprz.messages_xml ()]
[expanded_conf; PprzLink.messages_xml ()]

(* AWFUL : modules should be replaced by objects in pprz.ml
... or/and "datalink" and "telemetry" classes should be merged *)
let values_of_payload = fun log_msg ->
match log_msg.Logpprz.source with
match log_msg.Pprzlog_transport.source with
0 -> Tm_Pprz.values_of_payload
| 1 -> Dl_Pprz.values_of_payload
| x -> failwith (sprintf "Unexpected source:%d in log msg" x)

let message_of_id = fun log_msg ->
match log_msg.Logpprz.source with
match log_msg.Pprzlog_transport.source with
0 -> Tm_Pprz.message_of_id
| 1 -> Dl_Pprz.message_of_id
| x -> failwith (sprintf "Unexpected source:%d in log msg" x)

let string_of_message = fun log_msg ->
match log_msg.Logpprz.source with
match log_msg.Pprzlog_transport.source with
0 -> Tm_Pprz.string_of_message
| 1 -> Dl_Pprz.string_of_message
| x -> failwith (sprintf "Unexpected source:%d in log msg" x)

let hex_of_array = function
| Pprz.Array array ->
| PprzLink.Array array ->
let n = Array.length array in
(* One integer -> 2 chars *)
let s = String.create (2*n) in
Array.iteri
(fun i dec ->
let hex = sprintf "%02x" (Pprz.int_of_value array.(i)) in
let hex = sprintf "%02x" (PprzLink.int_of_value array.(i)) in
String.blit hex 0 s (2*i) 2)
array;
s
| value ->
failwith (sprintf "Error: expecting array, found %s" (Pprz.string_of_value value))
failwith (sprintf "Error: expecting array, found %s" (PprzLink.string_of_value value))


let xml_parse_compressed_file = fun file ->
Expand Down Expand Up @@ -137,34 +137,34 @@ let convert_file = fun ?(output_dir=None) file ->

let use_payload = fun payload ->
try
let log_msg = Logpprz.parse payload in
if log_msg.Logpprz.source > 1 then
fprintf stderr "Invalid source (%d), skipping message\n" log_msg.Logpprz.source
let log_msg = Pprzlog_transport.parse payload in
if log_msg.Pprzlog_transport.source > 1 then
fprintf stderr "Invalid source (%d), skipping message\n" log_msg.Pprzlog_transport.source
else
let (msg_id, ac_id, vs) = values_of_payload log_msg log_msg.Logpprz.pprz_data in
let (msg_id, ac_id, vs) = values_of_payload log_msg log_msg.Pprzlog_transport.pprz_data in

if log_msg.Logpprz.source = 0 && !single_ac_id < 0 then
if log_msg.Pprzlog_transport.source = 0 && !single_ac_id < 0 then
single_ac_id := ac_id;

if ac_id <> !single_ac_id && log_msg.Logpprz.source = 0 then
if ac_id <> !single_ac_id && log_msg.Pprzlog_transport.source = 0 then
fprintf stderr "Discarding message with ac_id %d, previous one was %d\n%!" ac_id !single_ac_id
else
let msg_descr = message_of_id log_msg msg_id in
let timestamp = Int32.to_float log_msg.Logpprz.timestamp /. 1e4 in
let timestamp = Int32.to_float log_msg.Pprzlog_transport.timestamp /. 1e4 in
fprintf f_out "%.4f %d %s\n" timestamp ac_id (string_of_message log_msg msg_descr vs);

(** Looking for a date from a GPS message and a md5 from an ALIVE *)
if log_msg.Logpprz.source = 0 then
match msg_descr.Pprz.name with
if log_msg.Pprzlog_transport.source = 0 then
match msg_descr.PprzLink.name with
"GPS" when !start_unix_time = None
&& ( Pprz.int_assoc "mode" vs = 3
|| Pprz.int_assoc "week" vs > 0) ->
let itow = Pprz.int_assoc "itow" vs / 1000
and week = Pprz.int_assoc "week" vs in
&& ( PprzLink.int_assoc "mode" vs = 3
|| PprzLink.int_assoc "week" vs > 0) ->
let itow = PprzLink.int_assoc "itow" vs / 1000
and week = PprzLink.int_assoc "week" vs in
let unix_time = Latlong.unix_time_of_tow ~week itow in
start_unix_time := Some (unix_time -. timestamp)
| "ALIVE" when !md5 = "" ->
md5 := hex_of_array (Pprz.assoc "md5sum" vs)
md5 := hex_of_array (PprzLink.assoc "md5sum" vs)
| _ -> ()
with _ -> fprintf stderr "Parsing error, skipping message\n"
in
Expand Down
2 changes: 1 addition & 1 deletion sw/simulator/Makefile
Expand Up @@ -29,7 +29,7 @@ include ../Makefile.ocaml
OCAMLC += -g
INCLUDES =
PKG = -package glibivy,pprz
LINKPKG = $(PKG) -linkpkg -dllpath-pkg pprz
LINKPKG = $(PKG) -linkpkg -dllpath-pkg pprz,pprzlink

SIMML = stdlib.ml data.ml flightModel.ml gps.ml
SIMHML = $(SIMML) hitl.ml sim.ml
Expand Down
5 changes: 2 additions & 3 deletions sw/simulator/data.ml
Expand Up @@ -26,14 +26,13 @@ open Printf

let (//) = Filename.concat

(* let pprz_conf_path = Env.paparazzi_src // "conf" *)
let user_conf_path = Env.paparazzi_home // "conf"
let user_var_path = Env.paparazzi_home // "var"

let conf_xml = Xml.parse_file (user_conf_path // "conf.xml")

let messages_ap =
(* let xml = Xml.parse_file (pprz_conf_path // "messages.xml") in *)
let xml = Xml.parse_file (user_conf_path // "messages.xml") in
let xml = Xml.parse_file (user_var_path // "messages.xml") in
try
ExtXml.child xml ~select:(fun x -> Xml.attrib x "name" = "telemetry") "msg_class"
with
Expand Down
24 changes: 12 additions & 12 deletions sw/simulator/diffusion.ml
@@ -1,6 +1,6 @@
open Printf

module Ground_Pprz = Pprz.Messages(struct let name = "ground" end)
module Ground_Pprz = PprzLink.Messages(struct let name = "ground" end)
module LL = Latlong
open LL

Expand Down Expand Up @@ -72,10 +72,10 @@ let send_on_ivy = fun () ->
and ys = String.concat "," !ys
and vs = String.concat "," !vs in
Ground_Pprz.message_send my_id "PLUMES"
[ "ids", Pprz.String ids;
"lats", Pprz.String xs;
"longs", Pprz.String ys;
"values", Pprz.String vs ]
[ "ids", PprzLink.String ids;
"lats", PprzLink.String xs;
"longs", PprzLink.String ys;
"values", PprzLink.String vs ]

let debug = let i = ref 0 in fun () ->
incr i;
Expand All @@ -89,17 +89,17 @@ let detect_distance = 20.


let flight_param_msg = fun _sender vs ->
let lat = Pprz.float_assoc "lat" vs
and long = Pprz.float_assoc "long" vs in
let lat = PprzLink.float_assoc "lat" vs
and long = PprzLink.float_assoc "long" vs in
let utm_ac = utm_of WGS84 {LL.posn_lat=(Deg>>Rad)lat; posn_long=(Deg>>Rad)long} in
Hashtbl.iter (fun id plume ->
let utm_plume = {LL.utm_zone = plume.utm_zone; utm_x = plume.utm_x; utm_y = plume.utm_y } in
let d = utm_distance utm_ac utm_plume in
if d < detect_distance then begin
let ac_id = Pprz.string_assoc "ac_id" vs in
let ac_id = PprzLink.string_assoc "ac_id" vs in
for i = 0 to 2 do
Ground_Pprz.message_send my_id "DL_SETTING"
["ac_id", Pprz.String ac_id; "index", Pprz.Int i(***FIXME***); "value", Pprz.Float (float plume.value)]
["ac_id", PprzLink.String ac_id; "index", PprzLink.Int i(***FIXME***); "value", PprzLink.Float (float plume.value)]
done
end)
plumes
Expand All @@ -112,9 +112,9 @@ let safe_bind = fun msg cb ->
ignore (Ground_Pprz.message_bind msg safe_cb)

let gaia = fun time_scale _sender vs ->
time_scale#set_value (Pprz.float_assoc "time_scale" vs);
wind_x := (Pprz.float_assoc "wind_east" vs);
wind_y := (Pprz.float_assoc "wind_north" vs)
time_scale#set_value (PprzLink.float_assoc "time_scale" vs);
wind_x := (PprzLink.float_assoc "wind_east" vs);
wind_y := (PprzLink.float_assoc "wind_north" vs)


let _ =
Expand Down
10 changes: 5 additions & 5 deletions sw/simulator/flightModel.ml
Expand Up @@ -111,13 +111,13 @@ module Make(A:Data.MISSION) = struct
let cu = try ExtXml.attrib t "code_unit" with _ -> "" in
(* default value for code_unit is rad[/s] when unit is deg[/s] *)
try match (u, cu) with
("deg", "") -> Pprz.scale_of_units u "rad" (* implicit conversion to rad *)
| ("deg/s", "") -> Pprz.scale_of_units u "rad/s" (* implicit conversion to rad/s *)
("deg", "") -> PprzLink.scale_of_units u "rad" (* implicit conversion to rad *)
| ("deg/s", "") -> PprzLink.scale_of_units u "rad/s" (* implicit conversion to rad/s *)
| (_, "") -> failwith "Unit conversion error" (* code unit is not defined and no implicit conversion *)
| (_,_) -> Pprz.scale_of_units u cu (* try to convert *)
| (_,_) -> PprzLink.scale_of_units u cu (* try to convert *)
with
Pprz.Unit_conversion_error s -> prerr_endline (sprintf "Unit conversion error: %s" s); flush stderr; exit 1
| Pprz.Unknown_conversion (su, scu) -> prerr_endline (sprintf "Warning: unknown unit conversion: from %s to %s" su scu); flush stderr; failwith "Unknown unit conversion"
PprzLink.Unit_conversion_error s -> prerr_endline (sprintf "Unit conversion error: %s" s); flush stderr; exit 1
| PprzLink.Unknown_conversion (su, scu) -> prerr_endline (sprintf "Warning: unknown unit conversion: from %s to %s" su scu); flush stderr; failwith "Unknown unit conversion"
| _ -> failwith "Unit conversion error"

let code_value = fun section s ->
Expand Down
14 changes: 7 additions & 7 deletions sw/simulator/gaia.ml
Expand Up @@ -28,7 +28,7 @@ open Latlong
let my_id = "gaia"
let sending_period = 5000 (* ms *)

module Ground_Pprz = Pprz.Messages(struct let name = "ground" end)
module Ground_Pprz = PprzLink.Messages(struct let name = "ground" end)

let ivy_bus = ref Defivybus.default_ivy_bus
let time_scale = ref 1.
Expand Down Expand Up @@ -72,12 +72,12 @@ let _ =
and wind_north = -. wind_speed *. sin wind_dir_rad in
let wind_up = wind_up_adj#value in

[ "wind_east", Pprz.Float wind_east;
"wind_north", Pprz.Float wind_north;
"wind_up", Pprz.Float wind_up;
"ir_contrast", Pprz.Float infrared_contrast_adj#value;
"time_scale", Pprz.Float time_scale_adj#value;
"gps_availability", Pprz.Int (if gps_sa#active then 0 else 1)
[ "wind_east", PprzLink.Float wind_east;
"wind_north", PprzLink.Float wind_north;
"wind_up", PprzLink.Float wind_up;
"ir_contrast", PprzLink.Float infrared_contrast_adj#value;
"time_scale", PprzLink.Float time_scale_adj#value;
"gps_availability", PprzLink.Int (if gps_sa#active then 0 else 1)
] in
let world_send = fun () ->
Ground_Pprz.message_send my_id "WORLD_ENV" (world_values []) in
Expand Down
2 changes: 1 addition & 1 deletion sw/simulator/nps/nps_autopilot_rotorcraft.c
Expand Up @@ -39,7 +39,7 @@

#include "subsystems/abi.h"

#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"

// for datalink_time hack
Expand Down
2 changes: 1 addition & 1 deletion sw/simulator/nps/nps_ivy.c
Expand Up @@ -85,7 +85,7 @@ static void on_WORLD_ENV(IvyClientPtr app __attribute__((unused)),
}

#include "generated/settings.h"
#include "dl_protocol.h"
#include "pprzlink/dl_protocol.h"
#include "subsystems/datalink/downlink.h"
static void on_DL_SETTING(IvyClientPtr app __attribute__((unused)),
void *user_data __attribute__((unused)),
Expand Down
16 changes: 8 additions & 8 deletions sw/simulator/sim.ml
Expand Up @@ -26,7 +26,7 @@ open Printf
open Stdlib
open Latlong

module Ground_Pprz = Pprz.Messages(struct let name = "ground" end)
module Ground_Pprz = PprzLink.Messages(struct let name = "ground" end)

let float_attrib xml a = float_of_string (ExtXml.attrib xml a)

Expand Down Expand Up @@ -159,12 +159,12 @@ module Make(AircraftItl : AIRCRAFT_ITL) = struct
and gps_availability = ref 1 in

let world_update = fun _ vs ->
gps_availability := Pprz.int_assoc "gps_availability" vs;
wind_x := Pprz.float_assoc "wind_east" vs;
wind_y := Pprz.float_assoc "wind_north" vs;
wind_z := Pprz.float_assoc "wind_up" vs;
infrared_contrast := Pprz.float_assoc "ir_contrast" vs;
time_scale#set_value (Pprz.float_assoc "time_scale" vs)
gps_availability := PprzLink.int_assoc "gps_availability" vs;
wind_x := PprzLink.float_assoc "wind_east" vs;
wind_y := PprzLink.float_assoc "wind_north" vs;
wind_z := PprzLink.float_assoc "wind_up" vs;
infrared_contrast := PprzLink.float_assoc "ir_contrast" vs;
time_scale#set_value (PprzLink.float_assoc "time_scale" vs)
in

let ask_for_world_env = fun () ->
Expand All @@ -173,7 +173,7 @@ module Make(AircraftItl : AIRCRAFT_ITL) = struct

let gps_sol = compute_gps_state (x,y,z) (FlightModel.get_time !state) in

let float = fun f -> Pprz.Float f in
let float = fun f -> PprzLink.Float f in
let values = ["east", float x; "north", float y; "up", float z;
"lat", float ((Rad>>Deg)gps_sol.Gps.wgs84.posn_lat);
"long", float ((Rad>>Deg)gps_sol.Gps.wgs84.posn_long);
Expand Down
16 changes: 8 additions & 8 deletions sw/simulator/sitl.ml
Expand Up @@ -24,8 +24,8 @@

open Printf

module Ground_Pprz = Pprz.Messages(struct let name = "ground" end)
module Dl_Pprz = Pprz.Messages(struct let name = "datalink" end)
module Ground_Pprz = PprzLink.Messages(struct let name = "ground" end)
module Dl_Pprz = PprzLink.Messages(struct let name = "datalink" end)

let ground_id = 0 (* cf tmtc/link.ml *)

Expand Down Expand Up @@ -178,11 +178,11 @@ module Make (A:Data.MISSION) (FM: FlightModel.SIG) = struct
let set = fun () ->
let msg_id, _ = Dl_Pprz.message_of_name name in
let s = Dl_Pprz.payload_of_values msg_id ground_id vs in
set_message (Serial.string_of_payload s) in
let ac_id = Pprz.int_assoc "ac_id" vs in
set_message (Protocol.string_of_payload s) in
let ac_id = PprzLink.int_assoc "ac_id" vs in
match link_mode with
Pprz.Forwarded when ac_id = !my_id -> if dl_button#active then set ()
| Pprz.Broadcasted -> if dl_button#active then set ()
PprzLink.Forwarded when ac_id = !my_id -> if dl_button#active then set ()
| PprzLink.Broadcasted -> if dl_button#active then set ()
| _ -> ()

let message_bind = fun name link_mode ->
Expand All @@ -198,8 +198,8 @@ module Make (A:Data.MISSION) (FM: FlightModel.SIG) = struct
(* Forward or broacast messages according to "link" mode *)
Hashtbl.iter
(fun _m_id msg ->
match msg.Pprz.link with
Some x -> message_bind msg.Pprz.name x
match msg.PprzLink.link with
Some x -> message_bind msg.PprzLink.name x
| _ -> ())
Dl_Pprz.messages;;

Expand Down
2 changes: 1 addition & 1 deletion sw/supervision/Makefile
Expand Up @@ -39,7 +39,7 @@ endif

INCLUDES =
XPKG = -package pprz.xlib,$(LABLGTK2GNOMEUI)
XLINKPKG = $(XPKG) -linkpkg -dllpath-pkg pprz.xlib
XLINKPKG = $(XPKG) -linkpkg -dllpath-pkg pprz.xlib,pprzlink

PAPARAZZICENTERCMO = gtk_pc.cmo gtk_process.cmo pc_common.cmo pc_control_panel.cmo pc_aircraft.cmo paparazzicenter.cmo

Expand Down
2 changes: 1 addition & 1 deletion sw/tools/Makefile
Expand Up @@ -28,7 +28,7 @@ include ../Makefile.ocaml

INCLUDES =
PKG = -package pprz
LINKPKG = $(PKG) -linkpkg -dllpath-pkg pprz
LINKPKG = $(PKG) -linkpkg -dllpath-pkg pprz,pprzlink

all: find_free_msg_id.out mergelogs

Expand Down
4 changes: 2 additions & 2 deletions sw/tools/doxygen_gen/gen_messages_doc.py
Expand Up @@ -91,7 +91,7 @@ def read_messages_file(file):
usage = "Usage: %prog [options]" + "\n" + "Run %prog --help to list the options."
parser = OptionParser(usage)
parser.add_option("-f", "--file", dest="file",
help="messages file to read [default: PAPARAZZI_HOME/conf/messages.xml]", metavar="MESSAGES.XML")
help="messages file to read [default: PAPARAZZI_HOME/sw/ext/pprzlink/message_definitions/v1.0/messages.xml]", metavar="MESSAGES.XML")
parser.add_option("-o", "--outputdir", dest="output_dir",
help="write output to DIR [default: PAPARAZZI_HOME/doc/manual/generated]", metavar="DIR")
parser.add_option("-p", "--parents",
Expand All @@ -112,7 +112,7 @@ def read_messages_file(file):
if options.file:
messages_file = options.file
else:
messages_file = os.path.join(paparazzi_home, "conf/messages.xml")
messages_file = os.path.join(paparazzi_home, "sw/ext/pprzlink/message_definitions/v1.0/messages.xml")
if not os.path.isfile(messages_file):
print("Messages file " + messages_file + " not found.")
sys.exit(1)
Expand Down
2 changes: 1 addition & 1 deletion sw/tools/find_free_msg_id.ml
Expand Up @@ -32,7 +32,7 @@
(** FIXME: Get file names with Arg.parse *)

let (//) = Filename.concat
let messages_xml = Env.paparazzi_home // "conf" // "messages.xml"
let messages_xml = Env.paparazzi_home // "var" // "messages.xml"

let nb_msg = 255

Expand Down
4 changes: 2 additions & 2 deletions sw/tools/generators/Makefile
Expand Up @@ -26,9 +26,9 @@ include ../../Makefile.ocaml

INCLUDES =
PKG = -package pprz
LINKPKG = $(PKG) -linkpkg -dllpath-pkg pprz
LINKPKG = $(PKG) -linkpkg -dllpath-pkg pprz,pprzlink

all: gen_aircraft.out gen_airframe.out gen_messages.out gen_ubx.out gen_mtk.out gen_flight_plan.out gen_radio.out gen_periodic.out gen_settings.out gen_xsens.out gen_modules.out gen_autopilot.out gen_abi.out gen_srtm.out
all: gen_aircraft.out gen_airframe.out gen_ubx.out gen_mtk.out gen_flight_plan.out gen_radio.out gen_periodic.out gen_settings.out gen_xsens.out gen_modules.out gen_autopilot.out gen_abi.out gen_srtm.out

gen_flight_plan.out : gen_flight_plan.cmo $(LIBPPRZCMA)
@echo OL $@
Expand Down
2 changes: 1 addition & 1 deletion sw/tools/generators/gen_aircraft.ml
Expand Up @@ -337,7 +337,7 @@ let () =
let configuration =
make_element
"configuration" []
[ make_element "conf" [] [conf_aircraft]; Pprz.messages_xml () ] in
[ make_element "conf" [] [conf_aircraft]; PprzLink.messages_xml () ] in
let conf_aircraft_file = aircraft_conf_dir // "conf_aircraft.xml" in
let f = open_out conf_aircraft_file in
Printf.fprintf f "%s\n" (ExtXml.to_string_fmt configuration);
Expand Down
8 changes: 4 additions & 4 deletions sw/tools/generators/gen_airframe.ml
Expand Up @@ -86,14 +86,14 @@ let convert_value_with_code_unit_coef_of_xml = function xml ->
(* if unit equals code unit, don't convert as that would always result in a float *)
if u = cu then failwith "Not converting";
(* default value for code_unit is rad[/s] when unit is deg[/s] *)
let conv = try Pprz.scale_of_units u cu with
| Pprz.Unit_conversion_error s ->
let conv = try PprzLink.scale_of_units u cu with
| PprzLink.Unit_conversion_error s ->
eprintf "Unit conversion error: %s\n%!" s;
exit 1
| Pprz.Unknown_conversion (su, scu) ->
| PprzLink.Unknown_conversion (su, scu) ->
eprintf "Warning: unknown unit conversion: from %s to %s\n%!" su scu;
failwith "Unknown unit conversion"
| Pprz.No_automatic_conversion _ | _ -> failwith "Unit conversion error" in
| PprzLink.No_automatic_conversion _ | _ -> failwith "Unit conversion error" in
let v =
try ExtXml.float_attrib xml "value"
with _ -> prerr_endline (sprintf "Error: Unit conversion of parameter %s impossible because '%s' is not a float" (Xml.attrib xml "name") (Xml.attrib xml "value")); flush stderr; exit 1 in
Expand Down
396 changes: 0 additions & 396 deletions sw/tools/generators/gen_messages.ml

This file was deleted.

2 changes: 1 addition & 1 deletion sw/tools/generators/gen_modules.ml
Expand Up @@ -261,7 +261,7 @@ let print_event_functions = fun modules ->
lprintf out_h "}\n"

let print_datalink_functions = fun modules ->
lprintf out_h "\n#include \"messages.h\"\n";
lprintf out_h "\n#include \"pprzlink/messages.h\"\n";
lprintf out_h "#include \"generated/airframe.h\"\n";
lprintf out_h "static inline void modules_parse_datalink(uint8_t msg_id __attribute__ ((unused))) {\n";
right ();
Expand Down
2 changes: 1 addition & 1 deletion sw/tools/generators/gen_ubx.ml
Expand Up @@ -159,7 +159,7 @@ let _ =
fprintf out "/* Generated by gen_ubx from %s */\n" xml_file;
fprintf out "/* Please DO NOT EDIT */\n\n";

fprintf out "#include \"mcu_periph/link_device.h\"\n\n";
fprintf out "#include \"pprzlink/pprzlink_device.h\"\n\n";
fprintf out "#include \"subsystems/gps/gps_ubx.h\"\n\n";

define "UBX_SYNC1" "0xB5";
Expand Down
2 changes: 1 addition & 1 deletion sw/tools/tcp_aircraft_server/tcp_aircraft_server.py
Expand Up @@ -38,7 +38,7 @@ def __init__(self, bus, tcp_port=4242):
print("server listening on {:d}".format(tcp_port))

self.transp = phoenix.pprz_transport.Transport(check_crc=False, debug=False)
self.protocol = phoenix.messages.Protocol(path=path.join(home_dir, "conf/messages.xml"), debug=True)
self.protocol = phoenix.messages.Protocol(path=path.join(home_dir, "var/messages.xml"), debug=True)
self.start(bus)

GObject.timeout_add(500, self.periodic, priority=GObject.PRIORITY_HIGH)
Expand Down