|
317 | 317 | "### 2. Register the new modular resource\n",
|
318 | 318 | "Now that we've created the modular resource model, we must register it to the registry.\n",
|
319 | 319 | "\n",
|
320 |
| - "Define a [`Model`](https://docs.viam.com/extend/modular-resources/#models) name and a creator function in the resource. A creator function is a function that can create a resource given a config and map of dependencies.\n", |
| 320 | + "Define a [`Model`](https://docs.viam.com/appendix/glossary/#term-model) name and a creator function in the resource. A creator function is a function that can create a resource given a config and map of dependencies.\n", |
321 | 321 | "\n",
|
322 | 322 | "To define a creator function and `Model` in `wifi_sensor_module.py`, import `ComponentConfig`, `ResourceName`, `ResourceBase`, `Model`, and `ModelFamily` from the relative viam packages. Please note that the import packages also have to be changed to include `Mapping` and `ClassVar` from `typing` and `Self` from `typing_extensions`. The changes can be seen in the example below.\n",
|
323 | 323 | "\n",
|
|
533 | 533 | "\n",
|
534 | 534 | "[Configure your new module](https://docs.viam.com/extend/modular-resources/#configure-your-module) on your robot by navigating to the **Config** tab of the robot's page on the Viam app, then click on the **Modules** subtab. Add the name of your module and the executable path. For our example, the path would be `<path-on-your-filesystem>/linux-wifi/run.sh`.\n",
|
535 | 535 | "\n",
|
536 |
| - "Once you have configured a module as part of your robot configuration, [configure your modular resource](https://docs.viam.com/extend/modular-resources/#configure-your-modular-resource) made available by that module by adding new components or services configured with your modular resources' new type or model. To instantiate a new resource from your module, specify the `type`, `model`, and `name` of your modular resource. The aforementioned `type`, `model`, and `name` should be the same as those in the `MODEL` class attribute defined in your [component class](#2-register-the-custom-component). This is a JSON example:\n", |
| 536 | + "Once you have configured a module as part of your robot configuration, [configure your modular resource](https://docs.viam.com/extend/modular-resources/#configure-your-modular-resource) made available by that module by adding new components or services configured with your modular resources' new type or model. To instantiate a new resource from your module, specify the `type`, `model`, and `name` of your modular resource. The aforementioned `type`, `model`, and `name` should be the same as those in the `MODEL` class attribute defined in your [component class](#register-the-custom-component). This is a JSON example:\n", |
537 | 537 | "\n",
|
538 | 538 | "```json\n",
|
539 | 539 | "{\n",
|
|
555 | 555 | "}\n",
|
556 | 556 | "```\n",
|
557 | 557 | "\n",
|
558 |
| - "Note the nomenclature of the above `model` field, `viam:sensor:linux-wifi`. Models are uniquely namespaced as colon-delimited-triplets in the form `namespace:family:name`, and are named according to the Viam API that your model implements. A model with the `viam` namespace is always Viam-provided. Read more about making custom namespaces [here](https://docs.viam.com/extend/modular-resources/key-concepts/#models).\n", |
| 558 | + "Note the nomenclature of the above `model` field, `viam:sensor:linux-wifi`. Models are uniquely namespaced as colon-delimited-triplets in the form `namespace:family:name`, and are named according to the Viam API that your model implements. A model with the `viam` namespace is always Viam-provided. Read more about making custom namespaces [here](https://docs.viam.com/registry/create/#name-your-new-resource-model).\n", |
559 | 559 | "\n",
|
560 | 560 | "Viam also provides many built-in models that implement API capabilities, each using `rdk` as the `namespace`, and `builtin` as the `family`:\n",
|
561 | 561 | "- The `rdk:builtin:gpio` model of the `rdk:component:motor` API provides RDK support for [GPIO-controlled DC motors](https://docs.viam.com/components/motor/gpio/).\n",
|
|
570 | 570 | "### Custom Modular Arm Example\n",
|
571 | 571 | "The following is an example of how to implement a custom modular arm. For further instructions, read the detailed `Sensor` example above. Our custom Arm will be extremely simple. Please note that the minimum set of endpoints you need to implement for an arm are `GetKinematics`, `GetJointPositions`, and `MoveToJointPositions`.\n",
|
572 | 572 | "\n",
|
573 |
| - "This arm example contains a minimal kinematics model. For a full model, take a look [here](https://github.com/viamrobotics/viam-python-sdk/blob/main/complex_module/src/arm/my_arm_kinematics.json).\n", |
| 573 | + "This arm example contains a minimal kinematics model. For a full model, take a look [here](https://github.com/viamrobotics/viam-python-sdk/blob/main/examples/complex_module/src/arm/my_arm_kinematics.json).\n", |
574 | 574 | "\n",
|
575 | 575 | "Subclassing the `Arm` component and implementing the required functions:\n",
|
576 | 576 | "```python\n",
|
|
908 | 908 | "source": [
|
909 | 909 | "You can view more component implementations in the [examples](https://github.com/viamrobotics/python-sdk/blob/main/examples/server/v1/components.py).\n",
|
910 | 910 | "\n",
|
911 |
| - "This arm example contains a minimal kinematics model. For a full model, take a look [here](https://github.com/viamrobotics/viam-python-sdk/blob/main/complex_module/src/arm/my_arm_kinematics.json)." |
| 911 | + "This arm example contains a minimal kinematics model. For a full model, take a look [here](https://github.com/viamrobotics/viam-python-sdk/blob/main/examples/complex_module/src/arm/my_arm_kinematics.json)." |
912 | 912 | ]
|
913 | 913 | },
|
914 | 914 | {
|
|
0 commit comments