Skip to content

Nodes default to using ROS time if /clock is published #514

Closed

Description

@dhood

The presence of a publisher on the /clock topic causes nodes with unset use_sim_time parameter value to start using sim time. See this test.

I haven't found a discussion where we decided that should be the case, so wanted to highlight the current state of ROS time being "opt out" instead of "opt in" and verify it's what we want.

Activity

  1. added
    question
    on Jul 17, 2018
  2. self-assigned this
    on Jul 17, 2018
  3. tfoote commented on Jul 25, 2018

    @tfoote
    Contributor

    This was the original behavior in ROS. But it looks like it was updated circa 2010 to require the parameter to be set before startup of the node otherwise it won't subscribe to /clock instead of that just being best practice. We should probably switch to the existing behavior where the parameter is required to subscribe. Though I might suggest that we not require it prior to launch since we can now get a callback on a parameter change. And subscribe if the parameter is set to true.

  4. added
    in progress
    in review
    and removed
    in progress
    on Sep 20, 2018
  5. removed
    in review
    on Sep 25, 2018
  6. dhood commented on Sep 25, 2018

    @dhood
    MemberAuthor

    the use_sim_time solely is what determines if ROS time is active in #559. /clock subscription is only created if it is set to true. Parameter callbacks are used, so this subscription will be created if the parameter is set at any time during the lifetime of the node, and removed if the parameter is set to false.

    ros2/rclpy#240 tracks doing something similar in rclpy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

question

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions