-
Notifications
You must be signed in to change notification settings - Fork 170
Crystal and more #3
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
Conversation
@lelongg whoa, this is so great, thank you so much! Do you think you could split this into smaller and more focused pull requests? Given that your changes started in December, I think it's doable. It'll make it much easier for me to review, I'll make a few comments in this PR, though. |
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.
Overall it's in the right direction, but I haven't had time to properly review it all, please split up this pull request into smaller ones. I left a few comments, please use this feedback in future contributions.
Most concerns should have been addressed.
Solution was to add rosidl_default to the workspace. |
@lelongg thank you so much for taking the time to address my feedback. Don't worry about splitting up the PR, it'd make it easier sure, but the work you've done is excellent. Let me have a couple of days to review it all and if I don't get back to you, feel free to ping me again. Thanks! |
register the 'rosidl_generator_rs'
Hi @lelongg, I've been trying out your branch. It's very cool and the examples are working great. But I've run into a pretty serious issue. It seems that iterative builds are using stale source files. I am having to delete the build directory every time I want to compile. Steps to reproduce:
|
@tprk77 Yes I noticed that too and it's very inconvenient but I haven't solved it yet. @esteve I've found issues in array generation when working on this project today and I expect to find some more. Will it interfere with your review if I keep adding fixes to this PR? Alternatively, I can try to remove changes to the generator from this PR and fix it separately. It might lighten this PR a bit. |
@lelongg I think it'd make this PR easier to review if the generator stuff were in a separate PR, but it's your call, whatever works best for you. |
@lelongg Sounds good. I am all for getting this in and fixing the issues later. I've been trying this out some more, and I have one more comment. It seems there are a few types like Again, maybe something to consider later on. 😁 |
.repos file is pruned other PR, so skipping keys shouldn't be needed https://github.com/esteve/ros2_rust/pull/3
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.
Thanks for removing the generator changes, it's made reviewing this PR easier. This is the feedback I have so far.
|
||
let mut publish_count: u32 = 1; | ||
|
||
while rclrs::ok() { | ||
while context.ok() { |
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.
I'd keep rclrs:::ok for symmetry with the other client libraries.
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.
From https://index.ros.org//doc/ros2/Releases/Release-Crystal-Clemmys/.
However, you may just continue to offer a single, global init and shutdown in your client library, and just store a single global context object.
As it is optional I was thinking about adding the global context object later.
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.
It's fine if the context is not global for the time being, we can address that in the future. What I meant is that all the client libraries have an 'init` function that optionally take a context (or use the global one implicitly) and all functions are attached to the root namespace (e.g. rclcpp::init, rclpy.init, etc.)
Moreover, the concept of the context as defined in ROS2 differs slightly from what's presented in this pull request. It's not the context that calls rcl_init
, but the opposite:
https://github.com/ros2/rcl/blob/master/rcl/src/rcl/init.c#L59
so in order to have mimic the other client libraries, we need to have a rclrs::init
function that accepts a context and all functions are done at the rclrs level (e.g. spin, ok, etc.)
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.
Moreover, the concept of the context as defined in ROS2 differs slightly from what's presented in this pull request. It's not the context that calls rcl_init, but the opposite
It looks like rclcpp context calls rcl_init.
in order to have mimic the other client libraries, we need to have a rclrs::init function that accepts a context and all functions are done at the rclrs level
rclpy.init does take an optional context but rclcpp::init does not.
How much of a requirement do you think it is to mimic another client interface ? I think it is an important question to settle since it can considerably restrain the design space in the future.
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.
How much of a requirement do you think it is to mimic another client interface ? I think it is an important question to settle since it can considerably restrain the design space in the future.
I'd say it's pretty important that rclrs follows the other client libraries, if only to help users switch to Rust if they know other ROS2 libraries. There's only a handful of methods common to all the libraries (i.e. init, createX, destroyX), so apart from that, we have enough freedom to implement the API in any way we want.
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.
@lelongg did you have time to look into making the rclrs
API similar to the other clients'? Thanks.
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.
I didn't make the change yet. What API do you suggest ? We can mimic the rclcpp API by making rclrs::ok take a context object but rclcpp::init does not and so we cannot add rclrs::init until we get the global context.
fn main() { | ||
rclrs::init().unwrap(); | ||
fn main() -> rclrs::RclResult { | ||
let context = rclrs::Context::default(); |
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.
rclrs::init() like the other examples.
@tprk77 I'd rather get the pull request fixed or the changes moved to another pull request. This repository works fine right now (albeit only with Bouncy), I'd prefer not to introduce any changes that contain bugs. |
Let's better merge this now and address anything else later. Thanks @lelongg ! |
Fix change state
* Added timer_period_ns * Adds Timer::is_ready(). Signed-off-by: Agustin Alba Chicar <ag.albachicar@gmail.com> * Added comments to avoid warnings * Added the getter for rcl_clock_t --------- Signed-off-by: Agustin Alba Chicar <ag.albachicar@gmail.com> Co-authored-by: Agustin Alba Chicar <ag.albachicar@gmail.com>
This is a pretty big update and unfortunately it might be a bit too hard to review.
It adds :