Skip to content

Use a Telegram bot from ROS to make robots do stuff from the Telegram chat

Notifications You must be signed in to change notification settings

tue-robotics-graveyard/telegram_robot

 
 

Repository files navigation

Telegram bot for your ROS enabled robot

Given that the realtime chatting app Telegram enables the use of bots why not connect your robot via that service?

Requisites

You need python-telegram-bot.

sudo pip install python-telegram-bot --upgrade

You need to get a TOKEN talking to the @botfather bot as described here. Remember you can use the Telegram web client, although you still need a phone with telegram to allow connecting to it.

Configure

Copy from config/example_token.yaml to token.yaml and add your token.

cp `rospack find telegram_robot`/config/example_token.yaml `rospack find telegram_robot`/config/token.yaml

Launch

You can test if your token works with:

roslaunch telegram_robot echobot_example.launch

The bot should echo what you write to it.

What can you do

  • To publish anything the bot receives in the chat in a std_msgs/String topic (/telegram_bot/telegram_chat) use:
roslaunch telegram_robot chat_pub.launch

Then you can do whatever you want with the sentences from any other node you program.

  • To make the robot answer you back an image of your choosing of any sensor_msgs/Image topic available:
roslaunch telegram_robot chat_pub.launch

capture of the telegram chat

Watch it working in this video.

  • To drive the robot via a geometry_msgs/Twist topic run:
roslaunch telegram_robot arrows.launch

capture of the custom keyboard

Watch it working in this video.

How we got here

Telegram recommends the Python libraries:

And googling you also find:

So we choose python-telegram-bot after checking which had the biggest and most active community of users and also had good documentation.

About

Use a Telegram bot from ROS to make robots do stuff from the Telegram chat

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 91.0%
  • CMake 9.0%