I am doing a project. I want to use google maps api to send a (longitude,latitude) command wherever I click to my microcontroller that will navigate the helicopter to that location with the built in gps. Does google maps api has any such function for sending commands?Google Map API with GPS control for Helicopter?
I'm assuming you know basics of google maps api, here is the js code to get longitude and latitude data from a click on google maps, in the code below replace the alert function with your function which will pass data to microcontroller and pass the variables lat %26amp; lng.
var map;
map = new GMap2 (document.getElementById ("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(40, -100), 4);
GEvent.addListener(map, 'click', function(overlay, point) {
if (overlay) {
map.removeOverlay(overlay);
}
else if (point) {
var marker = new GMarker(point);
map.addOverlay(marker);
lat = point.lat();
lng = point.lng();
alert ("Latitude = "+lat+"\nLongitude = "+lng);
}
});Google Map API with GPS control for Helicopter?
The system you describe is already in service. In fact, GPS navigation has been around for quite some time, but it does not use Google to find it's way. I suppose if you were just building a PC game, it would work fine, but in the real world the sky is broken up into sections of different airspace classes and requires separate procedures for flying through each. In addition, there are altitude limitations and restrictions. For this reason, most GPS receivers use a virtual sectional map of the airspace region the pilot intends to fly through. Since Google maps lacks the complex array of navigation aids and airspace structure definitions, it may not be the best choice for navigating aircraft and this is why it's not part of the mainstream aviation industry. I suspect that Google maps, and Google Earth is for entertainment reasons only.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment