mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-23 04:45:37 +08:00
*** empty log message ***
This commit is contained in:
+1
-1
@@ -18,7 +18,7 @@
|
||||
<aircraft
|
||||
name="Thon1"
|
||||
airframe="airframes/twinstar1.xml"
|
||||
radio="radios/mc3030.xml"
|
||||
radio="radios/cockpitMM.xml"
|
||||
flight_plan="flight_plans/muret1.xml"
|
||||
/>
|
||||
|
||||
|
||||
+40
-27
@@ -144,40 +144,53 @@
|
||||
|
||||
<class name="telemetry_fbw" ID="0X41">
|
||||
|
||||
<message name="RC" ID="0x01" period="1">
|
||||
<message name="PPM" ID="0x01" period="1">
|
||||
<field name="nb_channels" type="uint8"/>
|
||||
<!--
|
||||
<block times="nb_channels">
|
||||
<field name="ppm" type="uint16" unit="us"/>
|
||||
</block>
|
||||
-->
|
||||
<field name="ppm01" type="uint16" unit="us"/>
|
||||
<field name="ppm02" type="uint16" unit="us"/>
|
||||
<field name="ppm03" type="uint16" unit="us"/>
|
||||
<field name="ppm04" type="uint16" unit="us"/>
|
||||
<field name="ppm05" type="uint16" unit="us"/>
|
||||
<field name="ppm06" type="uint16" unit="us"/>
|
||||
<field name="ppm07" type="uint16" unit="us"/>
|
||||
<field name="ppm08" type="uint16" unit="us"/>
|
||||
<field name="ppm09" type="uint16" unit="us"/>
|
||||
<field name="ppm10" type="uint16" unit="us"/>
|
||||
<field name="sync_len" type="uint8"/>
|
||||
<field name="ppm01" type="uint16" unit="us"/>
|
||||
<field name="ppm02" type="uint16" unit="us"/>
|
||||
<field name="ppm03" type="uint16" unit="us"/>
|
||||
<field name="ppm04" type="uint16" unit="us"/>
|
||||
<field name="ppm05" type="uint16" unit="us"/>
|
||||
<field name="ppm06" type="uint16" unit="us"/>
|
||||
<field name="ppm07" type="uint16" unit="us"/>
|
||||
<field name="ppm08" type="uint16" unit="us"/>
|
||||
<field name="ppm09" type="uint16" unit="us"/>
|
||||
<field name="ppm10" type="uint16" unit="us"/>
|
||||
<field name="ppm11" type="uint16" unit="us"/>
|
||||
<field name="ppm12" type="uint16" unit="us"/>
|
||||
</message>
|
||||
|
||||
<!--
|
||||
<message name="SERVOS" ID="0x02" period="1">
|
||||
<message name="RC" ID="0x02" period="1">
|
||||
<field name="nb_channels" type="uint8"/>
|
||||
<block times="nb_channels">
|
||||
<field name="ppm" type="uint16" unit="us"/>
|
||||
</block>
|
||||
<field name="pprz01" type="int16" unit="pprz"/>
|
||||
<field name="pprz02" type="int16" unit="pprz"/>
|
||||
<field name="pprz03" type="int16" unit="pprz"/>
|
||||
<field name="pprz04" type="int16" unit="pprz"/>
|
||||
<field name="pprz05" type="int16" unit="pprz"/>
|
||||
<field name="pprz06" type="int16" unit="pprz"/>
|
||||
<field name="pprz07" type="int16" unit="pprz"/>
|
||||
<field name="pprz08" type="int16" unit="pprz"/>
|
||||
<field name="pprz09" type="int16" unit="pprz"/>
|
||||
<field name="pprz10" type="int16" unit="pprz"/>
|
||||
<field name="pprz11" type="int16" unit="pprz"/>
|
||||
<field name="pprz12" type="int16" unit="pprz"/>
|
||||
</message>
|
||||
|
||||
<message name="PPRZ" ID="0x03" period="1">
|
||||
<field name="nb_channels" type="uint8"/>
|
||||
<block times="nb_channels">
|
||||
<field name="pprz" type="int16" unit="pprz"/>
|
||||
</block>
|
||||
<message name="SERVOS" ID="0x03" period="1">
|
||||
<field name="nb_servos" type="uint8"/>
|
||||
<field name="ser01" type="uint16" unit="us"/>
|
||||
<field name="ser02" type="uint16" unit="us"/>
|
||||
<field name="ser03" type="uint16" unit="us"/>
|
||||
<field name="ser04" type="uint16" unit="us"/>
|
||||
<field name="ser05" type="uint16" unit="us"/>
|
||||
<field name="ser06" type="uint16" unit="us"/>
|
||||
<field name="ser07" type="uint16" unit="us"/>
|
||||
<field name="ser08" type="uint16" unit="us"/>
|
||||
<field name="ser09" type="uint16" unit="us"/>
|
||||
<field name="ser10" type="uint16" unit="us"/>
|
||||
</message>
|
||||
-->
|
||||
|
||||
<message name="FBW_STATUS" ID="0x04" period="1">
|
||||
<field name="nb_spi_err" type="uint8"/>
|
||||
<field name="rc_status" type="uint8" values="OK|LOST|REALLY_LOST"/>
|
||||
|
||||
@@ -1,18 +1,9 @@
|
||||
<radio name="cockpitMM">
|
||||
<!--
|
||||
<photo filename="/home/poine/work/paparazzi_savannah/paparazzi2/sw/ground_segment/cockpit/images/cockpitMM.gif"/>
|
||||
<control name="left_stick" type="stick" x="88" y="95" size="40" v_axe="pitch" h_axe="yaw"/>
|
||||
<control name="right_stick" type="stick" x="267" y="95" size="40" v_axe="power" h_axe="roll"/>
|
||||
<control name="gain1" type="slider" x="179" y="114" size="40" axe="gain1" direction="vertical"/>
|
||||
<control name="mode" type="slider" x="285" y="53" size="30" axe="mode" direction="vertical"/>
|
||||
<control name="calib" type="slider" x="110" y="30" size="40" axe="calib" direction="horizontal"/>
|
||||
--!>
|
||||
|
||||
<channel ctl="D" function="ROLL" min="2000" neutral="1498" max="1000" average="0"/>
|
||||
<channel ctl="C" function="PITCH" min="2000" neutral="1498" max="1000" average="0"/>
|
||||
<channel ctl="B" function="YAW" min="2000" neutral="1498" max="1000" average="0"/>
|
||||
<channel ctl="A" function="THROTTLE" min="2000" neutral="1100" max="1100" average="0"/>
|
||||
<channel ctl="G" function="GAIN1" min="2000" neutral="1498" max="1000" average="10"/> <!-- center slider -->
|
||||
<channel ctl="E" function="MODE" min="2000" neutral="1500" max="1000" average="10"/> <!-- Top right switch -->
|
||||
<channel ctl="F" function="CALIB" min="2000" neutral="1500" max="1000" average="10"/> <!-- Top left rotary knob -->
|
||||
<channel ctl="D" function="ROLL" min="1990" neutral="1485" max="982" average="0"/>
|
||||
<channel ctl="C" function="PITCH" min="1993" neutral="1490" max="984" average="0"/>
|
||||
<channel ctl="B" function="YAW" min="1994" neutral="1490" max="986" average="0"/>
|
||||
<channel ctl="A" function="THROTTLE" min="1992" neutral="1114" max="1114" average="0"/>
|
||||
<channel ctl="G" function="GAIN1" min="1996" neutral="1485" max="988" average="10"/> <!-- center slider -->
|
||||
<channel ctl="E" function="MODE" min="1997" neutral="1492" max="988" average="10"/> <!-- Top right switch -->
|
||||
<channel ctl="F" function="CALIB" min="2000" neutral="1480" max="990" average="10"/> <!-- Top left rotary knob -->
|
||||
</radio>
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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*
|
||||
|
||||
@@ -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 _ _ -> ());
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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])";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user