-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Labels
Description
IMU drivers are usually used like this:
hal::IMU imu(driver_url);
RegisterIMUDataCallback(my_callback_function);
Here, the driver is created first and the callback function is registered later. Now, drivers usually start reading data when they are instantiated. This is a problem for CsvDriver because it can read all the data before any callback function is registered, so consuming all. The PR #58 workarounds this here, but I don't think it is enough because even if the callback function is registered, the application may not be still ready (this was happening in vicalib).
Would it be worth it considering changing the design of the drivers so they have a Start function?
For example:
hal::IMU imu(driver_url);
RegisterIMUDataCallback(my_callback_function);
imu.start();