- Joined
- Jan 4, 2016
- Messages
- 1,052
- Reaction score
- 318
- Age
- 40
We need alternatives to HealthyDrones. Thanks for the initiative.
what about doing some "proper" open source project. I'm low with my free time, but fine with ruby & node and would love to spend some nightly hours
This is the algorithm I use for the distance between two points in DatCon. The coordinates need to be in radians, not degreesOne 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;
}
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.
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.
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;
}
if you want to get more precise results, you can always use formulas from here: Earth radius - Wikipedia, the free encyclopedia
and also, you can take into consideration altitude change
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.
Looks like you're making a lot of progress. Python has some real advantages.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!
We use essential cookies to make this site work, and optional cookies to enhance your experience.