ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to create a node that can control the model through arrow keys?

asked 2018-03-27 21:02:56 -0500

stefanvan gravatar image

Hi everyone, now I create a model in gazebo and wanna control it through arrow keys. To put it simple, I want to write a program that works as rosrun turtlesim turtle_teleop_key, but on my custom topic cambot/cmd_vel. How can I get the source code of turtle_teleop_key?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-03-28 02:32:53 -0500

gvdhoorn gravatar image

I would recommend to use teleop_twist_keyboard for this. No need to write anything yourself (it already publishes Twists to cmd_vel, so just remap), but if you really want to, see ros-teleop/teleop_twist_keyboard for the source.

edit flag offensive delete link more

Comments

Thank you so much, sir. The first method you recommend solves my problem.

stefanvan gravatar image stefanvan  ( 2018-03-28 03:20:27 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-03-27 21:02:56 -0500

Seen: 851 times

Last updated: Mar 28 '18