-
Notifications
You must be signed in to change notification settings - Fork 412
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
Add clock type to node_options #1982
Add clock type to node_options #1982
Conversation
7eb5651
to
d22dfac
Compare
NOTE: this PR is from iRobot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm with test for NodeOption
53af9d5
to
bca2d75
Compare
Forgive me if I misunderstand this PR, but I think being able to have |
@asymingt the purpose of this PR is to allow to set the node clock type. Currently, you must use a clock of type "ros" for a node. There are a lot of applications where a real time clock is not suitable and it is required to use a monotonic clock (and as said before, the "ros" clock is not monotoni) |
Understood. Thank you, and sorry for the distraction. |
@fujitatomoya I think that comments have been addressed. |
either @iuhilnehc-ynos or @Barry-Xu-2018 , could you help us review on this? I was thinking that, i may be missing something.
CC: @alsora @jefferyyjhsu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor nitpick
@fujitatomoya I agree on having the clock type to be used as the default clock type for timers... I was assuming that it was already the case. About simulated time: users should be able to turn it on/off UNLESS they manually set the node clock to monotonic... In that case simulated time is not currently expected to work and it should throw an exception/error somewhere. |
87e1e0b
to
bd57012
Compare
Hi, are there any more changes that we should address before proceeding with this PR? |
@alsora @jefferyyjhsu sorry to be late, just left couple of comments. |
906bbf2
to
bee7cf3
Compare
@ivanpauno can you also take a look at this, this changes behavior a bit. CC: @clalancette |
@jefferyyjhsu can you address DCO issue? |
755638a
to
f369888
Compare
@fujitatomoya , yeah. Sorry, I did remember to fix it by rebasing it locally but forgot to finish it before pushing. |
The windows failure happens also in a completely unrelated PR #1979 |
See #1979 (comment) |
…ctor accordingly Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com>
…. Add test cases. Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com>
ros_time_active_ in ClocksState::attachClock() Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com>
Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com>
Following the reasoning in c54a6f1, on_set_parameters doesn't try to enforce use_sim_time to be of boolean type explicitly. Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com>
Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com>
Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com>
f369888
to
49eeb45
Compare
Ping; can we merge this PR? |
Erm.. I'm getting the same issue locally as the Rpr job Something is causing the callback test to fail, though it happens sporadically |
Pinging @jefferyyjhsu |
@methylDragon, sorry for the delay. I tried reproducing the error with
|
Hey there! I am also running it with It definitely shows up on the buildfarm though; though sporadically |
I think that test has been flaky for a long time (before this PR was merged), I don't think the failure is related to these changes. |
Ah, okay, disregard my comment then! Sorry for the noise 🙇 |
* add clock type to node_options and change node/lifecycle_node constructor accordingly Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * Modify TimeSource::NodeState class to work with different clock types. Add test cases. Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * Change on_parameter_event to output RCLCPP_ERROR and check ros_time_active_ in ClocksState::attachClock() Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * Remove a redundant include Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * Disallow setting use_sim_time to true if a clock_type can't support it. Following the reasoning in c54a6f1, on_set_parameters doesn't try to enforce use_sim_time to be of boolean type explicitly. Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * minior style change Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * remove reason string for successful result Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com>
* add clock type to node_options and change node/lifecycle_node constructor accordingly Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * Modify TimeSource::NodeState class to work with different clock types. Add test cases. Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * Change on_parameter_event to output RCLCPP_ERROR and check ros_time_active_ in ClocksState::attachClock() Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * Remove a redundant include Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * Disallow setting use_sim_time to true if a clock_type can't support it. Following the reasoning in c54a6f1, on_set_parameters doesn't try to enforce use_sim_time to be of boolean type explicitly. Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * minior style change Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * remove reason string for successful result Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com>
* add clock type to node_options and change node/lifecycle_node constructor accordingly Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * Modify TimeSource::NodeState class to work with different clock types. Add test cases. Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * Change on_parameter_event to output RCLCPP_ERROR and check ros_time_active_ in ClocksState::attachClock() Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * Remove a redundant include Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * Disallow setting use_sim_time to true if a clock_type can't support it. Following the reasoning in c54a6f1, on_set_parameters doesn't try to enforce use_sim_time to be of boolean type explicitly. Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * minior style change Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * remove reason string for successful result Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com>
* add clock type to node_options and change node/lifecycle_node constructor accordingly Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * Modify TimeSource::NodeState class to work with different clock types. Add test cases. Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * Change on_parameter_event to output RCLCPP_ERROR and check ros_time_active_ in ClocksState::attachClock() Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * Remove a redundant include Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * Disallow setting use_sim_time to true if a clock_type can't support it. Following the reasoning in c54a6f1, on_set_parameters doesn't try to enforce use_sim_time to be of boolean type explicitly. Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * minior style change Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * remove reason string for successful result Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com>
* add clock type to node_options and change node/lifecycle_node constructor accordingly Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * Modify TimeSource::NodeState class to work with different clock types. Add test cases. Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * Change on_parameter_event to output RCLCPP_ERROR and check ros_time_active_ in ClocksState::attachClock() Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * Remove a redundant include Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * Disallow setting use_sim_time to true if a clock_type can't support it. Following the reasoning in c54a6f1, on_set_parameters doesn't try to enforce use_sim_time to be of boolean type explicitly. Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * minior style change Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> * remove reason string for successful result Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com> Signed-off-by: Jeffery Hsu <jefferyyjhsu@gmail.com>
Signed-off-by: Jeffery Hsu jefferyyjhsu@gmail.com
This PR adds the option for selecting clock source in Node/LifecycleNode thru NodeOptions.
A similar option is already present in rclcpp::Timer but it is currently missing in Nodes/LifecycleNode. There's currently no way to set Node::now() and all other time-related functions to use clock sources other than ROS_TIME.