Skip to content

Respect the use_sim_time parameter for rclpy nodes #240

@dhood

Description

@dhood

There is support for Clocks that use ROS Time as described in this design document. It was added in this PR.

Clocks can be set to have ROS time "active" (will use the value seen on the /clock topic as its time) by calling time_source.ros_time_is_active = True.

A node has a time source associated with it (added in #210). At the time of that PR, parameters were not available in rclpy, so the node's time source does not respond to the use_sim_time parameter:

# TODO(dhood): use sim time if parameter has been set on the node.

As of #214, parameters are available in rclpy.

Tasks to get rclpy nodes to respond to the use_sim_time parameter:

  • Add a parameter callback that detects if use_sim_time has been set on the node.
  • Add tests that the node's clock output matches what's expected based on the combination of use_sim_time parameter and the presence of a /clock publisher. These are the tests in rclcpp.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions