How to build ToddlerBot
33 steps to build ToddlerBot, with the source documents.
Total cost not stated; BOM provided as a link
Software
- Clone the robot repository
Clone the toddlerbot repository into the ~/projects directory.
- Configure GitHub SSH keys
If GitHub SSH keys are not configured yet, follow the steps on the linked page.
- Install Miniforge
Install Miniforge if conda is not installed yet.
- Check the system architecture
Run uname -m and use the output to determine the system architecture.
- Download and install the matching package
Download the Miniforge installer matching the system architecture. Do not run the install script with sudo, and answer yes to all options.
- Activate the conda environment
Run source ~/.bashrc to activate the conda environment.
- Set up the Linux environment
Create a toddlerbot conda environment with Python 3.10, activate it, and install the linux extras.
- Set up the macOS ARM environment
Create the toddlerbot Python 3.10 environment with the osx-arm64 subdirectory, set that subdirectory for the environment, and install the macos extras.
- Set up the macOS x86 environment
Create the toddlerbot Python 3.10 environment with the osx-64 subdirectory, set that subdirectory for the environment, and install the macos extras.
- Set up the Windows environment
Create a toddlerbot conda environment with Python 3.10, activate it, and install the windows extras.
- Set up the Jetson environment
Create a toddlerbot conda environment with Python 3.10, activate it, and install the jetson extras.
- Resolve Jetson pyaudio issues
If pyaudio installation fails on Jetson, install portaudio19-dev, python3-dev, and build-essential, then install the jetson extras again.
- Install the base software package
Create a toddlerbot conda environment with Python 3.10, activate it, and install the base package.
- Complete the Jetson Orin setup
Complete the Jetson Orin setup using the official ToddlerBot documentation, and pay special attention to the stereo depth estimation section.
- Run the automated depth setup script
Run `bash scripts/setup_depth_module.sh` to install PyCUDA and PyTools, configure system TensorRT access, install cuSPARSELt libraries, install PyTorch for Jetson, and build and install ONNX-TensorRT.
- Install the prebuilt TensorRT engine
Download `foundation_stereo_vits_96x128_16.engine` for Jetson Orin NX 16GB with JetPack 6.1 and place it at `toddlerbot/depth/models/foundation_stereo_vits_96x128_16.engine`. Engine files follow the `foundation_stereo_vits_{height}x{width}_{valid_iters}.engine` naming convention.
- Build a TensorRT engine yourself
For a different configuration or a different JetPack version, follow the FoundationStereo ONNX/TensorRT instructions.
- Prepare the ExecuTorch program environment
Create and activate the separate `toddlerbot-pte` conda environment. Run the commands from the ToddlerBot checkout on the machine that will run the robot, use the FoundationStereo changes from pull request 248, and build the engine for that GPU and TensorRT version.
- Fix TensorRT Import Errors
For an ImportError for tensorrt or pycuda, follow the JetPack 6.1 setup instructions and configure the TensorRT paths correctly.
- Rebuild Incompatible Engines
If the engine file is incompatible, rebuild it when switching hardware or JetPack versions because TensorRT engines are specific to GPU architecture and TensorRT version.
Calibrate and test
- Test Without Cameras
Place test images in results/depth_blake_debug/ using the names {frame}_original_left.jpg and {frame}_original_right.jpg. Run the depth example in debug mode with visualization and output saving.
- Set Jetson Performance Profile
Use Jetson Orin NX 16GB with JetPack 6.1 and an input resolution of 96x128, downsized from 640x480. Inference takes about 30–50 ms per frame, and the full pipeline takes about 60–80 ms including rectification and point cloud generation.
- Find Calibration Files
If the calibration file is not found, run the calibration procedure or update the code paths to point to the calibration files.
- Improve Low Frame Rate
For low FPS, reduce --valid_iters and the image size when building the TensorRT engine files.
Data and training
- Create reference motions
Use the Keyframe App to create reference motions.
- Train an RL policy for each skill
Train an RL policy for each skill with the specified skill name and environment.
- Collect labeled stereo skill data
Collect RGB stereo frames. Select a skill label when prompted, press space to start recording, press space again to pause, and repeat for each skill.
- Create depth data from stereo images
Process the collected stereo images offline to create depth maps.
- Train the skill classifier
Train the classifier on depth images with skill labels, using the data directory path.
- Start the depth estimation server
Start the depth estimation server before running the multi-skill locomotion system.
- Configure and run all skills
Specify each trained skill's checkpoint path in POLICY_CONFIGS, then run the multi-skill locomotion system with the classifier checkpoint. After server warm-up, checkpoint loading, and reaching the standing pose, the robot continuously classifies depth estimates and performs the appropriate skills autonomously.
- Compare Depth Results
Compare the ground-truth and predicted depth result folders for frame 10. This generates depth error heatmaps, point cloud alignment metrics, and bird's eye view overlays.
Use it
- Run Depth Estimation
Run the foundation stereo example with visualization and output saving. Provide the TensorRT engine, calibration parameters, and recording parameters paths.
Common problems
Parts
- Jetson Orin NX 16GB
- Two fisheye cameras, two microphones, a speaker, an IMU
- 30 active degrees of freedom (actuator models not stated)
- 3D prints (Onshape CAD and MakerWorld model)
Tools
- 3D printer
- Assembly videos and manual
Skills
- MuJoCo/MJX reinforcement learning
- Jetson deployment
Software
- MuJoCo simulation and RL training scripts
- Diffusion-policy training