Skip to content

Add functions to get topic name to publisher and subscriber #194

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

Merged
merged 11 commits into from
Jun 13, 2022
Merged

Add functions to get topic name to publisher and subscriber #194

merged 11 commits into from
Jun 13, 2022

Conversation

DS3a
Copy link
Contributor

@DS3a DS3a commented Jun 9, 2022

A new variable was added to the struct to store the topic name in a boxed string.

@DS3a DS3a changed the title feat: added functions to get topic name to publisher and subscriber Add functions to get topic name to publisher and subscriber Jun 9, 2022
@nnmm
Copy link
Contributor

nnmm commented Jun 9, 2022

Welcome to the ros2-rust project @DS3a!

This implementation is probably based on a misunderstanding of #148: The functions rcl_subscription_get_topic_name and rcl_publisher_get_topic_name already exist, in the rcl_bindings module (they come from the rcl package). You should call them to fetch the string. The reason is that these functions return the topic name after remapping, and not just the topic name that was passed in. See #143 for more context, and for an example of how to deal with C strings.

@jhdcs
Copy link
Collaborator

jhdcs commented Jun 9, 2022

Additionally, it looks like your commits were not able to be verified. Would you be able to look into that? That will need to be fixed before we can merge.

@nnmm
Copy link
Contributor

nnmm commented Jun 9, 2022

Is it a requirement @jhdcs?

@jhdcs
Copy link
Collaborator

jhdcs commented Jun 9, 2022

Now that I look at it again, it does not appear to be for us... However, I believe that other ROS 2 projects (such as the client libraries) require it as part of the DCO check.

@DS3a
Copy link
Contributor Author

DS3a commented Jun 9, 2022

Additionally, it looks like your commits were not able to be verified. Would you be able to look into that? That will need to be fixed before we can merge.

Aight... I'll look into that.

@DS3a
Copy link
Contributor Author

DS3a commented Jun 9, 2022

Welcome to the ros2-rust project @DS3a!

This implementation is probably based on a misunderstanding of #148: The functions rcl_subscription_get_topic_name and rcl_publisher_get_topic_name already exist, in the rcl_bindings module (they come from the rcl package). You should call them to fetch the string. The reason is that these functions return the topic name after remapping, and not just the topic name that was passed in. See #143 for more context, and for an example of how to deal with C strings.

Ahhh... My bad... I'll change it accordingly

@DS3a
Copy link
Contributor Author

DS3a commented Jun 10, 2022

Hi... I've made the required changes, and verified my GPG key, can you look it over and see if there's any changes to be made?

@esteve esteve self-requested a review June 10, 2022 09:38
Copy link
Contributor Author

@DS3a DS3a left a comment

Choose a reason for hiding this comment

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

A self review has been done... This is my first PR, forgive me for having to be reminded of the protocol

Copy link
Contributor

@nnmm nnmm left a comment

Choose a reason for hiding this comment

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

Thanks for adjusting, the PR looks good in general now, though I have a couple of comments.

As you can see, our CI checks formatting and clippy, so make sure to run cargo fmt and cargo clippy as well.

@DS3a DS3a requested review from nnmm and esteve June 10, 2022 11:51
@jhdcs
Copy link
Collaborator

jhdcs commented Jun 10, 2022

A self review has been done... This is my first PR, forgive me for having to be reminded of the protocol

No worries! We all start somewhere! Thank you for taking the time to try and make ros2_rust a little better! We really appreciate it!

@nnmm
Copy link
Contributor

nnmm commented Jun 10, 2022

@DS3a I noticed you did something different than I suggested. Did the suggestion not work?

@nnmm
Copy link
Contributor

nnmm commented Jun 10, 2022

@DS3a Are you sure you tried with into_owned() instead of to_owned()? They are different methods.

@DS3a
Copy link
Contributor Author

DS3a commented Jun 10, 2022

@DS3a Are you sure you tried with into_owned() instead of to_owned()? They are different methods.

Ohhh... I didn't notice that... Hold on... I'll push the changes soon

@DS3a
Copy link
Contributor Author

DS3a commented Jun 10, 2022

okay... I've made changes to return String instead of Result<String, Err>

Copy link
Contributor

@nnmm nnmm left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for your patience @DS3a!

@DS3a
Copy link
Contributor Author

DS3a commented Jun 11, 2022

Looks good to me. Thanks for your patience @DS3a!

Thanks... I look forward to contributing more to ros2_rust!!

@esteve
Copy link
Collaborator

esteve commented Jun 13, 2022

@DS3a thanks for you contribution! 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants