how to get position x,y and z from the CF acceleration

Firmware/software/electronics/mechanics
Post Reply
anasios
Beginner
Posts: 14
Joined: Fri Nov 06, 2015 3:41 pm

how to get position x,y and z from the CF acceleration

Post by anasios »

hello everyone,

I have been developing a python script which can retrieve the CF acceleration following x,y and z, and i wanna know how to calculate position by focusing on these measurements.

Thank you in advance.
Last edited by anasios on Fri Nov 27, 2015 1:24 pm, edited 1 time in total.
Che.
Member
Posts: 62
Joined: Tue Jul 28, 2015 1:47 pm
Location: Germany

Re: how to get position x,y and z from the CF acceleration

Post by Che. »

hi,
calculating position must be relative to something. you want to calculate the position of the crazyflie in relation to what?

greets
anasios
Beginner
Posts: 14
Joined: Fri Nov 06, 2015 3:41 pm

Re: how to get position x,y and z from the CF acceleration

Post by anasios »

In fact, we have to plot the Crazyflie trajectory in 3D on Matlab (i did it by getting the acceleration). However, I have to do it by getting the position x,y,z . Have I to calculate the second derivative of my x,y and z acceleratio values ?

thanks in advance.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: how to get position x,y and z from the CF acceleration

Post by arnaud »

Hi,

The acceleration is not enough because the platform is rotating as well so if you want to calculate the position in the frame of the room you also need the platform orientation, you can also get it from the log subsystem.

I guess the doing two integration on the acceleration translated in the room frame of reference will give you some result. Though it will not be precise. If you get any results on that I am curious to know about it.
anasios
Beginner
Posts: 14
Joined: Fri Nov 06, 2015 3:41 pm

Re: how to get position x,y and z from the CF acceleration

Post by anasios »

I have managed to get position along the x,y and z axis. However, this trajectory is relative to the body frame(the CF frame) and in order to get it in the inertial frame which it's relative to the ground, I think we have to multiply it by the rotation matrix . It seems complicated to calculte upon having 300 data position to handle !!
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: how to get position x,y and z from the CF acceleration

Post by arnaud »

The amount of data point should not be a problem, for each step of the integration I guess you can calculate the rotation matrix and apply a rotated acceleration.
Post Reply