Funny, I'm actually working on that exact same thing this week...My
plan is to have an external opencv program which updates an xml file
with some gps coordinates (though I've toyed with the idea of doing it
through a database which could open up a lot of possibilities). In
the meantime paparazzi will read this file (or connect to this
database) and move a waypoint around accordingly. I've been digging
into the ocaml code and so far I've written a module named
automove_wp.ml <http://automove_wp.ml> (which, btw, you must add to
the Makefile to get it to work) with the following (very sad) ocaml code:
open Live
open Latlong
(** this function moves a waypoint *)
(** *)
let automove_waypoint = fun () ->
let ac = "1" in (* Eventually you won't be forced to act on
aircraft 1 *)
let a = find_ac ac in
let (num, first_waypoint) = a.fp_group#index (List.nth
a.fp_group#waypoints 1) in (* Eventually you won't be forced to act on
the second waypoint added *)
let selected_georef = ref WGS84_dec in
first_waypoint#set (geographic_of_coordinates !selected_georef
"41.822227 -111.987482"); (* Eventually this won't be hard coded
in, probably read from an xml file which will be updated periodically
by an external program *)
first_waypoint#moved;
commit_changes "1"
I've just been testing it by adding an item to the gcs's right-click
popup menu by modifying line 286 of gcs.ml <http://gcs.ml> as follows:
GToolbox.popup_menu ~entries:([`I ("Load Google tile",
display_gm); `I ("Automove waypoint", Automove_wp.automove_waypoint)address@hidden)
But eventually I will just have this function run every few seconds or
something.
Anyways, when the function gets run the waypoint actually moves to the
hard-coded-in gps coords but then it jumps right back after about 1/2
second...I'm not exactly sure why this happens but I'm assuming
there's more to do in order to "really" commit the change.
I don't know if this helps or not (it probably just hurts because this
ocaml is so broken :) I'm just learning it this week).
--Mitchel Humpherys
On Wed, Jul 23, 2008 at 9:56 AM, Aniket Aranake
<address@hidden <mailto:address@hidden>> wrote:
Hello Group,
I would like to manipulate some software to drive the paparazzi
ground station. Specifically, I am interested in using one program
to move waypoints in GCS. I don't know very much about ocaml. Can
anyone recommend the best way to do this? I was considering using
sockets, but I'm not sure if that's the most appropriate way to go.
Any help will be greatly appreciated. Thanks,
Aniket
_______________________________________________
Paparazzi-devel mailing list
address@hidden <mailto:address@hidden>
http://lists.nongnu.org/mailman/listinfo/paparazzi-devel
------------------------------------------------------------------------
_______________________________________________
Paparazzi-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/paparazzi-devel