-
Notifications
You must be signed in to change notification settings - Fork 135
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 context builder #312
base: main
Are you sure you want to change the base?
Add context builder #312
Conversation
Signed-off-by: Taehun Lim <[email protected]>
Hi, I am extrememely sorry for the delay, I got busy with school, internships, clearing backlogs, etc. Thank you so much for picking up the slack I caused. I have used ros2rust for a lot of my personal projects and definitely want to contribute to it. But unfortunately I won't be able to for atleast a few months, until my summer break starts. Thanks again, I will find some other issue to resolve with this repository when I get the time. |
Signed-off-by: Taehun Lim <[email protected]>
Signed-off-by: Taehun Lim <[email protected]>
Signed-off-by: Taehun Lim <[email protected]>
Signed-off-by: Taehun Lim <[email protected]>
Signed-off-by: Taehun Lim <[email protected]>
Signed-off-by: Taehun Lim <[email protected]>
@routiful thank you so much for working on this! I'll look into the CI issues with rolling |
I searched the CI issues with rolling. The error codes shown below are related
This issue is related The Unsafe functions might make unpredictable behavior when its are executed. Thus, I understands its make occur compile errors. I'll keep find a solution how to handle this. |
Signed-off-by: Taehun Lim <[email protected]>
Signed-off-by: Taehun Lim <[email protected]>
Signed-off-by: Taehun Lim <[email protected]>
The CI issues with rolling is caused by a So I suggest that make block |
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.
Hey @routiful, sorry it has taken so long for someone to pick up your PR! Here's a first review.
The blocklist approach is fine with me since we don't use any of these functions for now.
rclrs/src/context/builder.rs
Outdated
/// [1]: https://docs.ros.org/en/rolling/Concepts/About-Domain-ID.html | ||
pub fn domain_id(mut self, domain_id: usize) -> Self { | ||
#[cfg(ros_distro = "foxy")] | ||
std::env::set_var("ROS_DOMAIN_ID", domain_id.to_string()); |
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.
In Foxy, could you just disable the entire domain_id
functionality in the context builder, and add it to the node builder instead?
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.
New commits haven't passed doc-test
due to domain_id
func doesn't exist in Foxy. I have searched doc_cfg but it is not merged yet rust-lang/rust#43781.
Is there any solutions to test each ros distro?
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 have modified doc-test
:)
/// Creates a rcl_init_options_t struct from this builder. | ||
/// | ||
/// domain id validation is performed in this method. | ||
fn create_rcl_init_options(&self) -> Result<rcl_init_options_t, RclrsError> { |
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.
Personally, I would make the builder have a field of rcl_init_options_t
type, instead of only building it in build()
. But I don't have a good argument for it, so I'll leave it up to you whether you want to do that :)
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 accept your suggestion. That field give more flexible features to assign allocators and a domain_id.
Signed-off-by: Taehun Lim <[email protected]>
Signed-off-by: Taehun Lim <[email protected]>
Signed-off-by: Taehun Lim <[email protected]>
Signed-off-by: Taehun Lim <[email protected]>
Signed-off-by: Taehun Lim <[email protected]>
Signed-off-by: Taehun Lim <[email protected]>
Signed-off-by: Taehun Lim <[email protected]>
Signed-off-by: Taehun Lim <[email protected]>
@nnmm Any updates? |
Is this pull request still relevant and if so, is it still in a state so that it can be merged with the main branch? |
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 am happy to have a context builder, but this PR is somewhat stale at this point due to our delays.
/// assert_eq!(domain_id, 1); | ||
/// # Ok::<(), RclrsError>(()) | ||
/// ``` | ||
#[cfg(ros_distro = "foxy")] |
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.
Sorry this PR sat for so long, but foxy is no longer supported.
I just realied that we more or less have this functionalitiy already, however not by using a builder but by accepting an |
My personal preference is that each of these first-class structs has an associated
Then this My rationale for this preference is that we get all the benefits of the builder pattern but at the same time it's more clear to users how to create the struct that they actually want to create. I think in most cases when someone wants to build a This way, the API of So I guess what I'd advocate for is to consider achieving consistency by applying the pattern used by |
Hello :)
I've studied Rust since last year and I've been developing some applications with Rust.
ROS client library in Rust is the best approach to write solid nodes and packages.
As one of ROS users, I should contribute features so that many ROS users can use this.
To make
context builder
is assigned to @DS3a, #206. However, it hasn't developed since last year.Thus, I commited that to support various features such as domain_id.
@huchijwk