Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ROS Time and use_sim_time #350

@wjwwood

Description

@wjwwood

This issue will aggregate the work on a ROS Time object in the client libraries (C++ and Python) as well as implementing the simulated time similar to (if not exactly like) roscpp::Time + use_sim_time from ROS 1.


There is already a design doc about ROS Time here: http://design.ros2.org/articles/clock_and_time.html

This document describes use cases for having a time abstraction, rather than using system or language time interfaces directly. It also describes how we will implement something very similar to how /clock works in ROS 1 (at least for now) and that the "ROS Time" object will need to be created with, or gotten from, a Node object.

It also states that we will control when simulated time is turned on the same as with ROS 1, via a parameter called something like use_sime_time. Except in ROS 2, that parameter will be on each Node. It is an open question on how to make it easy to change that value globally, perhaps by also having nodes look at a "global" version of use_sim_time on a "global parameter server" node if present.

It was also decided, for now, that if a "ROS Time" object is asked the time before the node has created the subscription to /clock or before any data is received from /clock then it will return 0 (or the equivalent time point) until data is received. This is consistent with how ROS 1 does it, but I would be happy to entertain other possibilities.


TODO: Sketch of the API to placed here when we agree on it.


Things to do:

  • remove rcl_time_source_init()
    • rationale: since the "ros time" source needs to be initialized with a rcl_node_t as input, this method cannot serve all of the various time sources
    • i.e. the construction of a system time source is different from a ros time source and so they cannot share a common constructor
  • Finish the rclcpp::Time (or whatever it will be called) object
  • Make rclcpp::Time::now() no longer be static
  • TODO more things here I'm sure...

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