Overview | Viam Documentation
Overview
Time: ~55 minutes
Scenario
This tutorial uses the simplest work cell (camera + compute) to teach patterns that apply to all Viam applications.
You’re building a quality inspection station for a canning line. Cans move past a camera on a conveyor belt. Your system must:
- Detect when a can is present
- Classify it as PASS or FAIL (identifying dented cans)
- Log results for review and analysis
- Provide a monitoring dashboard for operators
Tutorial
In this tutorial you will work through a series of tasks that are common to many robotics applications. The techniques you learn here are applicable regardless of what hardware, software, data, or machine learning models you are working with.
| Part | Time | What you’ll do |
|---|---|---|
| Gazebo Simulation Setup | ~10 min | Set up the Gazebo simulation environment |
| Part 1: Vision pipeline | ~10 min | Set up camera, ML model, and vision service |
| Part 2: Data capture | ~5 min | Configure automatic image capture and cloud sync |
| Part 3: Control logic | ~10 min | Generate module, write inspection logic, test from CLI |
| Part 4: Deploy a module | ~10 min | Deploy module, configure detection data capture |
| Part 5: Productize | ~10 min | Build monitoring dashboard with Teleop |
Full section outline
Gazebo Simulation Setup (~10 min)
- Prerequisites
- Step 1: Build the Docker Image
- Step 2: Create a Machine in Viam
- Step 3: Create a credentials file
- Step 4: Start the Container
- Step 5: Verify the Setup
Part 1: Vision pipeline (~10 min)
- 1.1 Verify your machine is online
- 1.2 Locate your machine part
- 1.3 Configure the camera
- 1.4 Test the camera
- 1.5 Add a vision pipeline with a fragment
Part 2: Data capture (~5 min)
Part 3: Control logic (~10 min)
- 3.1 Generate the module scaffolding
- 3.2 Add remote machine connection
- 3.3 Add detection logic
- 3.4 Summary
Part 4: Deploy a module (~10 min)
- 4.1 Review the generated module structure
- 4.2 Build and upload your module
- 4.3 Add the module to your machine
- 4.4 Configure detection data capture
- 4.5 Summary
Part 5: Productize (~10 min)
- 5.1 Create a workspace
- 5.2 Add a camera stream widget
- 5.3 Add a defects per minute widget
- 5.4 Add a confidence trend widget
- 5.5 Arrange your dashboard
- 5.6 Summary
Get started
Before starting, set up the Gazebo simulation environment by following the Gazebo Simulation Setup guide (~10 min).