Skip to content

Commit 8061538

Browse files
committed
renamed packages and updated readme for release
1 parent 110afea commit 8061538

27 files changed

+167
-152
lines changed

README.md

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,23 @@
1-
# Teleop Demo Python
1+
# XRoboToolkit-Teleop-Sample-Python
22

33
Pico teleoperation demo written in python for both mujoco simulation and robot hardware.
44

55
## Overview
66

77
This project provides a framework for controlling robots in robot hardware and MuJoCo simulation through XR (VR/AR) input devices. It allows users to manipulate robot arms using natural hand movements captured through XR controllers.
88

9-
## Dependencies
10-
11-
The main dependencies are listed in the [`pyproject.toml`](pyproject.toml) file and include:
12-
- `numpy`
13-
- `meshcat`
14-
- [`mujoco`](https://github.com/google-deepmind/mujoco)
15-
- [`placo`](https://github.com/rhoban/placo) (inverse kinematics library)
16-
- [`pyroboticsservice`](https://github.com/XR-Robotics/RoboticsService-Python) (Python binding for xr-robot sdk)
17-
189
## Installation
10+
1. Download and install `XRoboToolkit PC Service`
1911

20-
1. **Clone the repository:**
12+
2. **Clone the repository:**
2113
```bash
22-
git clone https://github.com/XR-Robotics/teleop_demo_python.git
23-
cd teleop_demo_python
14+
git clone https://github.com/XR-Robotics/XRoboToolkit-Teleop-Sample-Python.git
15+
cd XRoboToolkit-Teleop-Sample-Python
2416
```
2517

26-
2. **Installation**
18+
3. **Installation**
2719

28-
The project includes a script to help set up a suitable Conda environment and install all dependencies.
20+
It is recommended to setup a Conda environment and install the project using the included script.
2921
```bash
3022
bash setup_conda.sh --conda <optional_env_name>
3123
conda activate <env_name>
@@ -37,11 +29,6 @@ The main dependencies are listed in the [`pyproject.toml`](pyproject.toml) file
3729
bash setup.sh
3830
```
3931

40-
3. Download and install `roboticsservice`
41-
```bash
42-
dpkg -i /path/to/roboticsservice_1.0.0.0_amd64.deb
43-
```
44-
4532
## Usage
4633

4734
### Running the MuJoCo Simulation Demo
@@ -51,7 +38,7 @@ To run the teleoperation demo with a UR5e robot in MuJoCo simulation:
5138
```bash
5239
python scripts/simulation/teleop_dual_ur5e_mujoco.py
5340
```
54-
This script initializes the [`MujocoTeleopController`](teleop_demo_python/simulation/mujoco_teleop_controller.py) with the UR5e model and starts the teleoperation loop.
41+
This script initializes the [`MujocoTeleopController`](xrobotoolkit_teleop/simulation/mujoco_teleop_controller.py) with the UR5e model and starts the teleoperation loop.
5542

5643
### Running the Placo Visualization Demo
5744

@@ -60,7 +47,7 @@ To run the teleoperation demo with a UR5e robot in Placo visualization:
6047
```bash
6148
python scripts/simulation/teleop_x7s_placo.py
6249
```
63-
This script initializes the [`PlacoTeleopController`](teleop_demo_python/simulation/placo_teleop_controller.py) with the X7S robot and starts the teleoperation loop.
50+
This script initializes the [`PlacoTeleopController`](xrobotoolkit_teleop/simulation/placo_teleop_controller.py) with the X7S robot and starts the teleoperation loop.
6451

6552
### Running the Hardware Demo (Dual UR Arms and Dynamixel Head)
6653

@@ -70,17 +57,29 @@ To run the teleoperation demo with the physical dual UR arms and Dynamixel-based
7057
```bash
7158
python scripts/hardware/teleop_dual_ur5e_hardware.py
7259
```
73-
This script initializes the [`DynamixelHeadController`](teleop_demo_python/hardware/dynamixel.py) and [`DualArmURController`](teleop_demo_python/hardware/ur.py) and starts the teleoperation loops for both head tracking and arm control.
60+
This script initializes the [`DynamixelHeadController`](xrobotoolkit_teleop/hardware/dynamixel.py) and [`DualArmURController`](xrobotoolkit_teleop/hardware/ur.py) and starts the teleoperation loops for both head tracking and arm control.
7461

7562
2. **Resetting Arm Positions:**
7663
If you need to reset the UR arms to their initial/home positions and initialize the robotiq grippers, you can run the script with the `--reset` flag:
7764
```bash
7865
python scripts/hardware/teleop_dual_ur5e_hardware.py --reset
7966
```
80-
This will execute the reset procedure defined in the [`DualArmURController`](teleop_demo_python/hardware/ur.py) and then exit.
67+
This will execute the reset procedure defined in the [`DualArmURController`](xrobotoolkit_teleop/hardware/ur.py) and then exit.
8168

8269
3. **Visualizing IK results:**
8370
To visualize the inverse kinematics solution with placo during teleoperation, run the script with the `--visualize_placo` flag.
8471
```bash
8572
python scripts/hardware/teleop_dual_ur5e_hardware.py --visualize_placo
86-
```
73+
```
74+
75+
## Dependencies
76+
XR Robotics dependencies:
77+
- [`xrobotookit_sdk`](https://github.com/XR-Robotics/XRoboToolkit-PC-Service-Pybind): Python binding for XRoboToolkit PC Service SDK, MIT License
78+
79+
Robotics Simulation and Solver
80+
- [`mujoco`](https://github.com/google-deepmind/mujoco): robotics simulation, Apache 2.0 License
81+
- [`placo`](https://github.com/rhoban/placo): inverse kinematics, MIT License
82+
83+
Hardware Control
84+
- [`dynamixel_sdk`](https://github.com/ROBOTIS-GIT/DynamixelSDK.git): Dynamixel control functions, Apache-2.0 License
85+
- [`ur_rtde`](https://gitlab.com/sdurobotics/ur_rtde): interface for controlling and receiving data from a UR robot, MIT License

pyproject.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["setuptools>=42", "wheel"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
6-
name = "teleop_demo_python"
6+
name = "xrobotoolkit_teleop"
77
version = "0.1.0"
88
description = "Teleoperation demo with MuJoCo and UR5 robot"
99
readme = "README.md"
@@ -16,21 +16,20 @@ dependencies = [
1616
"mujoco",
1717
"numpy",
1818
"meshcat",
19-
"placo",
19+
"placo==0.6.4",
2020
"ur_rtde",
2121
"dynamixel-sdk",
2222
]
2323

2424
[project.optional-dependencies]
2525
dev = [
26-
"pytest>=7.0",
2726
"black",
2827
"isort",
2928
"flake8",
3029
]
3130

3231
[tool.setuptools]
33-
packages = ["teleop_demo_python"]
32+
packages = ["xrobotoolkit_teleop"]
3433

3534
[tool.setuptools.package-data]
36-
teleop_demo_python = ["../assets/**/*"]
35+
xrobotoolkit_teleop = ["../assets/**/*"]

scripts/hardware/dual_arm_control.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
from teleop_demo_python.hardware import DualArmURController
2-
from teleop_demo_python.utils.pico_client import PicoClient
1+
from xrobotoolkit_teleop.hardware import DualArmURController
2+
from xrobotoolkit_teleop.utils.xr_client import XrClient
33

44

55
def main():
6-
pico_client = PicoClient()
7-
controller = DualArmURController(pico_client)
6+
xr_client = XrClient()
7+
controller = DualArmURController(xr_client)
88
controller.run()
99

1010

scripts/hardware/head_control.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import threading
22
import time
33

4-
from teleop_demo_python.hardware import DynamixelHeadController
5-
from teleop_demo_python.utils.pico_client import PicoClient
4+
from xrobotoolkit_teleop.hardware import DynamixelHeadController
5+
from xrobotoolkit_teleop.utils.xr_client import XrClient
66

77

88
def main():
9-
pico_client = PicoClient()
9+
xr_client = XrClient()
1010

11-
controller = DynamixelHeadController(pico_client)
11+
controller = DynamixelHeadController(xr_client)
1212

1313
stop_signal = threading.Event()
1414

scripts/hardware/teleop_dual_ur5e_hardware.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
import threading
33
import time
44

5-
from teleop_demo_python.hardware import (
5+
from xrobotoolkit_teleop.hardware import (
66
DualArmURController,
77
DynamixelHeadController,
88
)
9-
from teleop_demo_python.utils.pico_client import PicoClient
9+
from xrobotoolkit_teleop.utils.xr_client import XrClient
1010

1111

1212
def main():
@@ -22,9 +22,9 @@ def main():
2222

2323
args = parser.parse_args()
2424

25-
pico_client = PicoClient()
26-
head_controller = DynamixelHeadController(pico_client)
27-
arm_controller = DualArmURController(pico_client, visualize_placo=args.visualize_placo)
25+
xr_client = XrClient()
26+
head_controller = DynamixelHeadController(xr_client)
27+
arm_controller = DualArmURController(xr_client, visualize_placo=args.visualize_placo)
2828

2929
if args.reset:
3030
print("Reset flag detected. Running arm controller reset procedure...")

scripts/simulation/teleop_dual_a1s_mujoco.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import os
22

3-
from teleop_demo_python.simulation.mujoco_teleop_controller import (
3+
from xrobotoolkit_teleop.simulation.mujoco_teleop_controller import (
44
MujocoTeleopController,
55
)
6-
from teleop_demo_python.utils.path_utils import ASSET_PATH
6+
from xrobotoolkit_teleop.utils.path_utils import ASSET_PATH
77

88

99
def main():

scripts/simulation/teleop_dual_ur5e_mujoco.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import os
22

3-
from teleop_demo_python.simulation.mujoco_teleop_controller import (
3+
from xrobotoolkit_teleop.simulation.mujoco_teleop_controller import (
44
MujocoTeleopController,
55
)
6-
from teleop_demo_python.utils.path_utils import ASSET_PATH
6+
from xrobotoolkit_teleop.utils.path_utils import ASSET_PATH
77

88

99
def main():

scripts/simulation/teleop_x7s_placo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import os
22

3-
from teleop_demo_python.simulation.placo_teleop_controller import (
3+
from xrobotoolkit_teleop.simulation.placo_teleop_controller import (
44
PlacoTeleopController,
55
)
6-
from teleop_demo_python.utils.path_utils import ASSET_PATH
6+
from xrobotoolkit_teleop.utils.path_utils import ASSET_PATH
77

88

99
def main():

scripts/visualization/vis_dual_ur5e_urdf.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
import pinocchio
2-
import placo
31
import argparse
2+
43
import meshcat.transformations as tf
4+
import numpy as np
5+
import pinocchio
6+
import placo
57
from placo_utils.visualization import (
6-
robot_viz,
78
robot_frame_viz,
9+
robot_viz,
810
)
9-
import numpy as np
1011

11-
from teleop_demo_python.hardware.ur import (
12+
from xrobotoolkit_teleop.hardware.ur import (
1213
LEFT_INITIAL_JOINT,
1314
RIGHT_INITIAL_JOINT,
1415
)

setup.sh

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,42 @@ if [[ "$OS_NAME" == "Linux" ]]; then
1515
echo "This script only supports Ubuntu 22.04 or 24.04."
1616
exit 1
1717
fi
18+
elif [[ "$OS_NAME" == "MINGW"* || "$OS_NAME" == "CYGWIN"* || "$OS_NAME" == "MSYS"* ]]; then
19+
OS_VERSION="Windows"
20+
echo "Windows detected"
1821
else
1922
echo "Unsupported operating system: $OS_NAME"
2023
exit 1
2124
fi
2225

2326
echo "Operating system check passed: $OS_NAME $OS_VERSION"
2427

25-
# Install the required packages
26-
rm -rf dependencies
27-
mkdir dependencies
28-
cd dependencies
29-
git clone https://github.com/XR-Robotics/RoboticsService-PC.git
30-
cd RoboticsService-PC/RoboticsService/PXREARobotSDK
31-
bash build.sh || { echo "Failed to build PXREARobotSDK"; exit 1; }
32-
cd ../../..
33-
34-
git clone https://github.com/XR-Robotics/RoboticsService-Python.git
35-
cd RoboticsService-Python
36-
cp ../RoboticsService-PC/RoboticsService/PXREARobotSDK/build/libPXREARobotSDK.so lib/ || { echo "Failed to copy libPXREARobotSDK.so"; exit 1; }
37-
python setup.py install || { echo "Failed to install RoboticsService-Python"; exit 1; }
38-
39-
# cd ..
40-
# git clone https://github.com/zhigenzhao/placo.git
41-
# cd placo
42-
# git checkout xml_experimental || { echo "Failed to checkout xml_experimental branch"; exit 1; }
43-
# bash setup.sh --install || { echo "Failed to run placo setup"; exit 1; }
44-
45-
cd ../..
46-
47-
pip install -e . || { echo "Failed to install teleop_demo_python with pip"; exit 1; }
28+
# Install the required packages
29+
rm -rf dependencies
30+
mkdir dependencies
31+
cd dependencies
32+
git clone https://github.com/XR-Robotics/XRoboToolkit-PC-Service.git
33+
cd XRoboToolkit-PC-Service/RoboticsService/PXREARobotSDK
34+
bash build.sh || { echo "Failed to build PXREARobotSDK"; exit 1; }
35+
cd ../../..
36+
37+
git clone https://github.com/XR-Robotics/XRoboToolkit-PC-Service-Pybind.git
38+
cd XRoboToolkit-PC-Service-Pybind
39+
if [[ "$OS_NAME" == "Linux" ]]; then
40+
cp ../XRoboToolkit-PC-Service/RoboticsService/PXREARobotSDK/build/libPXREARobotSDK.so lib/ || { echo "Failed to copy libPXREARobotSDK.so"; exit 1; }
41+
elif [[ "$OS_NAME" == "MINGW"* || "$OS_NAME" == "CYGWIN"* || "$OS_NAME" == "MSYS"* ]]; then
42+
cp ../XRoboToolkit-PC-Service/RoboticsService/PXREARobotSDK/build/PXREARobotSDK.dll lib/ || { echo "Failed to copy PXREARobotSDK.dll"; exit 1; }
43+
cp ../XRoboToolkit-PC-Service/RoboticsService/PXREARobotSDK/build/PXREARobotSDK.lib lib/ || { echo "Failed to copy PXREARobotSDK.lib"; exit 1; }
44+
fi
45+
python setup.py install || { echo "Failed to install xrobotoolkit_sdk"; exit 1; }
46+
cd ..
47+
rm -rf XRoboToolkit-PC-Service
48+
49+
cd ..
50+
51+
pip install -e . || { echo "Failed to install xrobotoolkit_teleop with pip"; exit 1; }
52+
53+
54+
echo -e "\n"
55+
echo -e "[INFO] xrobotoolkit_teleop is installed in conda environment '$ENV_NAME'.\n"
56+
echo -e "\n"

0 commit comments

Comments
 (0)