motion-tools aims to provide a visualization interface for any spatial information using Viam's APIs. This typically means motion-related monitoring, testing, and debugging.
Getting started
Quick Setup (Recommended)
The easiest way to get started is using our automated setup script:
make setup
This single command will:
- Install and configure nvm (Node Version Manager)
- Install the latest Node.js LTS version via nvm
- Install pnpm package manager
- Install bun runtime
- Install all project dependencies
After setup completes, start the development server:
make up
Manual Setup
If you prefer to install dependencies manually:
- Install nvm
- Install Node.js LTS:
nvm install --lts && nvm use --lts
- Install pnpm
- Install bun
- Install dependencies:
pnpm i
- Run local app server:
pnpm dev
Available Make Commands
make setup - Complete development environment setup
make up - Start the development server
make help - Show available commands
Running the visualizer
To visit the visualizer, go to http://localhost:5173/
Open the machine config page (bottom right) and enter in connection details to visualize a specific machine. You can also add machine configs from an env file (see below).
Env files for machine configs
To add a list of connection configs in an .env.local file, use the following format:
VITE_CONFIGS='
{
"fleet-rover-01": {
"host": "fleet-rover-01-main.ve4ba7w5qr.viam.cloud",
"partId": "myPartID",
"apiKeyId": "myApiKeyId",
"apiKeyValue": "MyApiKeyValue",
"signalingAddress": "https://app.viam.com:443"
}
}
'
Executing drawing commands
The visualizer includes a golang package that allows executing commands to the visualizer.
The list of available commands can be found here.
Programmatic camera control
It is possible to programmatically move the viewer camera and even modify the camera settings during runtime.
To do this, open the Javascript console while using the visualizer and call methods or set properties on the cameraControls object.
The following APIs are available: https://github.com/yomotsu/camera-controls?tab=readme-ov-file#properties