Extend Viam with Modular Resources

At Viam, a robot is configured with one or more resources (components or services) which are each defined by a public API. While Viam offers a number of built-in implementations against these APIs, such as the wheeled base, you may also write your own implementations in order to extend the capabilities of your robot.

For example, you can:

  • Implement a custom component: If your robot has specialty hardware, such as an unsupported motor, and you want to control it using Viam, you can write a driver to support your hardware by implementing the corresponding component API.

  • Implement a custom service: If your robot makes use of a specialty algorithm or data model when working with services such as SLAM, Vision, or Motion planning, you can implement your own algorithm or model against the corresponding service API.

  • Implement fully custom logic: If your robot runs specialty or proprietary logic, and you want to use Viam to manage and control that logic, such as when managing a software development lifecyle, you can implement your own custom logic by wrapping the generic API.

These custom implementations are called modular resources, and are made available for use on a robot through modules. A module can provide one or more modular resources, and can be added to your robot from the Viam registry.

The Viam Registry

The Viam registry allows hardware and software engineers to collaborate on their robotics projects by writing and sharing custom modules with each other. You can add a module from the Viam registry directly from your robot’s Configuration tab in the Viam app, using the + Create component button.

The code behind any modular resource can be packaged as a module and uploaded to the Viam registry. Once the module has been uploaded to the Registry, you can deploy the module to any robot in your organization from the Viam app.

Uploading to Viam Registry

After you finish programming your module, you can upload your module to the Viam registry to make it available for deployment to robots. As part of the upload process, you decide whether your module is private (visible only to other members of your organization), or public (visible to all Viam users).

You can see details about each module in the Viam registry on its module details page. See the Odrive module for an example. Public modules also display the number of times a module has been deployed to a robot.

When you make changes to your module, you can uploaded the newer version with a new version number, and the Viam registry will track each version that you upload.

Deploying to a Robot

Once you upload a module to the Viam registry, you can deploy the module to any robot in your organization from the Viam app. Navigate to your robot’s Configuration tab, click the + Create component button, then start typing the name of the module you would like to deploy.

By default, a newly-created module is private, meaning that the module will only appear for users within your organization, but you can later update your module to set it to be public, which makes your module available to all Viam users.

When you deploy a module to your robot, you can choose how to update that module when new versions become available.

Get Started

To get started working with modular resources:

Once you have deployed a modular resource, you can test the custom resource using the Control tab and program it with Viam’s Go or Python SDKs.