|
321 | 321 | "\n",
|
322 | 322 | "class MySensor(Sensor):\n",
|
323 | 323 | " # Subclass the Viam Sensor component and implement the required functions\n",
|
324 |
| - " MODEL: ClassVar[Model] = Model(ModelFamily(\"acme\",\"wifi_sensor\"), \"linux\")\n", |
| 324 | + " MODEL: ClassVar[Model] = Model(ModelFamily(\"viam\",\"sensor\"), \"linux-wifi\")\n", |
325 | 325 | "\n",
|
326 | 326 | " @classmethod\n",
|
327 | 327 | " def new(cls, config: ComponentConfig, dependencies: Mapping[ResourceName, ResourceBase]) -> Self:\n",
|
|
511 | 511 | "### 5. Configure a modular resource\n",
|
512 | 512 | "**NOTE:** *If you are adding your module to the registry, follow [these instructions](https://docs.viam.com/extend/modular-resources/configure/) instead. Otherwise, continue with these instructions, which will show you how to configure the module locally.*\n",
|
513 | 513 | "\n",
|
514 |
| - "[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>/wifi-sensor/run.sh`.\n", |
| 514 | + "[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", |
515 | 515 | "\n",
|
516 | 516 | "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",
|
517 | 517 | "\n",
|
518 | 518 | "```json\n",
|
519 | 519 | "{\n",
|
520 | 520 | " \"components\": [\n",
|
521 | 521 | " {\n",
|
522 |
| - " \"model\": \"acme:wifi_sensor:linux\",\n", |
| 522 | + " \"model\": \"viam:sensor:linux-wifi\",\n", |
523 | 523 | " \"attributes\": {},\n",
|
524 | 524 | " \"depends_on\": [],\n",
|
525 | 525 | " \"name\": \"my-sensor\",\n",
|
|
528 | 528 | " ],\n",
|
529 | 529 | " \"modules\": [\n",
|
530 | 530 | " {\n",
|
531 |
| - " \"executable_path\": \"<path-on-your-filesystem>/wifi-sensor/run.sh\",\n", |
| 531 | + " \"executable_path\": \"<path-on-your-filesystem>/linux-wifi/run.sh\",\n", |
532 | 532 | " \"name\": \"wifi_sensor\"\n",
|
533 | 533 | " }\n",
|
534 | 534 | " ]\n",
|
535 | 535 | "}\n",
|
536 |
| - "```\n" |
| 536 | + "```\n", |
| 537 | + "\n", |
| 538 | + "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", |
| 539 | + "\n", |
| 540 | + "Viam also provides many built-in models that implement API capabilities, each using `rdk` as the `namespace`, and `builtin` as the `family`:\n", |
| 541 | + "- 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", |
| 542 | + "- The `rdk:builtin:DMC4000` model of the same `rdk:component:motor` API provides RDK support for the [DMC4000](https://docs.viam.com/components/motor/dmc4000/) motor." |
537 | 543 | ]
|
538 | 544 | },
|
539 | 545 | {
|
|
566 | 572 | "\n",
|
567 | 573 | "class MyModularArm(Arm):\n",
|
568 | 574 | " # Subclass the Viam Arm component and implement the required functions\n",
|
569 |
| - " MODEL: ClassVar[Model] = Model(ModelFamily(\"acme\", \"demo\"), \"myarm\")\n", |
| 575 | + " MODEL: ClassVar[Model] = Model(ModelFamily(\"viam\", \"arm\"), \"my-arm\")\n", |
570 | 576 | "\n",
|
571 | 577 | " def __init__(self, name: str):\n",
|
572 | 578 | " # Starting joint positions\n",
|
|
0 commit comments