Hi guys!
I am quite new of Crazyflie firmware. I'm using a crazyflie 1.0, 10 DOF, and I'm trying to get the absolute orientation of the quadorotor from the crazyflie official client, sadly for what i can see the orientation in quaternion form is not streamed, i can access only to angular acceleration and linear velocity, it's right? If this is the case, do you know if there is a way to access to orientation data?
All the best
[SOLVED] Absolute orientation from client
[SOLVED] Absolute orientation from client
Last edited by jcacace on Sun Jan 04, 2015 9:54 pm, edited 1 time in total.
Re: Absolute orientation from client
You mean the absolute yaw value (like a compass)? In the UI you can see the yaw value in the "actual" column.
The range is [-180,180].
You should also be able to get this value out of the flie using the logging system. You can see all available values by enabling the "Log TOC" tab. Probably the value is "stabilizer.yaw".
The range is [-180,180].
You should also be able to get this value out of the flie using the logging system. You can see all available values by enabling the "Log TOC" tab. Probably the value is "stabilizer.yaw".
Re: Absolute orientation from client
Hi,
Like dbrgn said the data should be available in the client. If there's some other data you are missing have a look at this video tutorial showing how to add variables to the logging data. The orientation in quaternion is not logged, only the roll/pitch/yaw is. Have a look at this file where the calculations are done. If you are interested in any particular data then add it to the logging framework by using the following code:
Where mygroup and myvar can be choosen by you and actualvar and LOG_FLOAT should match the code.
Like dbrgn said the data should be available in the client. If there's some other data you are missing have a look at this video tutorial showing how to add variables to the logging data. The orientation in quaternion is not logged, only the roll/pitch/yaw is. Have a look at this file where the calculations are done. If you are interested in any particular data then add it to the logging framework by using the following code:
Code: Select all
LOG_GROUP_START(mygroup)
LOG_ADD(LOG_FLOAT, myvar, &actualvar)
LOG_GROUP_STOP(mygroup)
Re: Absolute orientation from client
Dear all,
Thank you so much for the replies, they are really perfect and now my mind is more clear about the communication with the pc.
I can use directly the stabilizer data, so i don't need to add other variables for the quaternion calculater in the sensorfusion.
Sadly I am addressing a problem trying to read data from a python code using the cfilb. I am able to download correctly the Imu or battery data, but the stabilizier class of data seems to be not present in the TOC, but if i connect with the client to the crazyflie and open the TOC tab, i can see the raw of the stabilizer data... i will attach the code that i use to create a callback to read the stabilizer data:
If i run this code, the errore message is printed... so my configuration seems to be not valid, any suggestion?
Thank you so much for the replies, they are really perfect and now my mind is more clear about the communication with the pc.
I can use directly the stabilizer data, so i don't need to add other variables for the quaternion calculater in the sensorfusion.
Sadly I am addressing a problem trying to read data from a python code using the cfilb. I am able to download correctly the Imu or battery data, but the stabilizier class of data seems to be not present in the TOC, but if i connect with the client to the crazyflie and open the TOC tab, i can see the raw of the stabilizer data... i will attach the code that i use to create a callback to read the stabilizer data:
Code: Select all
self._lg_stab = LogConfig(name="stabilizier", period_in_ms=10)
self._lg_stab.add_variable("stabilizier.roll", "float")
self._cf.log.add_config(self._lg_stab)
if self._lg_stab.valid:
self._lg_stab.data_received_cb.add_callback(self._log_data_stab)
self._lg_stab.error_cb.add_callback(self._log_error)
self._lg_stab.start()
else:
rospy.logfatal("Could not add logconfig stab since some variables are not in TOC")
Re: Absolute orientation from client
Might it just be a matter of spelling...?
I see stabilizer in my TOC (vs. stabilizier in your code) - see attached picture.
I see stabilizer in my TOC (vs. stabilizier in your code) - see attached picture.
Crazyflier - my CF journal...
4x Crazyflie Nano (1.0) 10-DOF + NeoPixel Ring mod.
3x Crazyflie 2.0 + Qi Charger and LED Decks.
Raspberry Pi Ground Control.
Mac OS X Dev Environment.
Walkera Devo7e, ESky ET6I, PS3 and iOS Controllers.
4x Crazyflie Nano (1.0) 10-DOF + NeoPixel Ring mod.
3x Crazyflie 2.0 + Qi Charger and LED Decks.
Raspberry Pi Ground Control.
Mac OS X Dev Environment.
Walkera Devo7e, ESky ET6I, PS3 and iOS Controllers.
Re: Absolute orientation from client
Oh my God... what a shame!
Thank you chad... i solved the problem now!
Thank you chad... i solved the problem now!
Re: Absolute orientation from client
No shame in it at all!! Happy that it's solved.jcacace wrote:Oh my God... what a shame!
Thank you chad... i solved the problem now!
Crazyflier - my CF journal...
4x Crazyflie Nano (1.0) 10-DOF + NeoPixel Ring mod.
3x Crazyflie 2.0 + Qi Charger and LED Decks.
Raspberry Pi Ground Control.
Mac OS X Dev Environment.
Walkera Devo7e, ESky ET6I, PS3 and iOS Controllers.
4x Crazyflie Nano (1.0) 10-DOF + NeoPixel Ring mod.
3x Crazyflie 2.0 + Qi Charger and LED Decks.
Raspberry Pi Ground Control.
Mac OS X Dev Environment.
Walkera Devo7e, ESky ET6I, PS3 and iOS Controllers.