Skip to content

Start function for drivers #59

@dorian3d

Description

@dorian3d

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();

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions