Page 1 of 1

getting roll, pitch and yaw separate with logging

Posted: Thu Jul 21, 2016 12:53 am
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

Re: getting roll, pitch and yaw separate with logging

Posted: Thu Jul 21, 2016 1:03 pm
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 ;-)

Re: getting roll, pitch and yaw separate with logging

Posted: Fri Jul 22, 2016 1:43 am
by vovo
Thanks, arnaud.