RESTAPI : Is there any api which provide GPS location


#1

Hello,

I am looking for any api which gives GPS location of drone. I wanted to plot drone location on the maps using geo location. I have use local position data api which gives me X, Y and Z values. But i want lat lon co-ordinates.

Thanks


#2

Pratik,

the websocket call for GPS location in JavaScript,

var listenerGlobalPosition = new ROSLIB.Topic({
            ros :ros,
            name : '/<namespace>/mavros/global_position/global',
            messageType : 'sensor_msgs/NavSatFix',
            throttle_rate: 1000
    });
listenerGlobalPosition.subscribe(function(message) {
            $('#glat').text(message.latitude);
            $('#glong').text(round(message.longitude);
            $('#galt').text(message.altitude);
});

and rest call for the same is using GET on th e url : :9090/ros//mavros/global_position/global
with no parameters