Configure your Viam Rover with a fragment
To be able to drive your rover, you need to configure it. Viam provides reusable fragments for Viam rovers.
Prerequisites
- An assembled Viam Rover. For assembly instructions, see Unbox and set up your Viam Rover
- The board is connected to Viam. To add your Pi to Viam, refer to the rover setup guide.
Add the fragment
- Navigate to your machine’s page.
- In the left-hand menu of the CONFIGURE tab, click the + (Create) icon next to the machine part you want to add the fragment to.
- Select Blocks.
- Search for the fragment for your rover and board, listed in the tabs below, select it, and click Add to machine.
- In the Add fragment dialog, click Add to machine again to add the fragment to your machine configuration.
- Click Save in the upper right corner of the page to save your new configuration.
Use the fragment for the model of rover and board you have:
Fragment: ViamRover2-2024-rpi5
The fragment adds the following components to your machine’s JSON configuration:
- A board component named
localrepresenting the Raspberry Pi. - Two motors (
rightandleft)- 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: 356 mm
- Wheel circumference: 381 mm
- Spin slip factor: 1
- 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.
Fragment: ViamRover2-2024-rpi4-a
The fragment adds the following components to your machine’s JSON configuration:
- A board component named
localrepresenting the Raspberry Pi. - Two motors (
rightandleft)- 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: 356 mm
- Wheel circumference: 381 mm
- Spin slip factor: 1
- 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.
Fragment: ViamRover202210b
The fragment adds the following components to your machine’s JSON configuration:
- A board component named
localrepresenting the Raspberry Pi- An I2C bus for connection to the accelerometer.
- Two motors (
rightandleft)- 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
Info
This particular motor driver has pins labeled “ENA” and “ENB.” Typically, this would suggest that they should be configured as enable pins, but on this specific driver these function as PWM pins, so we configure them as such.
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.
Fragment: ViamRover2-2024-jetson-nano-a
The fragment adds the following components to your machine’s JSON configuration:
- A board component named
localrepresenting the Jetson. - Two motors (
rightandleft)- 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: 356 mm
- Wheel circumference: 381 mm
- Spin slip factor: 1
- 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.
Fragment: ViamRover2-2024-nano-orin-a
The fragment adds the following components to your machine’s JSON configuration:
- A board component named
localrepresenting the Jetson. - Two motors (
rightandleft)- 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: 356 mm
- Wheel circumference: 381 mm
- Spin slip factor: 1
- 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 will now appear as cards on the CONFIGURE tab, along with a card for your fragment:

Modify the config
The fragment you added is read-only, but if you need to modify your rover’s config you can overwrite sections of the fragment.
Next steps
After you have configured your rover, follow this tutorial:
Was this page helpful?
Glad to hear it! If you have any other feedback please let us know:
We're sorry about that. To help us improve, please tell us what we can do better:
Thank you!