You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/dev/reference/glossary/model.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -15,5 +15,5 @@ Regardless, you can power any motor model that implements the `rdk:component:mot
15
15
Models are either included with [`viam-server`](/architecture/viam-server/) or provided through {{< glossary_tooltip term_id="module" text="modules" >}}.
16
16
All models are uniquely namespaced as colon-delimited-triplets.
17
17
Built-in model names have the form `rdk:builtin:name`.
18
-
Modular resource model names have the form `namespace:repo-name:name`.
18
+
Modular resource model names have the form `namespace:module-name:model-name`.
19
19
See [Name your new resource model](/how-tos/create-module/#name-your-new-resource-model) for more information.
Copy file name to clipboardExpand all lines: docs/operate/get-started/other-hardware/cpp-module.md
+18-17
Original file line number
Diff line number
Diff line change
@@ -120,7 +120,7 @@ In addition to determining which existing API namespace triplet to use when crea
120
120
121
121
{{< expand "API namespace triplet and model namespace triplet example" >}}
122
122
123
-
The `rand:yahboom:arm` model and the `rand:yahboom:gripper` model use the repository name [yahboom](https://github.com/viam-labs/yahboom).
123
+
The `rand:yahboom:arm` model and the `rand:yahboom:gripper` model use the module name (and matching repo name)[yahboom](https://github.com/viam-labs/yahboom).
124
124
The models implement the `rdk:component:arm` and the `rdk:component:gripper` API to support the Yahboom DOFBOT arm and gripper, respectively:
125
125
126
126
```json
@@ -136,17 +136,18 @@ The models implement the `rdk:component:arm` and the `rdk:component:gripper` API
136
136
137
137
{{< /expand >}}
138
138
139
-
A resource model is identified by a unique name, called the {{< glossary_tooltip term_id="model-namespace-triplet" text="model namespace triplet" >}}, using the format: `namespace:repo-name:model-name`, where:
139
+
A resource model is identified by a unique name, called the {{< glossary_tooltip term_id="model-namespace-triplet" text="model namespace triplet" >}}, using the format: `namespace:module-name:model-name`, where:
140
140
141
141
-`namespace` is the [namespace of your organization](/cloud/organizations/#create-a-namespace-for-your-organization).
142
-
- For example, if your organization uses the `acme` namespace, your models must all begin with `acme`, like `acme:repo-name:mybase`.
142
+
- For example, if your organization uses the `acme` namespace, your models must all begin with `acme`, like `acme:module-name:mybase`.
143
143
If you do not intend to [upload your module](#upload-your-module-to-the-modular-resource-registry) to the [Viam Registry](https://app.viam.com/registry), you do not need to use your organization's namespace as your model's namespace.
144
144
- The `viam` namespace is reserved for models provided by Viam.
145
-
-`repo-name` is the code repository (GitHub repo) that houses your module code.
146
-
- Ideally, your `repo-name` should describe the common functionality provided across the model or models of that module.
145
+
-`module-name` is the name of your module.
146
+
Your `module-name` should describe the common functionality provided across the model or models provided by that module.
147
+
- Many people also choose to use the module name as the name of the code repository (GitHub repo) that houses the module code.
147
148
-`model-name` is the name of the new resource model that your module will provide.
148
149
149
-
For example, if your organization namespace is `acme`, and you have written a new base implementation named `mybase` which you have pushed to a repository named `my-custom-base-repo`, you would use the namespace `acme:my-custom-base-repo:mybase` for your model.
150
+
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.
150
151
151
152
More requirements:
152
153
@@ -259,7 +260,7 @@ This file will inherit from the existing class for your resource type, implement
259
260
260
261
For example, the following file, `my_base.py`:
261
262
262
-
- defines a new model `acme:my-custom-base-repo:mybase` by implementing a new `MyBase` class, which inherits from the built-in class `Base`.
263
+
- defines a new model `acme:my-custom-base-module:mybase` by implementing a new `MyBase` class, which inherits from the built-in class `Base`.
263
264
- defines a new constructor `new_base()` and a new method `validate_config()`.
264
265
- does not implement several built-in methods, including `get_properties()` and `set_velocity()`, but instead raises a `NotImplementedError` error in the body of those functions.
265
266
This prevents these methods from being used by new base components that use this modular resource, but meets the requirement that all built-in methods either be defined or raise a `NotImplementedError()` error, to ensure that the new `MyBase` class successfully instantiates.
@@ -300,10 +301,10 @@ class MyBase(Base, Reconfigurable):
300
301
"""
301
302
302
303
# Here is where we define our new model's colon-delimited-triplet:
@@ -473,7 +474,7 @@ This file will inherit from the existing package for your resource type, impleme
473
474
474
475
For example, the following file, `mybase.go`:
475
476
476
-
- defines a new model `acme:my-custom-base-repo:mybase` by implementing a new `mybase` package, which inherits from the built-in package `base`.
477
+
- defines a new model `acme:my-custom-base-module:mybase` by implementing a new `mybase` package, which inherits from the built-in package `base`.
477
478
- defines a new constructor `newBase()` and a new method `Validate()`.
478
479
- does not implement several built-in methods, including `MoveStraight()` and `SetVelocity()`, but instead returns an `errUnimplemented` error in the body of those methods.
479
480
This prevents these methods from being used by new base components that use this modular resource, but meets the requirement that all built-in methods either be defined or return an `errUnimplemented` error, to ensure that the new `mybase` package successfully instantiates.
@@ -503,10 +504,10 @@ import (
503
504
"go.viam.com/rdk/spatialmath"
504
505
)
505
506
506
-
// Here is where we define your new model's colon-delimited-triplet (acme:my-custom-base-repo:mybase)
Model = resource.NewModel("acme", "my-custom-base-repo", "mybase")
510
+
Model = resource.NewModel("acme", "my-custom-base-module", "mybase")
510
511
errUnimplemented = errors.New("unimplemented")
511
512
)
512
513
@@ -726,7 +727,7 @@ For example, the files below define the new `MyBase` class and its constituent f
726
727
This prevents these functions from being used by new base components that use this modular resource, but meets the requirement that all built-in functions either be defined or `throw` a `runtime_error` error, to ensure that the new `MyBase` class successfully instantiates.
727
728
- The `my_base.cpp` source file contains the function and object definitions used by the `MyBase` class.
728
729
729
-
Note that the model triplet itself, `acme:my-custom-base-repo:mybase` in this example, is defined in the entry point (main program) file `main.cpp`, which is described in the next section.
730
+
Note that the model triplet itself, `acme:my-custom-base-module:mybase` in this example, is defined in the entry point (main program) file `main.cpp`, which is described in the next section.
730
731
731
732
{{< expand "Click to view sample code for the my_base.hpp header file" >}}
732
733
@@ -1048,7 +1049,7 @@ Create a <file>main.cpp</file> file to serve as the module's entry point file, w
1048
1049
- creates and starts the module
1049
1050
1050
1051
For example, the following `main.cpp` file serves as the entry point file for the `mybase` custom model.
1051
-
It imports the `mybase` model implementation from the `my_base.hpp` file that provides it, declares the model triplet `acme:my-custom-base-repo:mybase`, and defines a `main()` function that registers it.
1052
+
It imports the `mybase` model implementation from the `my_base.hpp` file that provides it, declares the model triplet `acme:my-custom-base-module:mybase`, and defines a `main()` function that registers it.
1052
1053
1053
1054
{{< expand "Click to view sample code for main.cpp" >}}
1054
1055
@@ -1080,7 +1081,7 @@ using namespace viam::sdk;
1080
1081
1081
1082
int main(int argc, char** argv) {
1082
1083
API base_api = Base::static_api();
1083
-
Model mybase_model("acme", "my-custom-base-repo", "mybase");
1084
+
Model mybase_model("acme", "my-custom-base-module", "mybase");
0 commit comments