MiniPupper robot teleoperation via ROS and WebRTC
MIT License
This project allows streaming video from MiniPupper via WebRTC and teleoperating it via ROS. Note that the backend expects you've already connected OAK-D Lite camera to your robot. If you don't have one yet, you can still teleoperate the robot via keyboard, but w/o a camera stream. Also, note that technically you are not forced to use this project with MiniPupper only. It should work for any robot with OAK camera.
The following diagram reflects the most recent implementation:
Note that velocity-smoother
was intentionally splitted from champ
due to netwroking issue mentioned in a known issues section.
The following ROS image already comes with all the required drivers pre-installed. Just flash it to SD card and you are almost ready to go.
Check the official guide if you don't have Docker yet. Note that you need both docker
and docker-compose
CLI tools installed on MiniPupper.
Clone the source code:
git clone https://github.com/sskorol/minipupper-teleop.git && cd minipupper-teleop
Prepare calibration and env files:
./generate_configs.sh [MINI_PUPPER_IP_ADDRESS]
Adjust angles in calibration_settings.yaml
to match your own robot's calibration data. Note that MiniPupper's legs should be calibrated to 90 degress as on the following screenshot, as CHAMP framework automatically adjusts angles during bringup process to make your robot stand:
MiniPupper's IP is required for the FE container to be able to communicate with the BE via remote browser.
Use the following steps to relax your web-browser restrictions:
chrome://flags/
in the address bar and hit EnterInsecure origins treated as secure
option, and type the IP address of your MiniPupperRun the following command to start a stack of docker images required to perform teleoperation:
docker compose pull && docker compose up -d
An old docker cli uses a bit different syntax: docker-compose up -d
.
Open your web browser and go to: http://[MINI_PUPPER_IP_ADDRESS]
If you don't have a robot yet, you can still play with teleoperation locally in a simulated environment.
# Required for running Gazebo in container
xhost +local:docker
# Download images
docker compose -f docker-compose-sim.yaml pull
# Run services required for simulation
docker compose -f docker-compose-sim.yaml up -d
Then open your web-browser on a localhost, wait until teleop is ready, and you're good to go.
Run the following command on MiniPupper to build FE and BE images:
docker compose build
Install backend dependencies:
cd ./backend && python3 venv .venv
source .venv/bin/activate && pip3 install pip --upgrade && pip3 install -r requirements.txt
Start backend:
./run.sh
Install frontend dependencies:
cd ../frontend && npm install
Prepare .env
with required environment variables:
cp .env.example .env
Here are sample values:
REACT_APP_ROSBRIDGE_SERVER_IP=localhost
REACT_APP_ROSBRIDGE_SERVER_PORT=9090
REACT_APP_RECONNECTION_TIMER=1000
REACT_APP_BE_URL=http://localhost:8080
REACT_APP_IS_SIMULATION=true
Start frontend:
npm run start
Go to http://localhost:3000 to see the web UI.
Note that frontend and backend depend on the ROS bridge and a custom teleop node. Make sure you've started them beforehand.
In rare cases teleop
, smoother
and servo
nodes can't correctly publish/subscribe to /cmd_vel
topic due to registration failure. The current workaround is displayed on the following diagram.
You can try to restart docker images to see if it helps. I couldn't yet found the root cause of these Docker <---> ROS networking issues. Feel free to contact author if you have any idea on how to stabilize it.
Run the following command on MiniPupper to diagnose potential errors in logs:
docker compose logs -f