Skip to main content

Turns your phone into a robot arm teleoperation device by leveraging the WebXR API

Project description

Teleop

Transform your phone into a robot arm teleoperation device in three simple steps:

  1. Install and launch the server on your computer.
  2. Open the provided URL on your phone.
  3. Tap Start, then press and hold the Move button to control the robot arm.

The web application leverages the WebXR API, which combines your phone’s sensors to detect its orientation and position in 3D space. The server receives this data and sends it to the robot arm controller.

Lite6 Physical Teleoperation UR5e Webots Teleoperation
Teleoperation of a physical Lite6 robot Teleoperation of a simulated UR5e robot in Webots

Installation

The package is available on PyPI. You can install it using pip:

pip3 install teleop

Usage

We provide some ready-to-use robot arm interfaces, but you can also create your own by incorporating the teleop.Teleop class into your project.

Basic Interface

A simple interface that prints the teleop responses. You can use it as a reference to build your own interface.

python3 -m teleop.basic

ROS 2 Interface

The ROS 2 interface is designed primarily for use with the cartesian_controllers package, but it can also be adapted for MoveIt Servo or other packages.

python3 -m teleop.ros2

Published topics:

  • target_frame (geometry_msgs/PoseStamped): The target pose of the robot arm’s end effector in the robot base frame.
  • tf (tf2_msgs/TFMessage): The transform between the robot base frame and the target frame for visualization.

Subscribed topics:

  • current_pose (geometry_msgs/PoseStamped): The current pose of the robot arm’s end effector in the robot base frame. Used to update the reference pose.

You can override the default topic names using standard ROS 2 arguments:

python3 -m teleop.ros2 --ros-args -r target_frame:=/some_other_topic_name

Custom Interface

For most applications, you will need to create a custom interface to interact with your robot arm. Here’s an example:

import numpy as np
from teleop import Teleop


def callback(pose: np.ndarray, message: dict) -> None:
    """
    Callback function triggered when pose updates are received.
    Arguments:
        - np.ndarray: A 4x4 transformation matrix representing the end-effector target pose.
        - dict: A dictionary containing additional information.
    """
    print(f'Pose: {pose}')
    print(f'Message: {message}')

teleop = Teleop()
teleop.subscribe(callback)
teleop.run()

Examples

Explore the examples to learn how to use the package in various scenarios:

Development

If you’d like to contribute, install the package in editable mode:

# Install the package in editable mode
git clone https://github.com/SpesRobotics/teleop.git
cd teleop
pip3 install -e .

# Run the tests
python3 -m pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

teleop-0.0.7.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

teleop-0.0.7-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file teleop-0.0.7.tar.gz.

File metadata

  • Download URL: teleop-0.0.7.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for teleop-0.0.7.tar.gz
Algorithm Hash digest
SHA256 c7607be41df1710292c899adf918ffa86f1888c19d6adae3e955304013d64ae8
MD5 e20dec668822f76695d40e5697168209
BLAKE2b-256 1ac474feecaf3971a62058d3d2220ee1d303e439fc0bab1f31e54f71b6c55ccc

See more details on using hashes here.

File details

Details for the file teleop-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: teleop-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 17.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for teleop-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 eaf7633f9b2db24ea60415f99c5ad32fa147a707fa93e9d0cb1e74fc07878283
MD5 f38152356c6f771c317db3b8f53cc7c1
BLAKE2b-256 46816212f4781cb61d85d7b2fe354a5440f5b15a23c3bb996dcea848d09ea470

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page