-
Notifications
You must be signed in to change notification settings - Fork 79
feat: add ParameterClient for external parameter access #1318
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: develop
Are you sure you want to change the base?
feat: add ParameterClient for external parameter access #1318
Conversation
05728bf to
9cb7abb
Compare
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 submitting the PR, will take a look 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.
Thanks for the PR with effective unit test & ts declaration, LGTM!
| debug(`Creating client for service: ${serviceName}`); | ||
|
|
||
| const client = this.#node.createClient(serviceInterface, serviceName); | ||
| this.#clients.set(serviceType, client); |
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.
Should be serviceName? So we can align with L.329 in destroy() function?
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.
Nice catch, I think it should be the other way around we should change serviceName to serviceType since when we are getting or creating the client we use serviceType (GetParameter/SetParameter)
| } | ||
|
|
||
| this.#node = node; | ||
| this.#remoteNodeName = this.#normalizeNodeName(remoteNodeName); |
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.
nit: is it necessary to validate the node name by
Line 52 in 7c306aa
| validateNodeName(name) { |
before normalizing?
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.
If we want to accept both turtlesim and /turtlesim then we should normalize then validate
9cb7abb to
14ed2c5
Compare
Public API Changes
Added
ParameterClientclass for remote parameter access:node.createParameterClient(remoteNodeName, options)node.destroyParameterClient(parameterClient)ParameterClientwith full API for get/set/list/describe operationsparameterTypeFromValueutility#1317