Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

ROS Time

Discussion in 'Robotics' started by wyattrees, Sep 16, 2022.

  1. wyattrees

    wyattrees

    Joined:
    Apr 5, 2021
    Posts:
    1
    Hello,

    Is there a way to get the ROS time (not system time) in Unity, as is done in C++ by rclcpp::Node::now()? I need to publish a TwistStamped message, which will only be used by the subscriber if the time indicated in the header isn't stale. I don't have the option of changing the subscriber to use system time instead of ROS time.

    Thanks!
    Wyatt
     
  2. LaurieUnity

    LaurieUnity

    Unity Technologies

    Joined:
    Oct 23, 2020
    Posts:
    77
    We don't currently have a system to manage this for you, but it shouldn't be too hard to write a subscriber that listens for ROS /clock messages and remembers the most recent one.