Skip to content

Our current version of LcmDrivenLoop might be getting old message #229

@yminchen

Description

@yminchen

Per discussion with @mposa, we should keep an eye on the issue of LcmDrivenLoop potentially getting old lcm messages.

Problem description:
After calling drake::lcm::Subscriber.clear() and LcmHandleSubscriptionsUntil() to wait for a new message, it's still possible that we read an old message when we call drake::lcm::Subscriber.message().
This problem is not critical unless the LcmDrivenLoop is intended to be run at a lower rate than the incoming message's rate.

Potentially the best solution:
The problem is probably caused by us running LcmHandleSubscriptionsUntil in the main thread. A solution could be running the lcm subscriber on a different thread so that it's constantly updating the message buffer.
https://github.com/RobotLocomotion/drake/blob/b09e40db4b1c01232b22f7705fb98aa99ef91f87/lcm/test/drake_lcm_thread_test.cc

Hacky solution:
Call clear() and LcmHandleSubscriptionsUntil() twice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions