This repository contains code for lightweight VR teleoperation of an xArm6 robot using just an HTC Vive Controller. It uses the OpenVR API to access controller data. Joint angles are calculated to match the robot end-effector pose to the controller pose. The joint angles are applied to xArm6 using a wrapper over the official xArm Python SDK.
-
Basic Steam setup for Vive with Ubuntu: SteamVR
- Follow https://github.com/ankurhanda/HTC-Vive-Setup-Ubuntu to install SteamVR Beta
- Do not need to follow entire instructions from here as we are aiming for a headset-free setup
- No need to install OpenVR from source as per this page.
pip install openvris enough.
-
SteamVR setup for headset-free operation
- Instructions from https://github.com/username223/SteamVRNoHeadset
- Make the following changes when setting up for the first time, and every time SteamVR updates.
- The steam directory on Linux is ~/.local/share/Steam (if that doesn't work, try ~/.steam/steam)
- Setting updates
- Null Driver File
Path:*SteamDirectory*/steamapps/common/SteamVR/drivers/null/resources/settings/default.vrsettings
Changes:
a."enable": false,->"enable": true, - SteamVR Config File
Path:*SteamDirectory*/steamapps/common/SteamVR/resources/settings/default.vrsettings
Changes:
a."requireHmd": true,->"requireHmd": false,
b."forcedDriver": "",->"forcedDriver": "null",
c."activateMultipleDrivers": false,->"activateMultipleDrivers": true,
- Null Driver File
Other relevant setup information:
- Check SteamVR setup and controller detection:
- Test OpenVR installation and controller tracking:
- Run
python vr_test.pyto test if controller data is being received correctly. A live plot of the controller pose and position should show up.
- Run
- Test teleoperation:
- Note: Please install the xArm Python SDK separately, it is not included in this repo.
- Run
python robot_control.pyto start teleoperation. Thesimulatedparameter is set toTrueby default, so you can verify that the robot is moving correctly in the xArm Studio simulation. If the test is succesful and looks safe, setsimulatedtoFalseto control the real robot.
- Teleoperation legend:
- The trigger on the back of the controller is used to open and close the gripper.
- The menu button is used to end teleoperation easily.
