Comments (4)
I usually have a version of the decompress in my cfusdlog decoder (since I only use these with the usd card).
# decompress a quaternion, see quatcompress.h in firmware
# input: 32-bit number, output q = [x,y,z,w]
def quatdecompress(comp):
q = np.zeros(4)
mask = (1 << 9) - 1
i_largest = comp >> 30
sum_squares = 0
for i in range(3, -1, -1):
if i != i_largest:
mag = comp & mask
negbit = (comp >> 9) & 0x1
comp = comp >> 10
q[i] = mag / mask / np.sqrt(2)
if negbit == 1:
q[i] = -q[i]
sum_squares += q[i] * q[i]
q[i_largest] = np.sqrt(1.0 - sum_squares)
return q
I think using FP16, or any other generic compression technique would be much nicer than having the *Z log topics hanging around. However, one would need to double check what the precision impact of that would be.
from crazyflie-lib-python.
Ah thanks! Yeah it would be good to figure it out indeed. the StateEstimateZ logs are not core log variables so we can tranfer to FP16 should be sufficient. Let's investigate
from crazyflie-lib-python.
Hmm... I'm afraid that we probably would need to implement a quadcompress/decompress in the cfilb because of this issue #372. The compressed quat is part of the full state setpoint sent and if we want to implement that into cflib we need those functions too
from crazyflie-lib-python.
this was fixed in #382
from crazyflie-lib-python.
Related Issues (20)
- Fullstate setpoint implementation HOT 4
- remove any highlevel commander start parameters in scripts HOT 2
- Enforce CPX version
- motion commander, start_linear_motion reverse yaw HOT 2
- Fixes to the wall following demo
- qualisys hl commander error HOT 11
- CI should test examples
- Velocity and acceleration controllers for crazyflie with motion capture system. HOT 4
- Streaming Ranging Distance Info from the Localization Class Using the Python Library HOT 2
- Add other mocap examples minimal HOT 3
- Why it reminded me "Could not add Measurement log config, bad configuration"๏ผwhen I added a new log variable ? HOT 2
- Open multiple plotting instances HOT 1
- motion commanderf wo context manager fails on reconnect.
- python 3.12, can't compile due to missing packages HOT 2
- Convert gui examples to QT6
- Mocap example for multiple crazyflies
- wall follower bug
- Position setpoint handling in flavor of motioncommander
- send_full_state_setpoint fails to move in x and y directions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crazyflie-lib-python.