Drone flying path is not showing correctly


#1

Hello Srv,

I am Using Ros library for getting current location

name : ‘/’+namespace+’/mavros/global_position/global’,

throttle_rate: 1000

But it showing me stair care line on google map. i want to show the flying path like flyconsole.
I test the receiving location (Latitude and longitude ). it show me stair case flying path.


#2

Hello Trilok
Can you please show me the values that you are receiving.
I am assuming you are running it in FlytSim.


#3

Hello Dhiraj,

Yes am using Flytsim but not updated version. There is some bug in update version so am using old one.
As per Given image, i make a path using my mobile which is little bit same in flytconsole.

But when drone fly. the flying path is not same as like flyconsole. I got this data.

09-09 18:09:21.324 E/message x= 18.5941: message y=73.911 message z= 586.844
09-09 18:09:23.431 E/message x= 18.5941: message y=73.911 message z= 586.855
09-09 18:09:25.480 E/message x= 18.5941: message y=73.911 message z= 586.853
09-09 18:09:27.569 E/message x= 18.5941: message y=73.911 message z= 586.846
09-09 18:09:29.563 E/message x= 18.5941: message y=73.911 message z= 586.815
09-09 18:09:31.656 E/message x= 18.5941: message y=73.911 message z= 586.803
09-09 18:09:33.816 E/message x= 18.5941: message y=73.911 message z= 586.787
09-09 18:09:36.223 E/message x= 18.5941: message y=73.911 message z= 586.782
09-09 18:09:39.247 E/message x= 18.5941: message y=73.911 message z= 586.775
09-09 18:09:40.012 E/message x= 18.5941: message y=73.911 message z= 586.755
09-09 18:09:42.093 E/message x= 18.5941: message y=73.911 message z= 586.74
09-09 18:09:44.211 E/message x= 18.5941: message y=73.911 message z= 586.716
09-09 18:09:46.302 E/message x= 18.5941: message y=73.911 message z= 586.693
09-09 18:09:48.430 E/message x= 18.5941: message y=73.911 message z= 585.778
09-09 18:09:50.508 E/message x= 18.5941: message y=73.911 message z= 584.515
09-09 18:09:52.566 E/message x= 18.5941: message y=73.911 message z= 583.24
09-09 18:09:54.604 E/message x= 18.5941: message y=73.911 message z= 581.904
09-09 18:09:56.676 E/message x= 18.5941: message y=73.911 message z= 580.483
09-09 18:09:58.762 E/message x= 18.5941: message y=73.911 message z= 579.858
09-09 18:10:01.321 E/message x= 18.5941: message y=73.911 message z= 580.39
09-09 18:10:02.994 E/message x= 18.5941: message y=73.911 message z= 580.137
09-09 18:10:04.945 E/message x= 18.5941: message y=73.911 message z= 579.653
09-09 18:10:07.714 E/message x= 18.5941: message y=73.911 message z= 578.351
09-09 18:10:09.119 E/message x= 18.5941: message y=73.911 message z= 581.968
09-09 18:10:11.259 E/message x= 18.5941: message y=73.911 message z= 586.313
09-09 18:10:15.328 E/message x= 18.5941: message y=73.911 message z= 587.097
09-09 18:10:15.375 E/message x= 18.5941: message y=73.911 message z= 587.201
09-09 18:10:17.537 E/message x= 18.594: message y=73.911 message z= 587.606
09-09 18:10:19.517 E/message x= 18.594: message y=73.911 message z= 587.365
09-09 18:10:21.646 E/message x= 18.5939: message y=73.9109 message z= 587.096
09-09 18:10:23.751 E/message x= 18.5938: message y=73.9109 message z= 586.974
09-09 18:10:25.935 E/message x= 18.5938: message y=73.9109 message z= 587.257
09-09 18:10:28.046 E/message x= 18.5939: message y=73.9109 message z= 587.104
09-09 18:10:30.107 E/message x= 18.5939: message y=73.911 message z= 586.922
09-09 18:10:32.167 E/message x= 18.594: message y=73.911 message z= 586.751
09-09 18:10:34.200 E/message x= 18.594: message y=73.9111 message z= 586.559
09-09 18:10:36.401 E/message x= 18.5941: message y=73.9111 message z= 586.397
09-09 18:10:38.371 E/message x= 18.5941: message y=73.9111 message z= 586.266
09-09 18:10:40.465 E/message x= 18.5942: message y=73.9112 message z= 586.155
09-09 18:10:42.515 E/message x= 18.5943: message y=73.9112 message z= 586.045
09-09 18:10:44.676 E/message x= 18.5943: message y=73.9113 message z= 586.043
09-09 18:10:46.686 E/message x= 18.5944: message y=73.9112 message z= 586.031
09-09 18:10:48.761 E/message x= 18.5944: message y=73.9112 message z= 586.176
09-09 18:10:50.844 E/message x= 18.5944: message y=73.9112 message z= 586.216
09-09 18:10:52.932 E/message x= 18.5944: message y=73.9112 message z= 586.176
09-09 18:10:54.998 E/message x= 18.5944: message y=73.9112 message z= 586.322
09-09 18:10:57.023 E/message x= 18.5944: message y=73.9111 message z= 586.418
09-09 18:10:59.142 E/message x= 18.5944: message y=73.911 message z= 586.591
09-09 18:11:01.225 E/message x= 18.5944: message y=73.9109 message z= 586.658
09-09 18:11:03.244 E/message x= 18.5944: message y=73.9108 message z= 586.625
09-09 18:11:05.400 E/message x= 18.5944: message y=73.9108 message z= 586.535
09-09 18:11:07.433 E/message x= 18.5944: message y=73.9107 message z= 586.505
09-09 18:11:09.472 E/message x= 18.5945: message y=73.9106 message z= 586.454
09-09 18:11:11.575 E/message x= 18.5945: message y=73.9106 message z= 586.438
09-09 18:11:13.678 E/message x= 18.5946: message y=73.9105 message z= 586.424
09-09 18:11:16.174 E/message x= 18.5946: message y=73.9105 message z= 586.475
09-09 18:11:18.218 E/message x= 18.5947: message y=73.9105 message z= 586.496
09-09 18:11:19.896 E/message x= 18.5947: message y=73.9105 message z= 586.501
09-09 18:11:21.964 E/message x= 18.5948: message y=73.9104 message z= 586.504
09-09 18:11:24.112 E/message x= 18.5949: message y=73.9104 message z= 586.516
09-09 18:11:26.299 E/message x= 18.595: message y=73.9104 message z= 586.524
09-09 18:11:28.416 E/message x= 18.595: message y=73.9103 message z= 586.606
09-09 18:11:30.446 E/message x= 18.5951: message y=73.9104 message z= 586.678
09-09 18:11:32.470 E/message x= 18.5951: message y=73.9104 message z= 586.92
09-09 18:11:34.572 E/message x= 18.5951: message y=73.9104 message z= 587.043
09-09 18:11:36.670 E/message x= 18.5951: message y=73.9104 message z= 587.08
09-09 18:11:38.766 E/message x= 18.5951: message y=73.9104 message z= 587.123
09-09 18:11:40.861 E/message x= 18.5951: message y=73.9104 message z= 587.212
09-09 18:11:42.973 E/message x= 18.5951: message y=73.9105 message z= 587.264
09-09 18:11:45.017 E/message x= 18.595: message y=73.9106 message z= 587.244
09-09 18:11:47.078 E/message x= 18.595: message y=73.9106 message z= 587.175
09-09 18:11:49.194 E/message x= 18.595: message y=73.9107 message z= 587.083
09-09 18:11:51.347 E/message x= 18.595: message y=73.9108 message z= 587.004
09-09 18:11:53.472 E/message x= 18.595: message y=73.9109 message z= 586.946
09-09 18:11:55.562 E/message x= 18.595: message y=73.9109 message z= 586.891
09-09 18:11:57.640 E/message x= 18.595: message y=73.911 message z= 586.902
09-09 18:11:59.750 E/message x= 18.595: message y=73.9111 message z= 586.939
09-09 18:12:01.852 E/message x= 18.595: message y=73.9112 message z= 586.974
09-09 18:12:03.957 E/message x= 18.595: message y=73.9112 message z= 587.026
09-09 18:12:05.981 E/message x= 18.595: message y=73.9113 message z= 586.96
09-09 18:12:08.057 E/message x= 18.5949: message y=73.9114 message z= 586.894
09-09 18:12:10.134 E/message x= 18.5949: message y=73.9115 message z= 586.877
09-09 18:12:12.133 E/message x= 18.5949: message y=73.9116 message z= 586.99
09-09 18:12:14.264 E/message x= 18.5949: message y=73.9116 message z= 586.926
09-09 18:12:16.371 E/message x= 18.595: message y=73.9117 message z= 586.833
09-09 18:12:18.487 E/message x= 18.595: message y=73.9118 message z= 586.935
09-09 18:12:20.510 E/message x= 18.5951: message y=73.9118 message z= 586.884
09-09 18:12:22.596 E/message x= 18.5951: message y=73.9118 message z= 586.777
09-09 18:12:24.643 E/message x= 18.5952: message y=73.9119 message z= 586.747
09-09 18:12:26.773 E/message x= 18.5953: message y=73.9119 message z= 586.721
09-09 18:12:28.894 E/message x= 18.5953: message y=73.912 message z= 586.71
09-09 18:12:30.973 E/message x= 18.5954: message y=73.912 message z= 586.729
09-09 18:12:33.069 E/message x= 18.5955: message y=73.912 message z= 586.814
09-09 18:12:35.142 E/message x= 18.5955: message y=73.912 message z= 586.875
09-09 18:12:37.194 E/message x= 18.5955: message y=73.912 message z= 586.913
09-09 18:12:39.312 E/message x= 18.5955: message y=73.912 message z= 586.961
09-09 18:12:41.437 E/message x= 18.5955: message y=73.9119 message z= 587.081
09-09 18:12:43.530 E/message x= 18.5955: message y=73.9118 message z= 587.141
09-09 18:12:45.545 E/message x= 18.5955: message y=73.9118 message z= 587.216
09-09 18:12:47.626 E/message x= 18.5955: message y=73.9117 message z= 587.182
09-09 18:12:49.748 E/message x= 18.5955: message y=73.9116 message z= 587.061
09-09 18:12:51.825 E/message x= 18.5955: message y=73.9115 message z= 586.939
09-09 18:12:53.914 E/message x= 18.5955: message y=73.9114 message z= 586.802
09-09 18:12:56.089 E/message x= 18.5955: message y=73.9114 message z= 586.757
09-09 18:12:58.105 E/message x= 18.5955: message y=73.9113 message z= 586.689
09-09 18:13:00.193 E/message x= 18.5956: message y=73.9112 message z= 586.613
09-09 18:13:02.697 E/message x= 18.5956: message y=73.9111 message z= 586.495
09-09 18:13:04.401 E/message x= 18.5956: message y=73.911 message z= 586.447
09-09 18:13:06.467 E/message x= 18.5956: message y=73.911 message z= 586.445
09-09 18:13:08.544 E/message x= 18.5956: message y=73.9109 message z= 586.445
09-09 18:13:10.581 E/message x= 18.5956: message y=73.9108 message z= 586.463
09-09 18:13:12.675 E/message x= 18.5956: message y=73.9107 message z= 586.407
09-09 18:13:14.798 E/message x= 18.5956: message y=73.9106 message z= 586.405
09-09 18:13:16.898 E/message x= 18.5956: message y=73.9106 message z= 586.447
09-09 18:13:18.975 E/message x= 18.5956: message y=73.9105 message z= 586.48
09-09 18:13:21.015 E/message x= 18.5957: message y=73.9104 message z= 586.468
09-09 18:13:23.129 E/message x= 18.5957: message y=73.9103 message z= 586.477
09-09 18:13:25.234 E/message x= 18.5957: message y=73.9102 message z= 586.49
09-09 18:13:27.392 E/message x= 18.5957: message y=73.9102 message z= 586.529

As per Received data. Google map poly line are correct.


#4

Hi,

Are you sure, the latitude and longitude data that you are receiving are only upto 4 decimal places? Moreover, instead of joining all the points that you are receiving, can you just plot the points? and share that image with me?


#5

Hello Srv,

I Got only 4 Digit location data. Please check the given screen shot.
Black line is the complete path.
Green icon show the direction.
Red point show the waypoint location.
and Yellow point show the retrieving data from flytsim (Runtime).

In Flytconsole it was awesome. It fly well.
Please check the old given image for flytconsole.


#6

Hi Trilok,
Flytsim surely publishes latitude and longitude data in 7-8 decimal places. I would like to see the part of the code that prints the above log of latitude and longitude data in 4 decimals. If you have referred the sample app code snippet.
https://github.com/flytbase/flytsamples/blob/master/AndroidApps/Java-Apps/SampleApp2-Socket/app/src/main/java/com/example/god/sampleapp2/Main2Activity.java
then you will notice i applied a round function to round the values to 4 decimal places for viewing purpose. But for plotting you will need the complete value which is why you are getting a staircase plot.


#7

Hello Vallabh,
Thanks for your support, I check that java code. it’s working fine.
But am using html java script code with java interface. So is there any process to get 6 digit
Decimal number from html code.
Or we have to use java ros library code as like above given code…
Am using this java script code.

var listenerGlobalPosition = new ROSLIB.Topic({
ros :ros,
name : ‘/’+namespace+’/mavros/global_position/global’,
messageType : ‘sensor_msgs/NavSatFix’,
throttle_rate: 1000
});

listenerGlobalPosition.subscribe(function(message) {

$('#posx').text(message.latitude);
$('#posy').text(message.longitude);
$('#posz').text(message.altitude);
console.log('help me out');

Android.showCurrentLocation(message.latitude, message.longitude, message.altitude);

});