Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dhood opened this issue Jul 17, 2018 · 2 comments · Fixed by #559
Closed

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

dhood opened this issue Jul 17, 2018 · 2 comments · Fixed by #559
Assignees
Labels
question Further information is requested

Comments

@dhood
Copy link
Member

dhood commented Jul 17, 2018

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.

@dhood dhood added the question Further information is requested label Jul 17, 2018
@dhood dhood self-assigned this Jul 17, 2018
@tfoote
Copy link
Contributor

tfoote commented Jul 25, 2018

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.

@dhood dhood added in progress Actively being worked on (Kanban column) in review Waiting for review (Kanban column) and removed in progress Actively being worked on (Kanban column) labels Sep 20, 2018
@dhood dhood removed the in review Waiting for review (Kanban column) label Sep 25, 2018
@dhood
Copy link
Member Author

dhood commented Sep 25, 2018

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

nnmm pushed a commit to ApexAI/rclcpp that referenced this issue Jul 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants