DJI Mavic, Air and Mini Drones
Friendly, Helpful & Knowledgeable Community
Join Us Now

Plot the track of a DJI Drone using CSV

PilotNovel

Active Member
Joined
Oct 3, 2022
Messages
28
Reactions
1
Age
33
Location
Italy
First of all I want to apologize if a thread similar to this already exists but I've not seen it.
I was looking at the csv data and a doubt raised up: is it possible to plot the trace of a drone only using sensors and not the features regarding GPS?
Basically using the following ones: -OSD.hSpeed [MPH] - OSD.hSpeedMax [MPH] - OSD.xSpeed [MPH] -OSD.xSpeedMax [MPH] -OSD.ySpeed [MPH] -OSD.ySpeedMax [MPH] -OSD.zSpeed [MPH] -OSD.zSpeedMax [MPH] -OSD.pitch OSD.roll -OSD.yaw -OSD.yaw [360].

If someone of you has already read something about the topic I'm very glad to hear your voice!

Thank you in advance!
PS: Obviously post flight
 
  • Like
Reactions: wsteele
...is it possible to plot the trace of a drone only using sensors and not the features regarding GPS?
No... in order to be able to make a flight path the time/speed component needs to be known. All speeds in a txt log is calculation out from the ground position, if that is unknown (GPS position) no speeds will be known.

Furthermore... what you seems to have looked at is a mobile device created .txt log visualized through PhantomHelp... that's not raw sensor data, nearly all in that log is calculations, you need a .dat log to access raw data from the sensors.

Your choice of log signals from that .txt log are also confusing... for instance, OSD.yaw & OSD.yaw [360] is the same but only shown in 2 different ways, the first on a +-180 degree axis with 0 to North, the second on a full 360 degree axis with North on 0 & 360.
 
  • Like
Reactions: PilotNovel
No... in order to be able to make a flight path the time/speed component needs to be known. All speeds in a txt log is calculation out from the ground position, if that is unknown (GPS position) no speeds will be known.

Furthermore... what you seems to have looked at is a mobile device created .txt log visualized through PhantomHelp... that's not raw sensor data, nearly all in that log is calculations, you need a .dat log to access raw data from the sensors.

Your choice of log signals from that .txt log are also confusing... for instance, OSD.yaw & OSD.yaw [360] is the same but only shown in 2 different ways, the first on a +-180 degree axis with 0 to North, the second on a full 360 degree axis with North on 0 & 360.
First of all thank you for the answer.
Exactly, they are the same, I just copied and pasted all the sensors. I meant exactly what you mentioned above: plot the path using yaw/roll/pitch. Moreover yes.. the logs that I use they're the output of PhantomHelp application.
I try to make my question clearer: is it possible to plot the path using the sensor's data given by PhantomHelp (using yaw, pitch, roll and the speed)?
 
...is it possible to plot the path using the sensor's data given by PhantomHelp (using yaw, pitch, roll and the speed)?
As said... no, not without a GPS position, as the lack of that prevents you to get the speed component.
 
  • Like
Reactions: PilotNovel
First of all I want to apologize if a thread similar to this already exists but I've not seen it.
I was looking at the csv data and a doubt raised up: is it possible to plot the trace of a drone only using sensors and not the features regarding GPS?
Basically using the following ones: -OSD.hSpeed [MPH] - OSD.hSpeedMax [MPH] - OSD.xSpeed [MPH] -OSD.xSpeedMax [MPH] -OSD.ySpeed [MPH] -OSD.ySpeedMax [MPH] -OSD.zSpeed [MPH] -OSD.zSpeedMax [MPH] -OSD.pitch OSD.roll -OSD.yaw -OSD.yaw [360].

If someone of you has already read something about the topic I'm very glad to hear your voice!

Thank you in advance!
PS: Obviously post flight
Actually, OSD:xSpeed and OSD:ySpeed do depend on "GPS features". Those values are the result of fusing several sensor data. But they depend mostly on GPS:VelN and GPS:VelE values which, in turn, are derived from the doppler effect on the received GPS signals. Usually, the GPS:VelN and GPS:VelE data are more reliable than the lat/long data produced by the GPS receiver.

Maybe not quite what you are looking for but the OSD:xSpeed and OSD:ySpeed data can be used to compute a trajectory. This is different than the trajectory computed by the Flight Controller. CsvView does the post processing required to produce the trajectory from the OSD:xSpeed and OSD:ySpeed data. Take a look at
https://datfile.net/Doc/IMUCalcs.pdf
for more info.

You had mentioned the possibility of computing a trajectory "using yaw, pitch, roll and the speed". By speed I'm assuming you mean OSD:hSpeed. Better would be to use IMUCalcs:hSpeed which is derived from OSD:xSpeed and OSD:ySpeed.
 
Last edited:
  • Like
Reactions: PilotNovel
As said... no, not without a GPS position, as the lack of that prevents you to get the speed component.
Thank you for the answer!

Actually, OSD:xSpeed and OSD:ySpeed do depend on "GPS features". Those values are the result of fusing several sensor data. But they depend mostly on GPS:VelN and GPS:VelE values which, in turn, are derived from the doppler effect on the received GPS signals. Usually, the GPS:VelN and GPS:VelE data are more reliable than the lat/long data produced by the GPS receiver.

Maybe not quite what you are looking for but the OSD:xSpeed and OSD:ySpeed data can be used to compute a trajectory. This is different than the trajectory computed by the Flight Controller. CsvView does the post processing required to produce the trajectory from the OSD:xSpeed and OSD:ySpeed data. Take a look at
https://datfile.net/Doc/IMUCalcs.pdf
for more info.

You had mentioned the possibility of computing a trajectory "using yaw, pitch, roll and the speed". By speed I'm assuming you mean OSD:hSpeed. Better would be to use IMUCalcs:hSpeed which is derived from OSD:xSpeed and OSD:ySpeed.
Thank you for the answer.
Let's imagine I have the GPS and I can use all the features retrieved by PhantomHelper/CsvViewer.. I would like to plot the trajectory of the drone only using the value of the sensors and no the GPS (I know is easier to use the GPS but I would like to try this method) Do you know any formula who bind (yaw, pitch, roll, velocity) with a position on the plane?
I try to make a very naive (and wrong) example:
I know the value of
-> OSD.xSpeed = 1.3
-> OSD.pitch = 0
-> OSD.roll = - 0.3
-> OSD.yaw = - 0.2
and imagine I start the flight in the position (x,y,z) = (0,0,0).
Imagine now I have these value at time t = 2..
Is there any formula to get where I am in the plane ??? Or at least the expected position.
For this reason I said "no GPS" because I would like to plot the path using only these sensors
 
Thank you for the answer!


Thank you for the answer.
Let's imagine I have the GPS and I can use all the features retrieved by PhantomHelper/CsvViewer.. I would like to plot the trajectory of the drone only using the value of the sensors and no the GPS (I know is easier to use the GPS but I would like to try this method) Do you know any formula who bind (yaw, pitch, roll, velocity) with a position on the plane?
I try to make a very naive (and wrong) example:
I know the value of
-> OSD.xSpeed = 1.3
-> OSD.pitch = 0
-> OSD.roll = - 0.3
-> OSD.yaw = - 0.2
and imagine I start the flight in the position (x,y,z) = (0,0,0).
Imagine now I have these value at time t = 2..
Is there any formula to get where I am in the plane ??? Or at least the expected position.
For this reason I said "no GPS" because I would like to plot the path using only these sensors
OSD:xSpeed is actually the same as (earth) North speed. xSpeed = North and ySpeed = East. OSD:xSpeed is not speed along the AC X axis. It is speed along the north/south earth frame of reference.
 
  • Like
Reactions: PilotNovel
Thank you for the answer!


Thank you for the answer.
Let's imagine I have the GPS and I can use all the features retrieved by PhantomHelper/CsvViewer.. I would like to plot the trajectory of the drone only using the value of the sensors and no the GPS (I know is easier to use the GPS but I would like to try this method) Do you know any formula who bind (yaw, pitch, roll, velocity) with a position on the plane?
I try to make a very naive (and wrong) example:
I know the value of
-> OSD.xSpeed = 1.3
-> OSD.pitch = 0
-> OSD.roll = - 0.3
-> OSD.yaw = - 0.2
and imagine I start the flight in the position (x,y,z) = (0,0,0).
Imagine now I have these value at time t = 2..
Is there any formula to get where I am in the plane ??? Or at least the expected position.
For this reason I said "no GPS" because I would like to plot the path using only these sensors
And, computing position could be done by a simple time integration of xSpeed and ySpeed. Take a look at
https://datfile.net/Doc/IMUCalcs.pdf
as an example of how this could be done.
 
  • Like
Reactions: PilotNovel
And, computing position could be done by a simple time integration of xSpeed and ySpeed. Take a look at
https://datfile.net/Doc/IMUCalcs.pdf
as an example of how this could be done.
Good morning!
I was looking at the pdf you linked yesterday and when I read the "Limitations" chapther some questions raised up:
1) is it better to use the solution that takes care of accelerometer, gyro and magnetometer??
2) since I'm using a MavicAir2, does this method (using the PDF) work? Or is it better to use something else method?

Thank you for the support!
1679387662529.png
 
Good morning!
I was looking at the pdf you linked yesterday and when I read the "Limitations" chapther some questions raised up:
1) is it better to use the solution that takes care of accelerometer, gyro and magnetometer??
2) since I'm using a MavicAir2, does this method (using the PDF) work? Or is it better to use something else method?

Thank you for the support!
View attachment 161817
Yes, in general, it's better to use more data (e.g. GPS location, gyro, magnetometer and accelerometer) when estimating location. For that you'll need the .DAT which contains those data which are not found in the .txt.

As stated in the first paragraph of the PDF the goal of the IMUCalcs package is to expose inconsistencies in the values computed by the Flight Controller. To achieve this a method different than what is used by the FC is used to compute location and velocity values. Other than being a diagnostic to expose sensor or FC problems the IMUCalcs package isn't too useful.

I'm not really sure what your goal is so I can't answer your second question. Usually the IMUCalcs package produces location/velocity data that agrees pretty well with the FC. Except, that is, the IMUCalcs values will drift some. That's to be expected since GPS location, magnetometer, accelerometer and gyro data isn't used to correct any drift.

You might want to take a look at a few MavicAir 2 .DAT files.
 
  • Like
Reactions: PilotNovel
Yes, in general, it's better to use more data (e.g. GPS location, gyro, magnetometer and accelerometer) when estimating location. For that you'll need the .DAT which contains those data which are not found in the .txt.

As stated in the first paragraph of the PDF the goal of the IMUCalcs package is to expose inconsistencies in the values computed by the Flight Controller. To achieve this a method different than what is used by the FC is used to compute location and velocity values. Other than being a diagnostic to expose sensor or FC problems the IMUCalcs package isn't too useful.

I'm not really sure what your goal is so I can't answer your second question. Usually the IMUCalcs package produces location/velocity data that agrees pretty well with the FC. Except, that is, the IMUCalcs values will drift some. That's to be expected since GPS location, magnetometer, accelerometer and gyro data isn't used to correct any drift.

You might want to take a look at a few MavicAir 2 .DAT files.
Thank you a lot for the answer.
So the .dat file is it accessible? Because I remember that there is some data encrypted by DJI and it is not possible to see.
However I will try using IMUCalcs. I better explain my problem/goal: I would like to plot (using pyplot) the route of the drone. For doing this I didn't want to use GPS. Why? Because if, for example, I flight my drone inside my house the GPS is more or less the same and it appears as a point. So I though: What sensors influences the movement of my drone and I can access to it? For sure roll, pitch and yaw. What else? The velocity because If I know that at some time my sensors as values (n1, n2, n3) I would like to find a formula that gives me in output where the drone is after 1 second. After that I read another time the sensors and I plot the movement for the following 1 sec. Moe precisely I would like to find a function f(n1,n2,n3,velox) -> (x,y,z)
Is it clearer now?
 
Last edited:
Thank you a lot for the answer.
So the .dat file is it accessible? Because I remember that there is some data encrypted by DJI and it is not possible to see.
However I will try using IMUCalcs. I better explain my problem/goal: I would like to plot (using pyplot) the route of the drone. For doing this I didn't want to use GPS. Why? Because if, for example, I flight my drone inside my house the GPS is more or less the same and it appears as a point. So I though: What sensors influences the movement of my drone and I can access to it? For sure roll, pitch and yaw. What else? The velocity because If I know that at some time my sensors as values (n1, n2, n3) I would like to find a formula that gives me in output where the drone is after 1 second. After that I read another time the sensors and I plot the movement for the following 1 sec. Moe precisely I would like to find a function f(n1,n2,n3,velox) -> (x,y,z)
Is it clearer now?
Well, if you don't have any GPS data, either location or velocities, I can think of a few approaches. Unfortunately, they aren't very robust.

1) Use the vision system like some of the Tello pilots tried. That actually worked pretty well. Take a look here
Drone log
The problem is that the MA2 vision system decides that it's location solution is invalid a significant amount of the time.

2) Use pitch and roll as proxies for velocity. For 0.0 acceleration the velocity is solely dependent on the tilt angle. Note that 0.0 acceleration doesn't necessarily imply 0.0 velocity. This approach requires data found only in the .DAT. This is a very tough mathematical problem, subject to drift and just yields the velocity relative to the wind field.

3) Obtain velocity values from the accelerometer and gyro data. This is also a tough mathematical problem subject to drift and just yields the velocity relative to the wind field.

Do you understand that OSD:xSpeed is not the velocity along the X axis?

The .DAT found on the Fly App isn't encrypted. Take a look at Mavic Flight Log Retrieval and Analysis Guide
section 3. Log File retrieval
 
Last edited:
  • Like
Reactions: PilotNovel
Well, if you don't have any GPS data, either location or velocities, I can think of a few approaches. Unfortunately, they aren't very robust.

1) Use the vision system like some of the Tello pilots tried. That actually worked pretty well. Take a look here
Drone log
The problem is that the MA2 vision system decides that it's location solution is invalid a significant amount of the time.

2) Use pitch and roll as proxies for velocity. For 0.0 acceleration the velocity is solely dependent on the tilt angle. Note that 0.0 acceleration doesn't necessarily imply 0.0 velocity. This approach requires data found only in the .DAT. This is a very tough mathematical problem, subject to drift and just yields the velocity relative to the wind field.

3) Obtain velocity values from the accelerometer and gyro data. This is also a tough mathematical problem subject to drift and just yields the velocity relative to the wind field.

Do you understand that OSD:xSpeed is not the velocity along the X axis?

The .DAT found on the Fly App isn't encrypted. Take a look at Mavic Flight Log Retrieval and Analysis Guide
section 3. Log File retrieval
Sorry for late reply but I got some family problems and I couldn't answer earlier..
However thank you so much for the answer. It is very usefull: I was looking at .dat file and I want to ask you a thing:
If .txt files are created one for each flight (take off -> landed), are .dat files created one for every time I turn on/off the drone? It seems like that since I have the following graph
1679576560100.png
Moreover Motor_speeds are related to the power of rotors??? thank you for the answers!

NB: Why in the following graph I have 23 "signals" which might correpond to each flight, while I have 27 .txt files?
 
Sorry for late reply but I got some family problems and I couldn't answer earlier..
However thank you so much for the answer. It is very usefull: I was looking at .dat file and I want to ask you a thing:
If .txt files are created one for each flight (take off -> landed), are .dat files created one for every time I turn on/off the drone? It seems like that since I have the following graph
View attachment 161914
Moreover Motor_speeds are related to the power of rotors??? thank you for the answers!

NB: Why in the following graph I have 23 "signals" which might correpond to each flight, while I have 27 .txt files?
The .DAT starts recording when the MA2 connects to the Go 4 App and then stops recording when the MA2 is disconnected.

Generally, a higher motor speed will produce more thrust than a lower speed. But, that relationship can be non-linear.
 
  • Like
Reactions: PilotNovel
The .DAT starts recording when the MA2 connects to the Go 4 App and then stops recording when the MA2 is disconnected.

Generally, a higher motor speed will produce more thrust than a lower speed. But, that relationship can be non-linear.
Yeah thank you for the answer but why in your opinion I have 27 .txt while, apparently, the graph seems to contains only 23 flights in the .DAT?
For example: if I want to attribute the first value of motors (first hill) to a csv file in order to try to plot the path of the drone how can I do???
 
Senzanome.jpeg
Maybe I discovered a good thing: I was checking the time of .dat and it corresponds to the 5th fligh txt. After that there are 28 flights (.txt) as the "hills" in the .dat. Could be they associate???
Is it possible to associate these values to each timestamp of the related txt file?? In other words to associate the values of motors with the values of sensors
 
Last edited:

DJI Drone Deals

New Threads

Forum statistics

Threads
134,495
Messages
1,595,629
Members
163,019
Latest member
Mr. Jeff
Want to Remove this Ad? Simply login or create a free account