Reconsider service names
Closed this issue · 0 comments
We probably need to reconsider the service names again, which is required to load an RTT service provided by a plugin into a component via the PluginLoader
or the loadService()
operation of the deployer. The service name is not necessarily the same as the package name (which is used to first import all components, typekits and plugins provided by a package). It is also not necessarily the same as the name of the service instance after it has been loaded into a TaskContext.
Of course the same applies to rtt_ros2_node
and the ros2-node
service it provides, and other services that will be added soon for ROS service support, ROS actions, tf etc.
Suggestion:
- package name:
rtt_ros2_params
(unchanged) - plugin name:
params
- for
loadService("component", "params")
or.provide params
in the TaskBrowser
- for
- service instance name:
params
- for
RTT::Service("params")
orthis->provides("params")
in C++ - for
params.getParameter(...)
and other operations in Orocos scripting or in the TaskBrowser
- for
- The global service
ros
also provides theparams
service, but only thegetParameter()
andsetParameter()
operations. Using that global service requires that the global, process-wide node has been initialized, too. - Likewise for
rtt_ros2_node
(plugin and service name lower-casenode
instead ofNode
)
Discussion:
- Other services in RTT/OCL (e.g.
scripting
,marshalling
,os
,print
) also do not have names that starts with a capital. - Typically components have names in
CamelCase
notation. - Service name
Node
was chosen forrtt_ros2_node
to match the corresponding C++ class name it represent. - Just
params
(andnode
) mights be too generic and does not indicate that this is about ROS parameters. Risk of conflicts? Prefix withros_
orros2_
? - I think for
RTT::TaskContext::getProvider<ServiceType>(name)
to work properly the plugin and service instance names need to match, e.g.this->getProvider<rtt_ros2_params::Params>("params")
, wherertt_ros2_params::Params
needs to be a subclass ofRTT::ServiceRequester
, while the service class itself should be renamed toParamsService
.- Using a
ServiceRequester
has the advantage that other components or services can use ROS parameters without linking to a library provided byrtt_ros2_params
or evenrclcpp
.
Originally posted by @meyerj in https://github.com/orocos/rtt_ros2_integration/pull/7/files