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
getting roll, pitch and yaw separate with logging
getting roll, pitch and yaw separate with logging
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
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
Re: getting roll, pitch and yaw separate with logging
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:
Ps. This is untested code so there might be bug, tell me if it does not work and I can test it 
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"]Re: getting roll, pitch and yaw separate with logging
Thanks, arnaud.