Skip to content

Lifecycle nodes don't use simulation time when use_sim_time set #641

Closed

Description

@mjeronimo

Bug report

Required Info:

  • Operating System: Ubuntu 18.04
  • Installation type: source
  • Version or commit hash: 10d7b7c
  • DDS implementation: Fast-RTPS
  • Client library (if applicable): rclcpp

Steps to reproduce issue

  • Set use_sim_time parameter on a LifecycleNode
  • Later, in a message callback, for example, print out the value of node->now()

Expected behavior

The time would be relative to the simulation clock

Actual behavior

It is relative to the system clock

Activity

  1. Karsten1987 commented on Feb 27, 2019

    @Karsten1987
    Contributor

    @mjeronimo is this issue related to #642? Or can you correctly set the use_sim_time parameter?

    Also, would you mind providing a reproducible example here?

  2. mjeronimo commented on Feb 27, 2019

    @mjeronimo
    Author

    @Karsten1987 No, not related to #642. Yes, I'll come up with an example for you.

  3. mjeronimo commented on Mar 2, 2019

    @mjeronimo
    Author

    @Karsten1987

    • Use the lifecycle demo from https://github.com/ros2/demos/tree/master/lifecycle
    • Replace lifecycle_talker.cpp with the attached file and build
    • Launch gazebo. For example, I used: gazebo --verbose -s libgazebo_ros_init.so ~/src/turtlebot3/src/turtlebot3_simulations/turtlebot3_gazebo/worlds/turtlebot3.world
    • Run the lifecycle demo as normal

    Once the lifecycle node is activated, the output shows that the lifecycle node's time is the system time, while the normal node's time is relative to /clock. Both nodes have use_sim_time set (see the code).

    lifecycle_talker.cpp.tar.gz

  4. Karsten1987 commented on Mar 26, 2019

    @Karsten1987
    Contributor

    with #651 being merged can this issue be closed?

  5. mjeronimo commented on Mar 27, 2019

    @mjeronimo
    Author

    @Karsten1987 Yes, that one fixes it and this issue can be closed.

  6. added a commit that references this issue on Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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