how to receive x,y,z Data through UART2

Firmware/software/electronics/mechanics
Post Reply
juju
Beginner
Posts: 7
Joined: Mon Nov 11, 2019 4:19 am

how to receive x,y,z Data through UART2

Post by juju »

hi guys. i'd like to receive x,y,z attitude data through UART2.
The communication is now successful.
i used 'uart2SendData'.
What files should I go further and access and modify?

thanks!
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: how to receive x,y,z Data through UART2

Post by arnaud »

If you already have working communication, you can get the X/Y/Z position estimate using the LOG API. From within the Crazyflie you can read log variable in 2 steps: first get the log ID, then read the log values using the ID.

You can see an example of that in the push demo: https://github.com/ataffanel/crazyflie- ... .c#L63-L83.

The Crazyflie position is available in the log variables "stateEstimate.x/y/z".
Post Reply