-
Notifications
You must be signed in to change notification settings - Fork 194
Add service introspection #560
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
base: main
Are you sure you want to change the base?
Conversation
|
It looks like CI is failing (at least one runner) because a transitive dependency doesn't support rustc 1.75 anymore: This is a dependency of |
|
The API changes in the second commit seem to have broken something but I'm not sure what. When I run |
|
By making the
I'm assuming the tests run in parallel and are interfering with each other when the nodes are not being dropped properly. I reverted the |
By making the Service keep a reference to the Node instead of the NodeHandle we were creating a circular reference that prevented the Node from being dropped. NodeState -> ParameterInterface -> ParameterService -> Service -> ServiceHandle -> NodeState This change modifies the Service to keep a reference to the NodeHandle again and to the Clock breaking the circular reference.
adc1944 to
d4c3d4d
Compare
9e0aa87 to
5fe8670
Compare
| /// can create async services using [`NodeState::create_async_service`]. | ||
| pub fn create_service<'a, T, Args>( | ||
| &self, | ||
| self: &Arc<Self>, |
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 just checked, and this can go back to &self. All we need to do is change the node: &Node argument in ServiceState::create to node: &NodeState.
For reference, type Node = Arc<NodeState>, so if you ever want to refer to a "node" without being wrapped in an Arc, just use NodeState.
This PR is a work in progress to add service introspection support to rclrs.
ClientStateServiceStateI'm not all that familiar with the RCL interface and how to get and pass around the proper pointers. If anyone more familiar could double check the calls to RCL that would be appreciated.
I'm currently looking to add similar support for
ServiceStatebut I can't implement it in the same way because it only stores aNodeHandleinstead of the fullNodeand I'm not sure how to get the clock from it. I've asked on the Matrix chat what the reason was behind the asymmetry. I'm not sure if there is a way to work around this or if we need to make a breaking change and unify the APIs?Edit
I've made the API changes in a second commit and implemented the introspection for
ServiceStateas well. If that is not the desired way forward it is easy to drop that commit.