This repository contains code for 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 custom wrapper over the xArm Python SDK.
-
Basic Steam setup for Vive with Ubuntu: SteamVR
- https://github.com/ankurhanda/HTC-Vive-Setup-Ubuntu
- 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 is enough.
-
SteamVR setup for headset-free operation
- https://github.com/username223/SteamVRNoHeadset
- Follow these instructions and modify SteamVR config file every time SteamVR is updated
- The steam directory on Linux is ~/.steam/steam or ~/.local/share/Steam
Other relevant setup information:
- Check SteamVR setup and controller detection:
- Test OpenVR installation and controller tracking:
- Run
python vr_test.py
to 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 SDK and ensure that the custom wrapper from the erl_xArm repo is also present on the machine.
- Run
python robot_control.py
to start teleoperation. Thesimulated
parameter is set toTrue
by default, so you can verify that the robot is moving correctly in the xArm Studio simulation. If the test is succesful and looks safe, setsimulated
toFalse
to 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.