This repository contains the codebase for the YOR robot, supporting both high-fidelity MuJoCo simulation and physical robot control via CAN bus.
- OS: Linux (Ubuntu 22.04+ recommended) for physical robot control. macOS/Windows supported for Simulation only.
- Python: Version 3.10 or higher.
- Hardware (Physical only):
- CANable or compatible USB-to-CAN adapter.
- AgileX Piper arm(s).
- SparkFlex/SparkMax motor controllers.
This repository uses submodules. Clone recursively:
git clone --recursive https://github.com/YOR-robot/YOR.git
cd YORIf you already cloned without submodules:
git submodule update --init --recursiveFor Linux systems with physical robot support, we recommend using conda to manage dependencies, as it provides better control over C++ library versions.
1. Create Conda Environment:
conda create -n yor python=3.10 -y
conda activate yor2. Install System Dependencies:
conda install -y -c conda-forge pinocchio spdlog catch2 boost pybind11 gxx cxx-compiler3. Install Build Tools:
pip install scikit-build-core cmake ruckig4. Install Hardware Drivers (Linux Only):
Install sparkcan_py:
cd sparkcan_py
pip install .
cd ..Install piperlib (requires setting environment variable):
export PIPERLIB_CONDA_ENV=$CONDA_PREFIX
cd piperlib
pip install -e . --no-build-isolation
cd ..5. Install Main Robot Package:
pip install -e .For simulation-only or macOS/Windows setups, uv provides a fast, lightweight alternative.
1. Install uv (if not installed):
curl -LsSf https://astral.sh/uv/install.sh | sh2. Sync Environment:
uv syncThis will automatically create a virtual environment (.venv), install the correct Python version, and sync all dependencies from uv.lock.
3. Activate Environment:
source .venv/bin/activateNote
The uv method installs only simulation dependencies. Physical robot drivers (sparkcan_py and piperlib) must be installed separately following section 1.3 steps 4-5.
Test that all packages import correctly:
python -c "import robot; print('Robot package installed successfully')"For physical robot setup, also verify:
python -c "import piperlib; import sparkcan_py; print('Hardware drivers installed successfully')"For dynamic mapping and navigation (e.g., using robot/zed_pub_node.py or robot/nav/), additional dependencies are required.
1. Install PyTorch (Linux Conda Recommended):
conda install -y pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia(Adjust the CUDA version to match your system based on pytorch.org).
2. Install Navigation Python Packages:
You can install all necessary python dependencies using the nav optional group:
pip install -e ".[nav]"3. Install ZED SDK (for physical cameras): Download and install the ZED SDK for Linux (matching your CUDA version), then install its Python wrapper:
wget -O ZED_SDK_Linux.run https://download.stereolabs.com/zedsdk/4.1/cu118/ubuntu22
chmod +x ZED_SDK_Linux.run
./ZED_SDK_Linux.run -- silent skip_tools
python -m pyzed.sl.get_python_apiThe simulation uses MuJoCo and does not require hardware drivers.
1. Launch Simulation:
python robot/yor_mujoco.pyThis will launch a passive MuJoCo viewer.
2. Control the Robot: In a separate terminal (with the same environment activated), run a teleop script:
python robot/teleop/telestick.py1. Automated Setup (Recommended):
Run the following script to set up the CAN interface, launch the robot driver, and start the joystick controller in a tmux session:
./create_windows.sh2. Manual Setup:
If you prefer to run components individually:
-
Hardware Setup: Connect CAN adapter/motors and configure interfaces:
./extra/setup.sh
-
Launch Robot Driver:
python robot/yor.py
-
Control the Robot: In a separate terminal:
python robot/teleop/joystick.py
Teleoperation scripts communicate with either Simulation or Physical Robot via commlink (ZeroMQ). Run these in a separate terminal while the robot/sim is running.
Keyboard / Test Controls:
python robot/teleop/telestick.pyJoystick (Gamepad):
python robot/teleop/joystick.pyOculus / VR Teleop: Requires Oculus controller connected via Bluetooth or link.
# Single arm + base
python robot/teleop/oculus_teleop.py
# Whole body (Base + Arm)
python robot/teleop/oculus_wb_teleop.py
# Bimanual
python robot/teleop/oculus_bimanual_teleop.py"ModuleNotFoundError: No module named 'sparkcan_py'"
- You are likely on macOS/Windows or skipped the hardware driver installation. This is expected if you are only running simulation. Physical robot control (
robot/yor.py) will not work without this.
"ImportError: ... linux/can.h not found"
- You are trying to install hardware drivers on a non-Linux OS. Use the simulation (
robot/yor_mujoco.py) instead.
"CMake Error: Could NOT find Python3 (missing: Python3_NumPy_INCLUDE_DIRS)"
- When installing
piperlib, usepip install -e . --no-build-isolationinstead of regularpip install . - Ensure you've set
PIPERLIB_CONDA_ENV=$CONDA_PREFIXbefore installation
"undefined reference to GLIBCXX_3.4.31"
- Install the conda C++ compiler:
conda install -y -c conda-forge gxx cxx-compiler - This ensures the C++ standard library version matches the boost libraries
"ZMQ / RPC Connection Failed"
- Ensure
robot/yor.pyorrobot/yor_mujoco.pyis running in another terminal - Check if port 5557 is blocked or already in use
Import errors after installation
-
Verify your environment is activated:
conda activate yororsource .venv/bin/activate -
Try reinstalling in editable mode:
pip install -e . -
Website: yourownrobot.ai
-
Paper: arXiv:2602.11150
