Dear all,
using the crazyflie python library API (cflib) I can control the copter very easy. I use the logging functionality to read the sensors information and I send the control signals to the copter by commands like send_setpoint(roll, pitch, yaw, thrust). In this case, the control system works in a periodic way.

Now I'm interested in checking event-based controllers in the Crazyflie 2.0 plataform. To do this, I need that the copter send the sensors information to the computer asynchronously. It means that the sensors information is received only when a certain condition is fulfilled (e.g. when the real altitude of the copter minus the reference altitude is greater than a certain threshold). On the other hand, when a command is sent to the copter (e.g. send_setpoint) this order has to be act in the copter indefinitely until a new command is sent again.

Does somebody know how to implement it in the crazyflie 2.0 platform?, Is it possible?

For a generic solution, we have been thinking about event-based log before and this is one generic architecture I came up with:
- Adding an event subsystem that looks very much like the log and param subsystem: modules can create and register an event, the event table of content can be read from the ground associating a group.name with and event_id the same way log and param TOC is read. The event is triggered by the module that created it, for example the sensors module can trigger the event "sensors.imu_read" just after reading the IMU.
- Log block can be setup to be sent on event instead of rate by passing an event_id when the block is started (this requires adding a new packet to start log blocks). The log subsystem will then register a callback function as a receiver of the event and send a log packet each time the event is triggered.

This was though as a solution to log IMU data synchronously with the IMU readings but it seems that it would fit your use-case too: your code can create events for different things and then from the client side you can setup log blocks that are being sent on these events.