Previous
Module Configuration
Each modular resource has two associated triplets: an API namespace triplet to indicate which API it implements, and a model namespace triplet to uniquely identify the modular resource model.
Each existing component or service API has a unique identifier in the form of a colon-delimited triplet. You will use this API namespace triplet when creating your new model, to indicate which API it uses.
The API namespace triplet is the same for all built-in and modular models that implement a given API.
For example, every model of motor built into Viam, as well as every custom model of motor provided by a module, all use the same API namespace triplet rdk:component:motor
to indicate that they implement the motor API.
The three pieces of the API namespace triplet are as follows:
namespace
: rdk
type
: component
subtype
: any one of these component proto files, for example motor
if you are creating a new model of motornamespace
: rdk
type
: service
subtype
: any one of these service proto files, for example vision
if you are creating a new model of vision serviceIn addition to determining which existing API namespace triplet to use when creating your module, you need to decide on a separate triplet unique to your model.
The viam
namespace is reserved for models provided by Viam.
A resource model is identified by a unique name, called the model namespace triplet, using the format: namespace:module-name:model-name
, where:
namespace
is the namespace of your organization, which you can find or create in your organization settings page in the Viam app.acme
namespace, your models must all begin with acme
, like acme:module-name:mybase
.
If you do not intend to upload your module to the Viam Registry, you do not need to use your organization’s namespace as your model’s namespace.viam
namespace is reserved for models provided by Viam.module-name
is the name of your module.
Your module-name
should describe the common functionality provided across the model or models provided by that module.model-name
is the name of the new resource model that your module will provide.For example, if your organization namespace is acme
, and you have written a new base implementation named mybase
which you have supported with a module named my-custom-base-module
, you would use the namespace acme:my-custom-base-module:mybase
for your model.
More requirements:
a-z
and 0-9
), hyphen (-
), and underscore (_
) characters.Determine the model name you want to use based on these requirements, then proceed to the next section.
When uploading modules to the Viam Registry, you must set a unique namespace for your organization to associate your module with.
To create a new namespace for your organization, click on the org’s Settings in the top right of the navigation bar, then click the Set a public namespace button.
Enter a name or use the suggested name for your namespace, and then click Set namespace.
A namespace may only contain letters, numbers, and the dash (-
) character.
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!