Skip to content

Convert clock and time functions to pybind11#699

Merged
sloretz merged 2 commits intomasterfrom
pybind11_clock
Mar 9, 2021
Merged

Convert clock and time functions to pybind11#699
sloretz merged 2 commits intomasterfrom
pybind11_clock

Conversation

@sloretz
Copy link
Copy Markdown
Contributor

@sloretz sloretz commented Mar 5, 2021

Part of #665

Converts time_point and clock functions to pybind11. Along the way I fixed a signed/unsigned bug where python to C conversion allowed time values up to 2**64-1 to be set to be set, but the rcl_time_point_t struct only accepts up to 2**63-1 because the type is signed. I also replaced the ClockType and ClockChange enums with pybind11 ones to make the conversion between the C and python layer easier.

  • rclpy_create_time_point
  • rclpy_time_point_get_nanoseconds
  • rclpy_create_clock
  • rclpy_clock_get_now
  • rclpy_clock_get_ros_time_override_is_enabled
  • rclpy_clock_set_ros_time_override_is_enabled
  • rclpy_clock_set_ros_time_override
  • rclpy_add_clock_callback, METH_VARARGS
  • rclpy_remove_clock_callback, METH_VARARGS

@sloretz sloretz added the bug Something isn't working label Mar 5, 2021
@sloretz sloretz requested a review from cottsay March 5, 2021 23:30
@sloretz sloretz self-assigned this Mar 5, 2021
@sloretz sloretz mentioned this pull request Mar 5, 2021
34 tasks
Copy link
Copy Markdown
Member

@cottsay cottsay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments, but no blockers. Looks good!

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
Co-authored-by: Scott K Logan <logans@cottsay.net>
Signed-off-by: Shane Loretz <sloretz@openrobotics.org>
@sloretz
Copy link
Copy Markdown
Contributor Author

sloretz commented Mar 9, 2021

CI (build: --packages-up-to rclpy test: --packages-select rclpy)

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@sloretz
Copy link
Copy Markdown
Contributor Author

sloretz commented Mar 9, 2021

PR job looks like a flaky test. Merging! Edit, actually re-running to double check that it's flaky

@sloretz
Copy link
Copy Markdown
Contributor Author

sloretz commented Mar 9, 2021

@ros-pull-request-builder retest this please

@sloretz sloretz merged commit a8450a3 into master Mar 9, 2021
@delete-merged-branch delete-merged-branch bot deleted the pybind11_clock branch March 9, 2021 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants