Kinetic: turtlesim and teleop_key. Change keyboard key input?


#1

Hello everyone. I’m at the beginning with ROS. I installed the Kinetic on ubuntu 16.04 LTS.

I would like to understand how I can change the keys to control the turtlesim from the teleop_key (for example, instead of the arrows, the keys w, a, s, d). It can be done? Can someone help me?
Thank you.


(Gil kijong) #3

Hi, you can change keys.

Fisrt, check which topic subscribe turtlesim node. Maybe this node subscribes ‘cmd_vel’ topic.

And make new publisher node for publish this topic.

I recommend that you refer to the code below

You just change KEYCODE.