Extend Viam with custom components and services

Using modular resources and SDKs to extend Viam.

Viam’s Robot Development Kit (RDK) provides built-in support for a variety of resources:

  • Various hardware components and component models.
  • High-level functionality exposed as services.

Many robots can be composed entirely of these resources. However, sometimes you may have a hardware component that Viam’s RDK does not natively support. In other cases, you may want to add new functionality to a component or expose a custom service securely through the Viam API and corresponding SDKs.

You can extend Viam in these and other ways by creating and using custom resources.

Modular resources

You can use the Viam module system to build a custom component or service. The new component or service can then be included in any Viam-powered robot. Once configured, modular resources behave identically to built-in RDK resources.

The Viam platform manages:

  • Starting and stopping the module binary (lifecycle)
  • Dependency management (modular resources may depend on other resources - both RDK built-in and other modular resources)
  • Securely exposing the modular resource’s interface (protobuf-described API) alongside Viam RDK built-in APIs
  • Robot reconfiguration for any configured modular resource instances

For more detail, see the modular resources documentation.

Use a Viam SDK as a server to create a custom component

Currently, modular resources are supported only with the Viam Go SDK. If you are not using the Go SDK, you can add custom components using the Viam SDK of your choice to create a server component implementation.

See also



Have questions, or want to meet other people working on robots? Join our Community Slack.