FP16 in Log
Posted: Tue Jan 12, 2016 2:14 pm
Hi, I'm trying to use the FP16 data type for logging. Here's the log config setup I'm trying to use:
However the data I get is just total gibberish, it makes no sense even if the crazyflie is sitting flat on a table.
If I set the type to FLOAT, it works fine, but I need to include more data in the packet (the commented-out lines) so I need to use the FP16. Variables acc.x,y,z, gyro.x,y,z and mag.x,y,z are left unchanged in stabilizer.c. If I understand correctly, in this case the log framework should be automatically translating the internal data type to FP16 before transmitting from the CF, and then converting back to float upon receiving by the python library. But there seems to be a problem with that.
Also, I'm using the multilink branch from here viewtopic.php?f=9&t=624&p=7919&hilit=multilink#p7919 since in the future I'll want to communicate with multiple crazyflies. As that fork hasn't been updated in quite a while, is it possible that this has been fixed in the official branch?
Edit: I just tried it with the newest official master branch and the results are the same.
Can anybody help me?
Code: Select all
self.imu_log = LogConfig(name="IMU", period_in_ms=30)
imu_type="FP16"
imu_log.add_variable("acc.x", imu_type)
imu_log.add_variable("acc.y", imu_type)
imu_log.add_variable("acc.z", imu_type)
imu_log.add_variable("gyro.x", imu_type)
imu_log.add_variable("gyro.y", imu_type)
imu_log.add_variable("gyro.z", imu_type)
#imu_log.add_variable("mag.x", imu_type)
#imu_log.add_variable("mag.y", imu_type)
#imu_log.add_variable("mag.z", imu_type)
Code: Select all
[27544][IMU]: {'gyro.y': -21552, 'gyro.x': 0, 'gyro.z': 0, 'acc.x': -24192, 'acc.y': 6400, 'acc.z': 15329}
[27574][IMU]: {'gyro.y': 0, 'gyro.x': 12764, 'gyro.z': 11216, 'acc.x': -24224, 'acc.y': 6272, 'acc.z': 15327}
[27604][IMU]: {'gyro.y': 11216, 'gyro.x': 11216, 'gyro.z': -21552, 'acc.x': -24256, 'acc.y': 6528, 'acc.z': 15329}
Also, I'm using the multilink branch from here viewtopic.php?f=9&t=624&p=7919&hilit=multilink#p7919 since in the future I'll want to communicate with multiple crazyflies. As that fork hasn't been updated in quite a while, is it possible that this has been fixed in the official branch?
Edit: I just tried it with the newest official master branch and the results are the same.
Can anybody help me?