Skip to content

BaileyChessum/teleop_modular

Repository files navigation

teleop_modular logo

License CI (Rolling, Jazzy, and Humble)

teleop_modular

Teleop Modular is a general framework for multimodal teleoperation in ROS2.

Please refer to the documentation for information on how to use the teleop_modular packages.

Overview

teleop_node architecture diagram

There are two main plugin types used in the framework:

  • Input Sources provide input values
  • Control Modes use meaningfully named inputs to create high level control messages to send to some control system.

Every input source and control mode get their own node from which to retrieve parameters, spawned by the teleop_node (architecture for which is simplified in the above diagram).

What does meaningfully named mean? Most teleop packages map inputs from specific sources directly to control messages:

twist.linear.x = joy_msg[3];    //< Not meaningful, and tightly coupled to joy

Instead, teleop_modular allows control modes to ask for an input with a name that describes what the input is actually used for:

linear_.x = inputs.axes["linear.x"];  //< get an input pointer with a meaningful name
// ...
twist.linear.x = *linear_.x;

We no longer need to care where we get our inputs from.

Motivation

teleop_modular aims to:

  • Make it easier to extend your teleop packages.
  • Prevent tight coupling to a specific input source.
  • Centralize management of multiple control modes.
    • Integration with ros2_control to dynamically switch active controllers for each control mode.
  • Allow new control modes to be easily added using plugins.
    • Promote experimentation with control modes.
    • Allow control mode code to be reused to achieve different functionality (e.g. configuring control modes to use different reference frames).
  • Allow novel input sources to be developed and integrated with existing systems.
  • Improve configuration for individual input sources.

Quick Start

To try it out, install teleop_modular in your workspace (see Getting Started), and use teleop_template to create a simple teleop package for a turtlesim turtle:

# Add teleop_modular to your workspace
cd workspace/src
# (if not using git, just do): git clone https://github.com/BaileyChessum/teleop_modular.git
git submodule add https://github.com/BaileyChessum/teleop_modular.git teleop_modular
git add ./teleop_modular
git commit -m "feat: added teleop_modular as a submodule"

# Create a teleop package with cookiecutter and teleop_template
sudo apt install cookiecutter
cookiecutter https://github.com/BaileyChessum/teleop_template.git

# Add turtlesim if you want to try the quick start demo. Change DISTRO to your ros2 distro
sudo apt install ros-DISTRO-turtlesim

# Build it
colcon build
. install/setup.bash

# Plug in a game controller and drive the turtle! (change teleop_turtle to the name you chose)
ros2 launch teleop_turtle teleop.launch.py

Then, try applying it to your robot, and write Control Mode plugins for your use case (see Writing a ControlMode plugin).

Follow our documentation and guides to learn more:

Plugins

This is a list of plugins you can use with teleop_modular. Please post plugins to the discussions page to add them to this list.

Control Modes

Use control_mode_template to generate empty control mode packages, and implement custom control modes for your robot.

Input Sources

Contributing

All are welcome to contribute. As teleop_modular is still very experimental, I'm keen to hear feedback on any aspect of using the package with your robots.

Please post in the discussions page -- we are happy to help in any way we can!

PRs

Feel free to make a fork of the repository, and raise a pull request with any changes you wish to contribute. Any changes you submit will be under the Apache 2.0 License.

Issues

You are welcome to raise new issues for any bugs or feature requests.

The project development roadmap is outlined for each upcoming version as Milestones.