Generic Service
The generic service subtype enables you to add support for unique types of services that do not already have an appropriate API defined for them.
For example, when writing code to manage simultaneous localization and mapping (SLAM) for your machine, it makes sense to use the existing SLAM API, which provides specific functionality required for generating accurate maps of an environment. However, if you want to create a new service to monitor your machine’s CPU and RAM usage for example, you need very different functionality that isn’t currently exposed in any API. Instead, you can use the generic service API to add support for your unique type of service, like local system monitoring, to your machine.
Use generic for a modular resource model that represents a unique type of service. If you are adding support for unique or proprietary hardware, rather than adding new high-level software functionality, use the generic component instead.
There are no built-in generic service models (other than fake
).
Important
The generic service API only supports the DoCommand
method.
If you use the generic subtype, your module needs to define any and all service functionality and pass it through DoCommand
.
Whenever possible, it is best to use an existing service API instead of generic so that you do not have to replicate code.
If you want to use most of an existing API but need just a few other functions, try using the DoCommand
endpoint and extra parameters to add custom functionality to an existing subtype, instead of using the generic service.
Available models
For configuration information, click on the model name:
Add support for other models
If none of the existing models fit your use case, you can create a modular resource to add support for it.
API
The generic service API supports the following method:
Method Name | Description |
---|---|
DoCommand | Execute model-specific commands. |
GetResourceName | Get the ResourceName for this instance of the generic service with the given name. |
Close | Safely shut down the resource and prevent further use. |
Troubleshooting
You can find additional assistance in the Troubleshooting section.
You can also ask questions in the Community Discord and we will be happy to help.
Was this page helpful?
Glad to hear it! If you have any other feedback please let us know:
We're sorry about that. To help us improve, please tell us what we can do better:
Thank you!