bitcraze / crazyflie-lib-python

Python library to communicate with Crazyflie
Other
262 stars 895 forks source link

Logging RPM #448

Closed Omikaa closed 6 months ago

Omikaa commented 7 months ago

Can I use crazyflie-lib-python to log rpm of a nano-drone? I have seen the code of https://github.com/bitcraze/crazyflie-firmware/blob/master/src/deck/drivers/src/rpm.c#L323. And it says 'rpm.c - Deck that measure the motor RPM using QRD1114 IR reflector-sensor.'. So I wonder if I can log rpm like logging stateEstimate.x. ` # The definition of the logconfig can be made before connecting self._lg_stab = LogConfig(name='Stabilizer', period_in_ms=100) self._lg_stab.add_variable('stateEstimate.x', 'float') self._lg_stab.add_variable('stateEstimate.y', 'float') self._lg_stab.add_variable('stateEstimate.z', 'float') self._lg_stab.add_variable('stabilizer.roll', 'float') self._lg_stab.add_variable('stabilizer.pitch', 'float') self._lg_stab.add_variable('stabilizer.yaw', 'float')

The fetch-as argument can be set to FP16 to save space in the log packet

    self._lg_stab.add_variable('pm.vbat', 'FP16')

`

gemenerik commented 7 months ago

I am pretty sure this refers to a custom RPM deck we built several years ago. Afaik there is no way of determining the RPM on-board without a specialized RPM sensor.