getting roll, pitch and yaw separate with logging

Firmware/software/electronics/mechanics
Post Reply
vovo
Beginner
Posts: 3
Joined: Wed Jul 20, 2016 10:27 pm

getting roll, pitch and yaw separate with logging

Post by vovo »

Hi!
the ¨data¨ from _stab_log_data in the basiclog.py example gives stabilizer.roll, stabilizer.pitch and stabilizer.yaw all mixed inside brackets. How can I separate them into float variables lets say roll, pitch and yaw? Any help will be much appreciated :D
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: getting roll, pitch and yaw separate with logging

Post by arnaud »

Hi,

data is a python dictionary so you will be able to index it with the variable name to access the different values. In this case:

Code: Select all

roll = data["stabilizer.roll"]
pitch = data["stabilizer.pitch"]
yaw = data["stabilizer.yaw"]
Ps. This is untested code so there might be bug, tell me if it does not work and I can test it ;-)
vovo
Beginner
Posts: 3
Joined: Wed Jul 20, 2016 10:27 pm

Re: getting roll, pitch and yaw separate with logging

Post by vovo »

Thanks, arnaud.
Post Reply