Made my own Flight Log App - comments please!

Very impressive, in the UK we would describe you as a very clever man. Look forward to trying the finished item, press on with it and many thanks.
 
  • Like
Reactions: phuocsandiego
Looks great.
Was only thinking about doing this myself a few days ago since HealthDrones is moving to a subscription service.
Since you are so far along I'll just provide input as you request.
Cheers and good on you for pursuing this.
 
One more thing I've found is that doing my own application allows me to double check the results and algorithm that comes out of it. For example, I've found that my total distance calculation is completely different from another tool by a huge margin... the other tool is 42% higher(!) than what I'm doing. I've gone over my calculations several times and cannot find if I have an error in my logic. Here's what I'm doing:

1. Distance traveled is recorded with every data relative to the home point.
2. I calculate the absolute value between every two data points starting with the second data point (the first already shows how far the drone has traveled from the home point, if any) and store that temporarily.
3. I sum up all of these incremental distances as my "Total Distance".

I've done this several times by hand using the raw data log to make sure that my program's algorithm is not skipping data points for some reason or if there's an error in programming. But my hand method & program agree on the result. As it's such a huge difference, it's not can't just be subtleties in methodologies... any thoughts?
 
One more thing I've found is that doing my own application allows me to double check the results and algorithm that comes out of it. For example, I've found that my total distance calculation is completely different from another tool by a huge margin... the other tool is 42% higher(!) than what I'm doing. I've gone over my calculations several times and cannot find if I have an error in my logic. Here's what I'm doing:

1. Distance traveled is recorded with every data relative to the home point.
2. I calculate the absolute value between every two data points starting with the second data point (the first already shows how far the drone has traveled from the home point, if any) and store that temporarily.
3. I sum up all of these incremental distances as my "Total Distance".

I've done this several times by hand using the raw data log to make sure that my program's algorithm is not skipping data points for some reason or if there's an error in programming. But my hand method & program agree on the result. As it's such a huge difference, it's not can't just be subtleties in methodologies... any thoughts?
This is the algorithm I use for the distance between two points in DatCon. The coordinates need to be in radians, not degrees
public static double distance(double lat1, double lon1, double lat2,
double lon2) {

final int R = 6371; // Radius of the earth
if (lat1 == 0.0 || lon1 == 0.0 || lat2 == 0.0 || lon2 == 0.0)
return 0.0;
double latDistance = (lat2 - lat1);
double lonDistance = (lon2 - lon1);
double a = Math.sin(latDistance / 2) * Math.sin(latDistance / 2)
+ Math.cos((lat1)) * Math.cos((lat2))
* Math.sin(lonDistance / 2) * Math.sin(lonDistance / 2);
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
double distance = R * c * 1000; // convert to meters
return distance;
}
 
  • Like
Reactions: phuocsandiego
This is the algorithm I use for the distance between two points in DatCon. The coordinates need to be in radians, not degrees
public static double distance(double lat1, double lon1, double lat2,
double lon2) {

final int R = 6371; // Radius of the earth
if (lat1 == 0.0 || lon1 == 0.0 || lat2 == 0.0 || lon2 == 0.0)
return 0.0;
double latDistance = (lat2 - lat1);
double lonDistance = (lon2 - lon1);
double a = Math.sin(latDistance / 2) * Math.sin(latDistance / 2)
+ Math.cos((lat1)) * Math.cos((lat2))
* Math.sin(lonDistance / 2) * Math.sin(lonDistance / 2);
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
double distance = R * c * 1000; // convert to meters
return distance;
}

Thanks Bud! That's going to come in handy.

What I'm doing looks a bit easier as the Litchi CSV logs stores distance from the home point in feet automatically every time it records an entry. That's what I'm using to calculate total distance. Once I'm home again, I'm going to do another check using the latitude/longitude points using your algorithm and see if I get the same answer. Provided I'm not royally screwing something up in my thinking and that Litchi itself is correctly calculating the distance from the home point, the answers should agree. I'll let you know what I find out.

Thank you for DatCon by the way... that's pretty awesome! Once my tool is in a state ready for release, I plan to give it to members here to play with and give me further input... it's really close... just some power/battery info and I think it's good to release as a beta.
 
im confused. Is the Litchi number the distance from the HP to the current position? This wouldn't be useful when calculating the distance traveled. Maybe I don't understand what value you're trying to calculate.
 
im confused. Is the Litchi number the distance from the HP to the current position? This wouldn't be useful when calculating the distance traveled. Maybe I don't understand what value you're trying to calculate.

That's my understanding of it. Here's my thinking of how to use this to calculate distance traveled vs. using lat/long coordinates. Assume this simple 5 data point log:

#1 - 8 feet from HP
#2 - 18 feet from HP
#3 - 3 feet from HP
#4 - 12 feet from HP
#5 - 1 feet from HP

Based on my thinking, here's the incremental distances traveled by the drone between each point:
#1 - 8 feet traveled (at data point #1 the drone has to have traveled the 8 feet to be 8 feet away from the HP)
#2 - 10 feet traveled (18 - 8... the difference in its location from points 1 & 2)
#3 - 15 feet traveled (here we have a negative number but taking absolute value gives the distance)
#4 - 9 feet traveled
#5 - 11 feet traveled

Total distance traveled = 8 + 10 + 15 + 9 + 11 = 53 feet

If you're using lat/long coordinates at each point and then using your algorithm to calculate the distance traveled, you should see the exact same result, allowing for some rounding/precision stuff and assuming the Litchi itself is calculating the distance from the HP correctly. I have every reason to believe Litchi is calculating that correctly but I'm going to verify using your algorithm on the lat/long coordinates.

Does that make sense?
 
If you traveled in a straight line for 100 meters, then went around in a circle (100 meters radius) and then back to the home point. That would be 200 meters since all the points on the circle are equi-distant to the home point. I.e the 314.159 meters on the circumference wouldn't be included.
 
  • Like
Reactions: phuocsandiego
If you traveled in a straight line for 100 meters, then went around in a circle (100 meters radius) and then back to the home point. That would be 200 meters since all the points on the circle are equi-distant to the home point. I.e the 314.159 meters on the circumference wouldn't be included.

You're right. I'm going to test this based on the lat/long coords and see what I come up with. Thanks for the input!
 
This is the algorithm I use for the distance between two points in DatCon. The coordinates need to be in radians, not degrees
public static double distance(double lat1, double lon1, double lat2,
double lon2) {

final int R = 6371; // Radius of the earth
if (lat1 == 0.0 || lon1 == 0.0 || lat2 == 0.0 || lon2 == 0.0)
return 0.0;
double latDistance = (lat2 - lat1);
double lonDistance = (lon2 - lon1);
double a = Math.sin(latDistance / 2) * Math.sin(latDistance / 2)
+ Math.cos((lat1)) * Math.cos((lat2))
* Math.sin(lonDistance / 2) * Math.sin(lonDistance / 2);
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
double distance = R * c * 1000; // convert to meters
return distance;
}

BudWalker, thanks again for the suggestion on this. I've seen this equation somewhere... the Haversine formula isn't it? I re-ran the distances using this and it's what I was expecting although still different from other tools by the order of about 2%. That's acceptable to me as different languages will have different internal functions. Using the distance-to-homepoint is a mistake as it doesn't take into account curve paths around the home point as you rightly pointed out.
 
Looks very impressive to me, especially given the early stage it's at. Carry on the good work [emoji4]
 
Hi guys, here's another update. I'm getting really close to the point where I'm ready to release this to forum members to use. The program now gives some hopefully useful voltage information for the battery and individual cells. I have a placeholder for voltage deviations as well and will be working over the next several days to improve it further. The chart colors need work... as well as displaying some more detailed information but it's getting there.

I think that adding a way to just browse the raw log data per flight would be the last step I do before releasing it for folks to try out. I have more things I want to add to this... the biggest being figuring out how to import the DJI Go app logs. But it's coming along!

 
Writing it in Python so it should work on Windows, Mac or Linux. You can distribute Python programs as native binaries via wrapper these days so they're almost like compiled applications and do not need a Python install on the system.

Why do l suddenly feel old? I've just worked out how to set the timer on my betamax video machine LoL
 
  • Like
Reactions: Solly747400
Hi guys, here's another update. I'm getting really close to the point where I'm ready to release this to forum members to use. The program now gives some hopefully useful voltage information for the battery and individual cells. I have a placeholder for voltage deviations as well and will be working over the next several days to improve it further. The chart colors need work... as well as displaying some more detailed information but it's getting there.

I think that adding a way to just browse the raw log data per flight would be the last step I do before releasing it for folks to try out. I have more things I want to add to this... the biggest being figuring out how to import the DJI Go app logs. But it's coming along!

Looks like you're making a lot of progress. Python has some real advantages.

I'm interested to know how you're doing the map interface. I had considered doing the map interface as a component of DatCon and not creating a .kml that's then displayed with Google Earth. Doing that required a license and a key from Google. It's free and easy but then that key would have to be part of the executable that gets distributed. I was uncomfortable with doing that. Do you have any insight on this?
 
Very nice. I presently have logs in several places and none of them are consolidated.

I have used Flytrex for a few years. I would love to be able to take these logs and move or replicate the data in another log.

In addition, I have an account with Healthdrones. Finally, I have my DJI Go log.

Having them all consolidated and able to sort through the data would be fantastic. However, so far this dream seems allusive.
 

Recent Posts

Members online

No members online now.

Forum statistics

Threads
143,094
Messages
1,467,602
Members
104,980
Latest member
ozmtl