Skip to main content

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

Project description

Teleop

Turns your phone into a robot arm teleoperation device in 3 simple steps:

  1. Install and start the server on your computer.
  2. Open the URL on your phone.
  3. Click Start and hold the Move button to move the robot arm.

The web application utilizes the WebXR API that fuses the phone's sensors to get the orientation and position of the phone in 3D space. The server receives the phone's pose and sends it to the robot arm controller.

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

Installation

The package is available on PyPI, you can install it using pip.

pip3 install teleop

Usage

Out of the box, we provide some robot arm interfaces that you can just run, but you can create you own interface by including the teleop.Teleop class in your project.

Basic Interface

A simple interface that simply prints the teleop response. You can use it as a reference for creating your own interface.

python3 -m teleop.basic

ROS 2 Interface

A ROS 2 interface is primarily designed to be compatible with the cartesian_controllers package, but it could 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 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 end effector in the robot base frame. Used for updating the reference pose.

You can use the standard ROS 2 arguments to override the default values, for example:

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.

import numpy as np
from teleop import Teleop


def callback(pose: np.ndarray, message: dict) -> None:
    """
    A callback function that will be called when pose updates are received.
    The callback function should take two 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

Check out the examples to see how to use the package in different scenarios:

Development

To contribute to the project, you can 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.6.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: teleop-0.0.6.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.6.tar.gz
Algorithm Hash digest
SHA256 7f7f12647aeaef173ca816a78fd2682af1f95c1176093c0adce2d2c50c5c48b5
MD5 97242fb96b63f7317e1627ea93ffe240
BLAKE2b-256 76326ef5c85eca06efc0f6855996b78a79779b2a6b44294fcc5a569c74299041

See more details on using hashes here.

File details

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

File metadata

  • Download URL: teleop-0.0.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9021aa8ba6c22815fb4895187fba880da3d0018aeb1aad869f0717fe3c81fcb2
MD5 0d75a778c59d3b092ab9b97faff3db7d
BLAKE2b-256 b22f29cc3dcd3400692579a6dd4fd4aaaa85a70bd65f05b2ca881a574f1bfaa7

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