Configure Data Capture

Add the Data Management Service

To capture data from one or more robots, you must first add the Data Management Service:

  1. On your robot’s Config page, navigate to the Services tab.

  2. At the bottom of the page you can create a service. Choose Data Management as the type and specify a name for your Data Management Service, for example data-manager.

  3. Then click Create Service.

  4. On the panel that appears, you can manage the capturing and syncing functions individually and specify the interval and directory. If the capture frequency or the directory is not specified, the Data Management Service captures data at the default frequency every 0.1 minutes that is every 6 seconds in the default ~/.viam/capture directory.

  5. Click Save Config.

data capture configuration

Click to view the JSON configuration for the Data Management Service

Configure Data Capture for Individual Components

Once you have added the data capture service, you can specify the data you want to capture at a component level. The following components support data capture:

  • Arm
  • Board
  • Camera
  • Encoder
  • Gantry
  • Motor
  • Movement Sensor (includes GPS)
  • Sensor
  • Servo

To add data capture for a component, navigate to the Config tab of your robot’s page in the Viam app.

For each component you can capture data for, there is a Data Capture Configuration section in its panel. Click Add Method and then select the method type and the capture frequency.

Click Save Config at the bottom of the window.

Now your data will be saved locally on your robot to the directory specified in the Data Management Service.

For example, a camera has the options ReadImage and NextPointCloud and a motor has the options Position and IsPowered.

component config example

Click to view an example JSON configuration capturing data from the ReadImage method of a camera

You may capture data from one or more component methods:

  • To enable or disable data capture for a configured component or method, use the on/off toggle.
  • To change the frequency of data capture for a method, enter the number of measurements you wish to capture per second in the frequency field.

After adding configuration for the methods, click Save Config.

If you want to remove a capture method from the configuration, click the delete icon.

Configure Data Capture for Remote Parts

Viam supports data capture from remote parts. For example, if you use a component that does not have a Linux operating system or that does not have enough storage or processing power, you can still process and capture the data from the component by adding it as a remote part.

Currently, you can only configure data capture from remote components by adding them to your JSON configuration. To add them to your JSON configuration you must explicitly add the part’s type, model, name, and additional_params to the data_manager service configuration in the remotes configuration:

KeyDescription
typeThe type tells your robot what the part is. For example, a board.
modelThe model is a _colon-delimited-triplet that specifies the namespace, the type of the part, and the part itself.
nameThe name specifies the fully qualified name of the part.
additional_paramsThe additional parameters specify the data sources when you are using a board.
Click to view the JSON configuration for an ESP32 board
Click to view the JSON configuration for capturing data from two analog readers and a pin of the board's GPIO
Click to view the JSON configuration for capturing data from a camera

Next Steps

To sync your captured data with the cloud, configure cloud sync.

For a comprehensive tutorial on data management, see Intro to Data Management.



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