-
Notifications
You must be signed in to change notification settings - Fork 139
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 support for clocks #121
Comments
Quick clarification... I need to create a |
Can someone let me know if I'm going in the right direction? so that I can make changes in case I'm wrong? |
@DS3a appreciate the question. So, you should use the functions from time.c, via our generated bindings, but rclrs should not just wrap the functions 1:1. That would not be an optimal API. For instance, you should make use of the Rust standard library facilities (like the I'd also recommend to tackle this issue in smaller steps, not port the full functionality at once. Hope this helps. Let us know if you have further questions! |
Okay, that makes sense... I'll look into |
@DS3a to understand better how time is handled in ROS2, you can also have a look at https://design.ros2.org/articles/clock_and_time.html Regarding types, using |
Got it... I did start looking into it to get ideas as to how to implement it in rust... I've started building Here is the file. I have yet to add implementations for the operators which have to be performed on it... I thought of starting with the constructors and stuff. Now rust doesn't allow function overloading which could have been used for the |
Could you explain in more detail? In what instance would it be beneficial to not use |
I don't think there is an instance where it wouldn't be beneficial... although if I were to nitpick; using it would require type casting from Also, apologies... I might have been unclear with my question. I didn't want to avoid Also... In the future (for some other functionality) where it might be mandatory to prove different ways to initialize, should I create multiple functions with different names? or create an enum to act as an argument? |
@DS3a I suggest you start implementing support for clocks as you think is appropriate and then we can provide you with feedback, I'm really not a fan micromanaging contributions, it just creates a lot of interference. But of course, if you need advice, we're more than happy to help 🙂 |
Okay... I'll start implementing it with minimal interference. I'll start adding examples where I think further explanation is required. I'm guessing that works. Thanks. I shall post questions if I have any queries/require advice. |
I've finished implementing Although, I don't know how far that would be going? Is it common practice to write wrappers around standard libraries? or rewrite them to suit the users' needs? |
Here's the repository I forked from here to add support for time: https://github.com/DS3a/ros2_rust.git can someone let me know if I'm going in the right direction? |
Hey @DS3a, I'll take a look today. |
@DS3a could you submit a PR against |
@DS3a also, before you submit the PR, I'd advice you rename the branch where you're making the changes. Right now your changes are in the |
okay... gimme a sec |
Thanks 🙂 |
ahhh... makes sense... I'll make another pr |
Perfect! Thank you so much |
See https://github.com/ros2/rcl/blob/master/rcl/include/rcl/time.h
Since this is a complex feature, it would be good to have some prior experience with the code base and/or seek early-stage feedback from other contributors.
The text was updated successfully, but these errors were encountered: