diff --git a/conf/airframes/microjet7.xml b/conf/airframes/microjet7.xml index 10e0689499..596960ffc2 100644 --- a/conf/airframes/microjet7.xml +++ b/conf/airframes/microjet7.xml @@ -104,6 +104,8 @@ + +
@@ -116,7 +118,7 @@ - + diff --git a/conf/airframes/slayer1.xml b/conf/airframes/slayer1.xml index 5f88149e35..1fbce0c313 100644 --- a/conf/airframes/slayer1.xml +++ b/conf/airframes/slayer1.xml @@ -73,9 +73,9 @@ - - - + + +
@@ -99,20 +99,22 @@ + +
- + - - + + - - + + diff --git a/conf/settings/tuning.xml b/conf/settings/tuning.xml index e4944abe71..70514f9886 100644 --- a/conf/settings/tuning.xml +++ b/conf/settings/tuning.xml @@ -33,8 +33,8 @@ - - + + @@ -52,14 +52,15 @@ - - + + + - + diff --git a/sw/airborne/fw_h_ctl.c b/sw/airborne/fw_h_ctl.c index 10513ccb0f..487ae7b55d 100644 --- a/sw/airborne/fw_h_ctl.c +++ b/sw/airborne/fw_h_ctl.c @@ -197,7 +197,7 @@ inline static float loiter(void) { elevator_trim = throttle_dif / max_dif * v_ctl_auto_throttle_dash_trim; } else { float max_dif = Max(v_ctl_auto_throttle_nominal_cruise_throttle - V_CTL_AUTO_THROTTLE_MIN_CRUISE_THROTTLE, 0.1); - elevator_trim = throttle_dif / max_dif * v_ctl_auto_throttle_loiter_trim; + elevator_trim = - throttle_dif / max_dif * v_ctl_auto_throttle_loiter_trim; } float max_change = (v_ctl_auto_throttle_loiter_trim - v_ctl_auto_throttle_dash_trim) / 80.; diff --git a/sw/airborne/infrared.c b/sw/airborne/infrared.c index ddfb2dcab2..63036155c2 100644 --- a/sw/airborne/infrared.c +++ b/sw/airborne/infrared.c @@ -301,14 +301,14 @@ void estimator_update_state_infrared( void ) { } else { /* 360° estimation */ /* 250 us for the whole block */ - ir_roll *= IR_360_LATERAL_CORRECTION; - ir_pitch *= IR_360_LONGITUDINAL_CORRECTION; - ir_top *= IR_360_VERTICAL_CORRECTION; + float tmp_ir_roll = ir_roll * IR_360_LATERAL_CORRECTION; + float tmp_ir_pitch = ir_pitch * IR_360_LONGITUDINAL_CORRECTION; + float tmp_ir_top = ir_top * IR_360_VERTICAL_CORRECTION; - estimator_phi = atan2(ir_roll, ir_top) - ir_roll_neutral; + estimator_phi = atan2(tmp_ir_roll, tmp_ir_top) - ir_roll_neutral; estimator_phi = correct_angle(estimator_phi, ir_estimated_phi_pi_4); - estimator_theta = atan2(ir_pitch, ir_top) - ir_pitch_neutral; + estimator_theta = atan2(tmp_ir_pitch, tmp_ir_top) - ir_pitch_neutral; estimator_theta = correct_angle(estimator_theta, ir_estimated_phi_pi_4); if (estimator_theta < -M_PI_2) estimator_theta += M_PI; diff --git a/sw/ground_segment/cockpit/strip.ml b/sw/ground_segment/cockpit/strip.ml index 6e514ba27d..817d23eef2 100644 --- a/sw/ground_segment/cockpit/strip.ml +++ b/sw/ground_segment/cockpit/strip.ml @@ -1,4 +1,28 @@ -(************ Strip handling ***********************************************) +(* + * $Id$ + * + * Strip handling + * + * Copyright (C) 2006 ENAC, Pascal Brisset, 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. + * + *) let bat_max = 12.5 let bat_min = 9. @@ -45,7 +69,8 @@ let add config color select center_ac commit_moves mark = let tooltips = GData.tooltips () in (* frame of the strip *) - let frame = GBin.frame ~shadow_type: `IN ~packing: (widget#attach ~top: (strip_number) ~left: 0) () in + let strip_ebox = GBin.event_box ~packing:(widget#attach ~top:strip_number ~left:0) () in + let frame = GBin.frame ~shadow_type: `IN ~packing:strip_ebox#add () in let framevb = GPack.vbox ~packing:frame#add () in (** Table (everything except the user buttons) *) @@ -60,7 +85,7 @@ let add config color select center_ac commit_moves mark = let plane_color = GBin.event_box ~packing:(strip#attach ~top:0 ~left:1 ~right:columns) () in plane_color#coerce#misc#modify_bg [`NORMAL, `NAME color]; - ignore (plane_color#event#connect#button_press ~callback:(fun _ -> select (); true)); + ignore (strip_ebox#event#connect#button_press ~callback:(fun _ -> select (); true)); let h = GPack.hbox ~packing:plane_color#add () in let ft = GMisc.label ~text: "00:00:00" ~packing:h#add () in ft#set_width_chars 8; diff --git a/sw/lib/ocaml/mapWaypoints.ml b/sw/lib/ocaml/mapWaypoints.ml index 152d536b3a..4ddd31fc39 100644 --- a/sw/lib/ocaml/mapWaypoints.ml +++ b/sw/lib/ocaml/mapWaypoints.ml @@ -98,10 +98,21 @@ class waypoint = fun (wpts_group:group) (name :string) ?(alt=0.) wgs84 -> let wgs84 = self#pos in let s = sprintf "WGS84 %s" (geomap#geo_string wgs84) in let ename = GEdit.entry ~text:name ~editable ~packing:dvbx#add () in - let e_pos = GEdit.entry ~text:s ~packing:dvbx#add () in + let hbox = GPack.hbox ~packing:dvbx#add () in + let optmenu = GMenu.option_menu ~packing:hbox#add () in + + (*** + let menu = in + optmenu#set_menu menu; + ***) + + + let e_pos = GEdit.entry ~text:s ~packing:hbox#add () in let ha = GPack.hbox ~packing:dvbx#add () in let minus10= GButton.button ~label:"-10" ~packing:ha#add () in let ea = GEdit.entry ~text:(string_of_float alt) ~packing:ha#add () in + let agl = alt -. float (try Srtm.of_wgs84 wgs84 with _ -> 0) in + let agl_lab = GMisc.label ~text:(sprintf " AGL: %4.0fm" agl) ~packing:ha#add () in let plus10= GButton.button ~label:"+10" ~packing:ha#add () in let change_alt = fun x -> ea#set_text (string_of_float (float_of_string ea#text +. x)) in @@ -128,6 +139,7 @@ class waypoint = fun (wpts_group:group) (name :string) ?(alt=0.) wgs84 -> let cancel = GButton.button ~stock:`CANCEL ~packing: dhbx#add () in let destroy = fun () -> self#reset_moved (); + wpt_group#lower_to_bottom (); dialog#destroy () in ignore(cancel#connect#clicked ~callback:destroy); @@ -146,7 +158,19 @@ class waypoint = fun (wpts_group:group) (name :string) ?(alt=0.) wgs84 -> (fun e -> ignore (e#connect#activate ~callback)) [ename; e_pos; ea]; ok#grab_default (); + ignore(ok#connect#clicked ~callback:(fun _ -> callback (); dialog#destroy ())); + + (* Update AGL on pos or alt change *) + let callback = fun _ -> + try + let wgs84 = LL.of_string e_pos#text in + let agl = float_of_string ea#text -. float (try Srtm.of_wgs84 wgs84 with _ -> 0) in + agl_lab#set_text (sprintf " AGL: %4.0fm" agl) + with _ -> () + in + ignore (ea#connect#changed ~callback); + ignore (e_pos#connect#changed ~callback); dialog#show () val mutable motion = false