mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-26 16:30:07 +08:00
*** empty log message ***
This commit is contained in:
@@ -11,6 +11,12 @@
|
||||
<setting VAR="pitch_of_vz" RANGE=".1" RC="gain_1_up" TYPE="float"/>
|
||||
</mode>
|
||||
</rc_control>
|
||||
|
||||
<dl_settings>
|
||||
<dl_setting var="ir_roll_neutral" min="-0.2" max="0.2" step="0.01"/>
|
||||
<dl_setting var="course_pgain" min="-1" max="-0.1" step="0.05"/>
|
||||
</dl_settings>
|
||||
|
||||
<waypoints utm_x0="360284.8" utm_y0="4813595.5">
|
||||
<waypoint name="HOME" x="0.0" y="120.0" alt="250."/>
|
||||
</waypoints>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#ifndef TI_H
|
||||
#define TI_H
|
||||
|
||||
#define NB_ACS 4
|
||||
#define NB_ACS 8
|
||||
|
||||
struct ac_info_ {
|
||||
float east; /* m */
|
||||
|
||||
@@ -713,8 +713,8 @@ let button_press = fun (geomap:G.widget) ev ->
|
||||
Ground_Pprz.message_send "map2d" "SEND_EVENT"
|
||||
["ac_id", Pprz.String ac; "event_id", Pprz.Int e]
|
||||
|
||||
let dl_settings = fun ac_id xml ->
|
||||
let window = GWindow.window ~title:("Datalink settings ") () in
|
||||
let dl_settings = fun ac_id ac_name xml ->
|
||||
let window = GWindow.window ~title:(sprintf "Datalink settings %s" ac_name) () in
|
||||
let quit = fun () -> GMain.Main.quit (); exit 0 in
|
||||
ignore (window#connect#destroy ~callback:quit);
|
||||
let vbox = GPack.vbox ~packing:window#add () in
|
||||
@@ -734,13 +734,22 @@ let button_press = fun (geomap:G.widget) ev ->
|
||||
let value = (lower +. upper) /. 2. in
|
||||
let text = ExtXml.attrib s "var" in
|
||||
let adj = GData.adjustment ~value ~lower ~upper:(upper+.10.) ~step_incr () in
|
||||
let hbox = GPack.hbox ~width:400 ~packing:vbox#add () in
|
||||
let hbox = GPack.hbox ~width:500 ~packing:vbox#add () in
|
||||
let _l = GMisc.label ~width:100 ~text ~packing:hbox#pack () in
|
||||
let _v = GMisc.label ~width:50 ~text:"N/A" ~packing:hbox#pack () in
|
||||
let _scale = GRange.scale `HORIZONTAL ~digits:2 ~adjustment:adj ~packing:hbox#add () in
|
||||
let ii = !i in
|
||||
let b = GButton.button ~label:"Update" ~stock:`REFRESH ~packing:hbox#pack () in
|
||||
(*** let b = GButton.button ~label:"Update" ~stock:`REFRESH ~packing:hbox#pack () in
|
||||
let update = fun () -> adj#set_value current_values.(ii) in
|
||||
ignore (b#connect#clicked ~callback:update);
|
||||
ignore (b#connect#clicked ~callback:update); ***)
|
||||
|
||||
let update_current_value = fun _ ->
|
||||
let s = string_of_float current_values.(ii) in
|
||||
if _v#text <> s then
|
||||
_v#set_text s;
|
||||
true in
|
||||
|
||||
ignore (Glib.Timeout.add 500 update_current_value);
|
||||
|
||||
let callback = fun () ->
|
||||
let vs = ["ac_id", Pprz.String ac_id; "index", Pprz.Int ii;"value", Pprz.Float adj#value] in
|
||||
@@ -835,7 +844,7 @@ let create_ac = fun (geomap:G.widget) ac_id config ->
|
||||
|
||||
let fp_xml = ExtXml.child fp_xml_dump "flight_plan" in
|
||||
|
||||
let ds_window, ds_adjs = dl_settings ac_id fp_xml in
|
||||
let ds_window, ds_adjs = dl_settings ac_id name fp_xml in
|
||||
|
||||
let fp = load_mission color geomap fp_xml in
|
||||
fp#hide ();
|
||||
|
||||
@@ -125,15 +125,18 @@ module Wc = struct
|
||||
done;
|
||||
b.(buffer_size-1) <- null_buffer_entry
|
||||
|
||||
let rec flush = fun () ->
|
||||
let rec repeat_send = fun fd cmd n ->
|
||||
W.send fd cmd;
|
||||
timer := Some (GMain.Timeout.add 300 (fun _ -> Debug.trace 'b' (sprintf "Retry %d" n); repeat_send fd cmd (n+1); false))
|
||||
|
||||
let rec flush = fun n ->
|
||||
let status, b = buffer in
|
||||
if !status = Ready then
|
||||
let (priority, fd, cmd) = b.(0) in
|
||||
if priority <> Null then begin
|
||||
Debug.trace 'w' (sprintf "%.2f send" (Unix.gettimeofday ()));
|
||||
W.send fd cmd;
|
||||
shift_buffer b;
|
||||
status := Busy;
|
||||
timer := Some (GMain.Timeout.add 300 (fun _ -> Debug.trace 'b' "Retry"; flush (); false))
|
||||
repeat_send fd cmd 0
|
||||
end
|
||||
|
||||
let buffer_ready = fun () ->
|
||||
@@ -155,6 +158,7 @@ module Wc = struct
|
||||
for j = i + 1 to buffer_size - 1 do (** Shift *)
|
||||
b.(j) <- b.(j-1)
|
||||
done;
|
||||
Debug.trace 'b' (sprintf "Set in %d" i);
|
||||
b.(i) <- (priority, fd, cmd)
|
||||
end
|
||||
else
|
||||
@@ -174,15 +178,19 @@ module Wc = struct
|
||||
match com with
|
||||
W.RECEIVED_FRAME ->
|
||||
use_tele_message (Serial.payload_of_string data)
|
||||
| W.RES_SEND_FRAME ->
|
||||
Debug.trace 'b' "RES_SEND_FRAME";
|
||||
ignore (GMain.Timeout.add 100 (fun _ -> buffer_ready (); false))
|
||||
|
||||
| W.RES_READ_REMOTE_RSSI ->
|
||||
Tm_Pprz.message_send "link" "WC_RSSI" ["raw_level", Pprz.Int (Char.code data.[0])];
|
||||
Tm_Pprz.message_send "link" "WC_RSSI" ["raw_level", Pprz.Int (Char.code data.[0])];
|
||||
Debug.call 'w' (fun f -> fprintf f "%.2f wv remote RSSI %d\n" (Unix.gettimeofday ()) (Char.code data.[0]));
|
||||
ignore (GMain.Timeout.add 100 (fun _ -> buffer_ready (); false))
|
||||
| W.RES_READ_RADIO_PARAM ->
|
||||
Ivy.send (sprintf "WC_ADDR %s" data);
|
||||
Debug.call 'w' (fun f -> fprintf f "wv local addr : %s\n" (Debug.xprint data));
|
||||
| W.ACK ->
|
||||
Debug.trace 'w' (sprintf "%.2f wv ACK" (Unix.gettimeofday ()));
|
||||
buffer_ready ()
|
||||
Debug.trace 'w' (sprintf "%.2f wv ACK" (Unix.gettimeofday ()))
|
||||
| _ ->
|
||||
Debug.call 'w' (fun f -> fprintf f "wv receiving: %02x %s\n" (W.code_of_cmd com) (Debug.xprint data));
|
||||
()
|
||||
@@ -221,6 +229,7 @@ let get_fp = fun device _sender vs ->
|
||||
(fun (dest_id, _) ->
|
||||
if dest_id <> ac_id then (** Do not send to itself *)
|
||||
try
|
||||
Debug.trace 'b' (sprintf "ACINFO %d for %d" ac_id dest_id);
|
||||
let ac_device = airborne_device dest_id airframes device.transport in
|
||||
let f = fun a -> Pprz.float_assoc a vs in
|
||||
let lat = (Deg>>Rad) (f "lat")
|
||||
|
||||
Reference in New Issue
Block a user