Skip to content
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 list_parameters & test #1124

Merged
merged 3 commits into from Sep 8, 2023
Merged

Conversation

leeminju531
Copy link
Contributor

This addresses the issue (#1097) by implementing the functionality for list_parameters that the node owns.
This feature should help with logging and debugging by allowing users to easily retrieve all declared parameters and their values, similar to the functionality in ROS1.

Copy link
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

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

implementation looks good to me, probably we can add more test cases.

rclpy/rclpy/node.py Outdated Show resolved Hide resolved
rclpy/rclpy/node.py Outdated Show resolved Hide resolved
rclpy/test/test_node.py Outdated Show resolved Hide resolved
rclpy/test/test_node.py Outdated Show resolved Hide resolved
rclpy/test/test_node.py Outdated Show resolved Hide resolved
rclpy/test/test_node.py Outdated Show resolved Hide resolved
@fujitatomoya
Copy link
Collaborator

CI:

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

@clalancette clalancette self-assigned this May 18, 2023
@Relativiteit
Copy link

@fujitatomoya Hey, I want to contribute for the first time, is there still a need for more testcases for this issue ?

rclpy/rclpy/node.py Outdated Show resolved Hide resolved
@fujitatomoya
Copy link
Collaborator

@leeminju531 sorry to be late to get back to this. #1124 (comment) makes sense to me, could you address that? after that we can start the CI again.

@leeminju531
Copy link
Contributor Author

It appears to be a reasonable suggestion, and I'm fully prepared to make the necessary updates in the near future.
Once these adjustments are in place, I will notify @clalancette and @fujitatomoya to request a review.

@leeminju531 leeminju531 force-pushed the leeminju531/rclpy branch 2 times, most recently from d06b8b7 to dd4f4fc Compare August 19, 2023 18:26
@leeminju531
Copy link
Contributor Author

I have made revisions according to the suggestions. I kindly request @clalancette and @fujitatomoya to review the changes.

@fujitatomoya
Copy link
Collaborator

@clalancette your comment is addressed, can you check again?

@clalancette
Copy link
Contributor

The more I look at this one, the more I'm curious why the implementation can't look like the rclcpp one. If it was more-or-less a Python port of that, it would be much easier to read (and reason about), since the logic would be the same.

@leeminju531 Can you maybe describe why the current implementation is like it is, rather than a direct port of the rclcpp code?

@leeminju531
Copy link
Contributor Author

I referred to _list_parameters_callback, where a similar process I intend to adopt has already been implemented ;however, i understood and agree your comments.

I've observed that the service callbacks of ParameterService mostly directly call the functions owned by the node, except for _list_parameters_callback, which is implemented directly. i believe it should also referred to the function the node owns for consistency and maintainability.

I believe that the modification should be made in conjunction with your proposed comment.
@clalancette What is your opinion on this?

@clalancette
Copy link
Contributor

I've observed that the service callbacks of ParameterService mostly directly call the functions owned by the node, except for _list_parameters_callback, which is implemented directly. i believe it should also referred to the function the node owns for consistency and maintainability.

I believe that the modification should be made in conjunction with your proposed comment. @clalancette What is your opinion on this?

Yes, I think that all makes a lot of sense to me. To recap:

  1. Update the implementation of list_parameters in node.py so it looks similar to the rclcpp version of the same.
  2. Update the implementation of _list_parameters_callback so that it calls the node.py implementation of list_parameters.

Please go ahead and do that, and I'm happy to review the result!

Signed-off-by: leeminju531 <dlalswn531@naver.com>
@leeminju531 leeminju531 reopened this Sep 3, 2023
@leeminju531
Copy link
Contributor Author

Please review the changes at your convenience. @clalancette

Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

Overall, this looks great. I've left one comment inline; I'm going to hold off on merging it until we figure out who is going to submit the PR to rclcpp. But I'm going to run CI on this and get it prepared for merge.

rclpy/rclpy/node.py Outdated Show resolved Hide resolved
rclpy/rclpy/node.py Outdated Show resolved Hide resolved
rclpy/rclpy/node.py Show resolved Hide resolved
@clalancette
Copy link
Contributor

clalancette commented Sep 6, 2023

CI:

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

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Signed-off-by: Chris Lalancette <clalancette@gmail.com>
@clalancette clalancette merged commit d8ced84 into ros2:rolling Sep 8, 2023
2 of 3 checks passed
@leeminju531 leeminju531 deleted the leeminju531/rclpy branch September 8, 2023 11:31
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.

None yet

4 participants