Skip to main content

Your submission was sent successfully! Close

Thank you for signing up for our newsletter!
In these regular emails you will find the latest updates from Canonical and upcoming events where you can meet our team.Close

Thank you for contacting us. A member of our team will be in touch shortly. Close

An error occurred while submitting your form. Please try again or file a bug report. Close

  1. Blog
  2. Article

Jeremie Deray
on 5 September 2019

The teleop_tools arrive in ROS 2 Dashing!


Please note that this blog post has old information that may no longer be correct. We invite you to read the content as a starting point but please search for more updated information in the ROS documentation

After exploring some ROS 2 subtleties and implementing some CLI tools we felt were missing, the time has come to get our hands even more dirty.

What better way to learn than by doing?

C’est en forgeant qu’on devient forgeron

Humm, pardon my french,

Practice makes perfect

To enter the realm of ROS 2 and discover its wording, its patterns, its colors, we decided it was time to do something a little larger than yet another publisher demo. Don’t get me wrong, these kinds of examples are great and often are a goto when the new things aren’t totally mastered yet. But dealing with an actual package better highlights the various intricacies of the code – how the pieces fit together and possibly blow up in your face.

We will leave covering the differences between ROS 1 and ROS 2 to past and future posts.  Here instead we will advertise a ROS 2 port of a very useful set of ROS 1 tools: the teleop_tools package.

teleop_tools, tools for tele-operation

As its name suggests, the teleop_tools package is a collection of tools for tele-operating a robot. The three main components are mouse_teleop, key_teleop and joy_teleop.

First allow me to briefly motivate why this particular package was chosen for this exercise. First, I personally use at least two of the three tools on a (very) regular basis. They do a simple job but do it well. If you have never used them, give them a look, they are worth it. Especially if you are a ROS 2 user, there aren’t many such tools just yet and after testing these you may wonder why you’d bother with any others. Second, they aren’t overly complex, but their functionality covers a lot of the main aspects of ROS 2: parameters, topics, services, actions, etc. Combining these two facts, this package is an ideal candidate for better learning ROS 2 while bringing something very useful to the community.

mouse_teleop

Is your 12 000 dpi gamer mouse getting dusty? QtCreator isn’t quite the thrill of a FPS game? Mourn no more, for the mouse_teleop package allows you to send twist commands over a topic with your mouse!

How to use,

$ ros2 run mouse_teleop mouse_teleop

The following GUI should appear,

key_teleop

This package offers a very simple terminal-based interface to send twist commands at the tip of the four arrow keys of a keyboard.

ROS 1 wiki page

How to use,

$ ros2 run key_teleop key_teleop

The following interface should appear in your terminal,

joy_teleop

The joy_teleop package is likely the more interesting of the three tools as it offers extended functionality compared to the previous two. Listening to a sensor_msgs/msg/Joy message (e.g. published by a joynode), it supports mapping different actions to each button (or buttons combination) of a remote controller through a configuration file. Mapped actions can be any of the three basic ROS 2 interfaces,

  • publishing to a topic
  • requesting a service
  • sending an action goal

ROS 1 wiki page

A brief example of a joy_teleop configuration file is given below, showcasing each of the three interfaces.

joy_teleop:
 ros__parameters:
   move:
      type: topic
     interface_type:  geometry_msgs/msg/Twist
      topic_name: cmd_vel
      axis_mappings:
        linear-x:
          axis: 1
          scale: 0.5
        angular-z:
          axis: 2
         scale: 0.5

    add_two_ints:
      type: service
      interface_type: example_interfaces/srv/AddTwoInts
      service_name: add_two_ints
      service_request:
        a: 11
        b: 31
     buttons: [10]

    fibonacci:
      type: action
      interface_type: action_tutorials/action/Fibonacci
      action_name: fibonacci
      action_goal:
        order: 5
     buttons: [4, 5, 6, 7]

How to use,

ros2 launch joy_teleop joy_teleop.launch.py

Note that the package provides a configuration file example to get you started.

Conclusion

teleop_tools just landed in ROS 2 Dashing, so it’s not available in the ROS Debian repositories just yet. If you’d like to use it now you can always build it from source, but it should be released soon. Overall the experience was successful– I learned more of the ins and outs of ROS 2, and now there’s another incredibly useful set of tools available to the community!

Do you know of any other tools such as teleop_tools that you are deeply missing in your new ROS 2 habits? Please let us know or feel free to share any other feedback and (hopefully not so many) tickets on github!

Related posts


gbeuzeboc
20 July 2022

How to use ROS 2 shared memory in snaps

Robotics Article

If you already tried to package ROS 2 Foxy applications into snaps, you might have encountered the following error regarding shared memory: This log is stating that FastDDS (formerly known as FastRTPS) couldn’t create a file for the shared memory mechanism due to denied permission. Fortunately, FastDDS is smart enough to fallback to a non ...


Gabriel Aguiar Noury
23 May 2022

Install ROS 2 Humble in Ubuntu 20.04 or 18.04 using LXD containers

Robotics Article

We welcome the new release of ROS 2 Humble which targets the recently released Ubuntu 22.04. If you want to install it now, please visit the ROS 2 Humble documentation. But if you want to install ROS 2 Humble and test compatibility, keeping your current Ubuntu (20.04, 18.04,…) environment stable until you know you are ...


Gabriel Aguiar Noury
11 October 2023

AMD Kria™ KR260 Robotics Starter Kit and Ubuntu: An exploration into future robotics development

Robotics Article

The robotics field is constantly evolving, and with AMD and Canonical’s collaboration, the trajectory towards a more adaptable and efficient robotics framework is shaping up. Last year, AMD introduced the Kria™ KR260 Robotics Kit. The board embodies the spirit of seamless integration, ensuring developers face fewer barriers when developin ...