Conversation
Contributor
Author
|
Taking out of review, changes coming |
callbacks on ROS time activation or deactivation callbacks on forward time jumps callbacks on backward time jumps
956c663 to
8c50120
Compare
Contributor
Author
dirk-thomas
reviewed
Aug 28, 2018
| original_callback(TimeJump(clock_change, duration)) | ||
|
|
||
| if post_callback is not None and callable(post_callback): | ||
| post_callback = callback_shim |
Member
There was a problem hiding this comment.
Should the callback_shim function only be defined when it is necessary within the if block?
rclpy/rclpy/clock.py
Outdated
| handler = JumpHandle( | ||
| clock=self._clock_handle, threshold=threshold, pre_callback=pre_callback, | ||
| post_callback=post_callback) | ||
| return handler |
Member
There was a problem hiding this comment.
Nitpick: return the `JumpHandle(...) directly.
rclpy/src/rclpy/_rclpy.c
Outdated
| clock_change = "RCL_SYSTEM_TIME_NO_CHANGE"; | ||
| break; | ||
| default: | ||
| PyErr_Format(PyExc_RuntimeError, "Unknown time jump type"); |
Member
There was a problem hiding this comment.
Nitpick: including the unexpected value in the message helps if the problem occurs.
rclpy/test/test_clock.py
Outdated
| pre_callback2.assert_called() | ||
| post_callback2.assert_called() | ||
| pre_callback2.assert_called() | ||
| post_callback2.assert_called() |
Member
There was a problem hiding this comment.
Are these two lines supposed to check 3 instead of 2?
Same below.
rclpy/test/test_time_source.py
Outdated
| post_cb = Mock() | ||
| threshold = JumpThreshold( | ||
| min_forward=Duration(seconds=0.5), min_backward=None, on_clock_change=False) | ||
| handler = clock.create_jump_callback( # noqa |
Member
There was a problem hiding this comment.
Nitpick: only suppress the expected code instead of everything.
Same below.
dirk-thomas
approved these changes
Aug 28, 2018
Contributor
Author
Member
|
I noticed that the tests added in this PR seem to fail on xenial release nightlies: ros2/build_farmer#147 |
8 tasks
7 tasks
ryantqiu
pushed a commit
to snorkel-marlin-repos/ros2_rclpy_pr_222_5b5d8f40-2caf-46ba-8ab3-51323a0e57e9
that referenced
this pull request
Oct 1, 2025
Original PR #222 by sloretz Original: ros2/rclpy#222
ryantqiu
added a commit
to snorkel-marlin-repos/ros2_rclpy_pr_222_5b5d8f40-2caf-46ba-8ab3-51323a0e57e9
that referenced
this pull request
Oct 1, 2025
Merged from original PR #222 Original: ros2/rclpy#222
ryantqiu
pushed a commit
to snorkel-marlin-repos/ros2_rclpy_pr_222_c0c34138-671f-4cb5-a12e-1cf2e8dc5b10
that referenced
this pull request
Oct 2, 2025
Original PR #222 by sloretz Original: ros2/rclpy#222
ryantqiu
added a commit
to snorkel-marlin-repos/ros2_rclpy_pr_222_c0c34138-671f-4cb5-a12e-1cf2e8dc5b10
that referenced
this pull request
Oct 2, 2025
Merged from original PR #222 Original: ros2/rclpy#222
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds callbacks when ROSTime jumps. The implementation closely mimics the implementation in
rclcpp.Time jump callbacks use the
rcl_clock_ttime jump callbacks. Python code is called in the callbacks usingPyObject_CallObject().Requires ros2/rcl#284