Add a Rover Fragment to your Machine

To be able to drive your rover, you need to configure it. Viam provides reusable fragments for Viam rovers.

Prerequisites

Add the fragment

Follow the appropriate instructions for the model of rover and board you have:

Navigate to your machine in the Viam app. On the Config tab, click on the Fragments subtab.

On the Fragments tab, you can see the available fragments to add. Find ViamRover2-2024-rpi4-a and click Add to add the fragment to your machine configuration:

List of available fragments

Click Save Config to save the new configuration.

The fragment adds the following components to your machine’s JSON configuration:

  • A board component named local representing the Raspberry Pi.
  • Two motors (right and left)
    • The configured pin numbers correspond to where the motor drivers are connected to the board.
  • Two encoders, one for each motor
  • A wheeled base, an abstraction that coordinates the movement of the right and left motors
  • A webcam camera
  • An accelerometer
  • A power sensor

For information about how to configure components yourself when you are not using the fragment, click the links on each component above. To see the configured pin numbers and other values specific to this fragment, view it in the app.

Navigate to your machine in the Viam app. On the Config tab, click on the Fragments subtab.

On the Fragments tab, you can see the available fragments to add. Find ViamRover202210b and click Add to add the fragment to your machine configuration:

List of available fragments

Click Save Config to save the new configuration.

Fragment configuration

The fragment adds the following components to your machine’s JSON configuration:

  • A board component named local representing the Raspberry Pi
    • An I2C bus for connection to the accelerometer.
  • Two motors (right and left)
    • The configured pin numbers correspond to where the motor drivers are connected to the board.
  • Two encoders, one for each motor
  • A wheeled base, an abstraction that coordinates the movement of the right and left motors
    • Width between the wheel centers: 260 mm
    • Wheel circumference: 217 mm
    • Spin slip factor: 1
  • A webcam camera
  • An accelerometer

For information about how you would configure a component yourself if you weren’t using the fragment, click the links on each component above. To see the configured pin numbers and other values specific to this fragment, view it in the app.

Navigate to your machine in the Viam app. On the Config tab, click on the Fragments subtab.

On the Fragments tab, you can see the available fragments to add. Find ViamRover2-2024-jetson-nano-a and click Add to add the fragment to your machine configuration.

Click Save Config to save the new configuration.

The fragment adds the following components to your machine’s JSON configuration:

  • A board component named local representing the Jetson.
  • Two motors (right and left)
    • The configured pin numbers correspond to where the motor drivers are connected to the board.
  • Two encoders, one for each motor
  • A wheeled base, an abstraction that coordinates the movement of the right and left motors
  • A webcam camera
  • An accelerometer
  • A power sensor

For information about how to configure components yourself when you are not using the fragment, click the links on each component above. To see the configured pin numbers and other values specific to this fragment, view it in the app.

Navigate to your machine in the Viam app. On the Config tab, click on the Fragments subtab.

On the Fragments tab, you can see the available fragments to add. Find ViamRover2-2024-nano-orin-a and click Add to add the fragment to your machine configuration.

Click Save Config to save the new configuration.

The fragment adds the following components to your machine’s JSON configuration:

  • A board component named local representing the Jetson.
  • Two motors (right and left)
    • The configured pin numbers correspond to where the motor drivers are connected to the board.
  • Two encoders, one for each motor
  • A wheeled base, an abstraction that coordinates the movement of the right and left motors
  • A webcam camera
  • An accelerometer
  • A power sensor

For information about how to configure components yourself when you are not using the fragment, click the links on each component above. To see the configured pin numbers and other values specific to this fragment, view it in the app.

See the components on the configuration page

Adding a fragment to your machine adds the configuration to your machine. The components and services included in the fragment appear inside a read-only fragment section in the Components and Services subtabs.

Modify the config

The fragment you added is read-only, but if you need to modify your rover’s config you can do the following:

  1. Go to the Fragments subtab of the Config tab.
  2. Click Remove next to the fragment.
  3. Select and copy the contents of the fragment in the box on the right side of the Fragments subtab.
  4. Toggle to Raw JSON mode.
  5. Paste the raw fragment contents into the Raw JSON config field.
  6. Click Save config.
  7. Now, you can edit the config either in Raw JSON mode or in Builder mode.

Next steps



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

If you notice any issues with the documentation, feel free to file an issue or edit this file.