Skip to content

API to get update timing #6886

@ShuffleWire

Description

@ShuffleWire

Hello,

Maybe the feature is already available, if so tell me.

I'm using sensors (GPS) that give info not every time step (usually every 1s). However, at each timestep I get the value of the last update, and I've no way of telling if it's the old value or if I'm simply standing still. So I have to implement another timer with the same period that warn me when my value are new. It's very inconvenient, and add synchronisation issue.

Use case : I have a simple GPS receiver that, IRL give me a message every 1sec. The rest of the time, I have no value, and my process know is should 'fill the gap", instead of relying on a steady value.

Would it be possible to know when the data is new ? Without breaking existing behaviour (return last value), I would simply add a new API targeting devices (bool wb_is_updated(WbDevice)), which say True at the timestep during which the value have been updated, and False otherwise.

What do you think ?

Cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImplementation of a minor feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions