Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start function for drivers #59

Open
dorian3d opened this issue Dec 3, 2014 · 0 comments
Open

Start function for drivers #59

dorian3d opened this issue Dec 3, 2014 · 0 comments

Comments

@dorian3d
Copy link
Collaborator

dorian3d commented Dec 3, 2014

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();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant