0

I have a pixhawk flight controller. after a flight I collect the dataflash logs give it to a python script that gives me data like below

IMU sensor data

Now i just like to plot the approximate trajectory/ path of my UAV during the flight in a 3d space. it can be python, matlab or anything. what is the method/ steps. a simple sample that looks like what i am trying to acheive is youtube link

Ahmed Nawaz Khan
  • 1,451
  • 3
  • 20
  • 42
  • What would be the coordinates in the 3D space of a single point in relation to the variables xgyro,cgyro,...,xacc,xmag,....zmag and what each of them stands for? Also does this actually have to do with computer vision? – tryman Apr 02 '19 at 09:16
  • i dont know about computer vision but the values are the "gyroscope xyz components" , "acceleorometer xyz components" and "magnetometer xyz components" – Ahmed Nawaz Khan Apr 02 '19 at 09:26
  • Have you tried anything yourself? If yes, what did you try and where are you stuck? Do you know how to get the coordinates you want to plot from the info you provided? I mean, at a specific time from set of gyroscope xyz components, accelerometer xyz components, magnetometer xyz components do you know how to get the x,y,z coordinates you want to plot? If yes, please write so. If not, this seems to be consisting of two separate questions, 1) how to get the the relative x,y,z position from the gyroscope/accelerometer/magnometer xyz and 2) how to plot it – tryman Apr 02 '19 at 11:59
  • An idea would be to assume that velocity `v` at the end of an interval `dt` is approximated by `v_x = v_x_previous + xacc * dt`. For that you need the interval `dt` and the initial velocity components `v0_x`, `v0_y`, `v0_z` that you do not provide in your question. Then, having the velocities at each step, you can approximate the relative position, as `x = x_prev + v_x * dt`. (1/2) – tryman Apr 02 '19 at 12:15
  • This is actually a [forward Euler scheme](). You can use a backwards Euler or an average (i.e. `x_next = x_prev + (xacc_prev+xacc_next)/2 *dt`) as well. However, all the previous suggestions are based on the fact that the measured accelerations are on an absolute coordinate system. If this is relevant to the UAV itself (i.e. the xyz system is based on the UAV's rotation) then you have to take into account the gyro coordinates in a similar fashion to transform the accelerometer's values to an absolute system first. (2/2) – tryman Apr 02 '19 at 12:22
  • It may be me (as this is not my field) but if the things I had to make assumptions for are not standard practice then your question is very unclear in the first place. You would get more answers if you were exact and detailed in your description and your problem's parameters. As it stands, it seems too broad with possibilities on what you are trying to do (again, it may be just me if these are standard conventions in the UAV field). – tryman Apr 02 '19 at 12:25
  • well I asked the question for the reason I don't know anything about it. If i would why would I ask? I just know that I have the data and my job is to get a path of my UAV. for that i need the workflow/ guide/ steps. – Ahmed Nawaz Khan Apr 02 '19 at 16:54
  • and we can do the initial velocity/ poisition to 0. the data is relative to UAV and not to the Earth reference – Ahmed Nawaz Khan Apr 02 '19 at 16:55
  • I just know 1 idea of the double integration of acceleration to get position – Ahmed Nawaz Khan Apr 02 '19 at 17:03

0 Answers0