diff --git a/conf/conf.xml b/conf/conf.xml index 2f89ca9835..f1f790f319 100644 --- a/conf/conf.xml +++ b/conf/conf.xml @@ -18,7 +18,7 @@ diff --git a/conf/messages.xml b/conf/messages.xml index 163da6f73f..bc654b3a93 100644 --- a/conf/messages.xml +++ b/conf/messages.xml @@ -144,40 +144,53 @@ - + - - - - - - - - - - - + + + + + + + + + + + + + - + diff --git a/conf/radios/cockpitMM.xml b/conf/radios/cockpitMM.xml index e6d87992c3..ea56003e1b 100644 --- a/conf/radios/cockpitMM.xml +++ b/conf/radios/cockpitMM.xml @@ -1,18 +1,9 @@ - - - - - - - - - + + + + + + + diff --git a/sw/airborne/fly_by_wire/test/setup_servos.c b/sw/airborne/fly_by_wire/test/setup_servos.c index e8e55bf079..d93519e2e7 100644 --- a/sw/airborne/fly_by_wire/test/setup_servos.c +++ b/sw/airborne/fly_by_wire/test/setup_servos.c @@ -34,15 +34,15 @@ #define MSG_END '\n' #define UNINIT 0 -#define GOT_START 1 -#define GOT_CHANNEL 2 -#define GOT_LOW 3 -#define GOT_HI 4 +#define GOT_START 1 +#define GOT_CHANNEL 2 +#define GOT_LOW 3 +#define GOT_HI 4 static uint8_t msg_status; static uint8_t servo; -static uint16_t value; /* micro-seconds */ +static uint16_t value; /* microseconds */ static volatile bool_t msg_valid; static inline void parse_msg(uint8_t c) { diff --git a/sw/ground_segment/tmtc/Makefile b/sw/ground_segment/tmtc/Makefile index 70cb93011d..910d728f83 100644 --- a/sw/ground_segment/tmtc/Makefile +++ b/sw/ground_segment/tmtc/Makefile @@ -22,7 +22,7 @@ include ../../../conf/Makefile.local -all: receive messages +all: receive messages listen.opt clean: rm -f receive messages *.bak *~ core *.o .depend *.opt *.out *.cm* diff --git a/sw/ground_segment/tmtc/listen.ml b/sw/ground_segment/tmtc/listen.ml index 61d9c85b0c..33623eb243 100644 --- a/sw/ground_segment/tmtc/listen.ml +++ b/sw/ground_segment/tmtc/listen.ml @@ -32,12 +32,12 @@ let _ = let class_name = ref "telemetry_fbw" in let serial_dev = ref "/dev/ttyUSB0" in Arg.parse - [ "-b", Arg.String (fun x -> bus := x), "Bus\tDefault is 127.255.255.25:2010"; - "-c", Arg.String (fun x -> class_name := x), "class name"; - "-d", Arg.String (fun x -> serial_dev := x), "serial device"] + [ "-b", Arg.String (fun x -> bus := x), "Bus\tDefault is 127.255.255.25:2010"; + "-c", Arg.String (fun x -> class_name := x), "Message class name\tDefault is telemetry_fbw"; + "-d", Arg.String (fun x -> serial_dev := x), "Serial device\tDefault is /dev/ttyUSB0"] (fun x -> prerr_endline ("WARNING: don't do anything with ")) "Usage: "; - + let module Tele_Class = struct let name = !class_name end in let module Tele_Pprz = Pprz.Protocol(Tele_Class) in let module PprzTransport = Serial.Transport(Tele_Pprz) in @@ -63,7 +63,7 @@ let _ = let handle_pprz_message = fun (msg_id, values) -> let msg = Tele_Pprz.message_of_id msg_id in let s = String.concat " " (List.map snd values) in - Ivy.send (sprintf "%s %s" msg.Pprz.name s) in + Ivy.send (sprintf "1234.567 %s %s" msg.Pprz.name s) in listen_tty handle_pprz_message !serial_dev; Ivy.init "Paparazzi listen" "READY" (fun _ _ -> ()); diff --git a/sw/ground_segment/tmtc/messages.ml b/sw/ground_segment/tmtc/messages.ml index cfa238b85e..9d8e453216 100644 --- a/sw/ground_segment/tmtc/messages.ml +++ b/sw/ground_segment/tmtc/messages.ml @@ -56,7 +56,8 @@ let format = fun field -> open GMain let _ = let bus = ref "127.255.255.255:2010" in - let classes = ref ["telemetry_ap";"ground"] in +(* let classes = ref ["telemetry_ap";"ground"] in *) + let classes = ref [] in Arg.parse [ "-b", Arg.String (fun x -> bus := x), "Bus\tDefault is 127.255.255.25:2010"; "-c", Arg.String (fun x -> classes := x :: !classes), "class name"] diff --git a/sw/lib/ocaml/pprz.ml b/sw/lib/ocaml/pprz.ml index b60d664e2f..2495e679e9 100644 --- a/sw/lib/ocaml/pprz.ml +++ b/sw/lib/ocaml/pprz.ml @@ -119,8 +119,10 @@ let magic = fun x -> (Obj.magic x:('a,'b,'c) Pervasives.format) let format_field = fun buffer index (field:field) -> let format = field.fformat in match field._type with - "uint8" | "int8" -> sprintf (magic format) (Char.code buffer.[index]) - | "uint16" | "int16" -> sprintf (magic format) (Char.code buffer.[index] lsl 8 + Char.code buffer.[index+1]) + "uint8" -> sprintf (magic format) (Char.code buffer.[index]) + | "int8" -> sprintf (magic format) (if Char.code buffer.[index] <= 128 then Char.code buffer.[index] else Char.code buffer.[index] - 256) + | "uint16" -> sprintf (magic format) (Char.code buffer.[index] lsl 8 + Char.code buffer.[index+1]) + | "int16" -> sprintf (magic format) (if Char.code buffer.[index] lsl 8 + Char.code buffer.[index+1] <= 32768 then Char.code buffer.[index] lsl 8 + Char.code buffer.[index+1] else Char.code buffer.[index] lsl 8 + Char.code buffer.[index+1] - 65536) | "float" -> sprintf (magic format) (float_of_bytes buffer index) | "int32" | "uint32" -> sprintf (magic format) (int32_of_bytes buffer index) | _ -> failwith "format_field" diff --git a/sw/supervision/paparazzi.pl b/sw/supervision/paparazzi.pl index 0deb351ed6..2c3bb08d04 100755 --- a/sw/supervision/paparazzi.pl +++ b/sw/supervision/paparazzi.pl @@ -7,7 +7,7 @@ BEGIN { $ENV{PAPARAZZI_SRC}."/sw/lib/perl" : "/usr/lib/paparazzi/"; } use lib ($paparazzi_lib); -# use lib ($ENV{PAPARAZZI_SRC}."/sw/supervision"); +use lib ($ENV{PAPARAZZI_SRC}."/sw/supervision"); use Paparazzi::CpGui; @ISA = qw(Paparazzi::CpGui); diff --git a/sw/tools/gen_radio.ml b/sw/tools/gen_radio.ml index e296c13ffc..9af47429b6 100644 --- a/sw/tools/gen_radio.ml +++ b/sw/tools/gen_radio.ml @@ -80,7 +80,8 @@ let _ = define "RADIO_NEUTRALS_US" (sprint_float_array (List.map (fun x -> x.neutral) channels_params)); define "RADIO_MAXS_US" (sprint_float_array (List.map (fun x -> x.max) channels_params)); define "RADIO_AVERAGED" (sprint_float_array (List.map (fun x -> x.averaged) channels_params)); - + define "RADIO_NEUTRALS_PPM" (sprint_float_array (List.map (fun x -> string_of_int ((int_of_string x.neutral)*16)) channels_params)); + define "RADIO_TRAVEL_PPM" (sprint_float_array (List.map (fun x -> string_of_float (9600. *. 2. /. (float ((int_of_string x.max) - (int_of_string x.min))) /. 16.)) channels_params)); nl (); define "AveragedChannel(ch)" "(((int[])RADIO_AVERAGED)[ch])";