Keyboard commands to move PR2 robot on ROS Hydro not working

asked 2016-02-26 20:09:08 -0500

meep gravatar image

updated 2016-02-26 21:06:07 -0500

ahendrix gravatar image

So I ran the following commands:

rosmake pr2_teleop roslaunch pr2_teleop teleop_keyboard.launch

to be able to control the PR2 robot from the keyboard. The keys below should move the robot correct? But it is not working.

Reading from keyboard Use 'WASD' to translate Use 'QE' to yaw Press 'Shift' to run

Here is what I see in the terminal:

* /rosversion
 * /spawn_teleop_keyboard/run_vel
 * /spawn_teleop_keyboard/walk_vel
 * /spawn_teleop_keyboard/yaw_rate
 * /spawn_teleop_keyboard/yaw_run_rate

NODES
  /
    spawn_teleop_keyboard (pr2_teleop/teleop_pr2_keyboard)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
process[spawn_teleop_keyboard-1]: started with pid [9425]
Reading from keyboard
---------------------------
Use 'WASD' to translate
Use 'QE' to yaw
Press 'Shift' to run

Any help would be appreciated. Thanks

edit retag flag offensive close merge delete

Comments

It looks like it's running. Does it work if you press the WASD keys at that prompt?

ahendrix gravatar image ahendrix  ( 2016-02-26 21:14:45 -0500 )edit

That's the problem. Everything seems to be working but the robot does not move when the WASD keys are pressed.

meep gravatar image meep  ( 2016-02-26 21:43:43 -0500 )edit

I was looking at this tutorial:http://wiki.ros.org/pr2_simulator/Tutorials/BasicPR2Controls And it said: "(You need to keep the window in which you launch this node in focus while you drive the robot around)."

What does it mean by keep the terminal in focus?

meep gravatar image meep  ( 2016-02-26 21:46:36 -0500 )edit

Yea I am not sure what is going on. The keyboard controls are still not working.

meep gravatar image meep  ( 2016-02-27 20:41:49 -0500 )edit
1

I would check that the teleop output topic (probably /cmd_vel) is connected, and that valid data is published on it.

ahendrix gravatar image ahendrix  ( 2016-02-27 20:58:05 -0500 )edit

This may sound like a dumb question, but how do you check that? Certain lines of code that I run?

meep gravatar image meep  ( 2016-02-28 21:18:37 -0500 )edit

rostopic echo /cmd_vel

I would also check rostopic list and see if there's a topic called "/base_controller/command". If the topic name has changed, let me know and I'll go fix the code. This might not be a problem on your end.

alee gravatar image alee  ( 2016-02-29 08:10:24 -0500 )edit

when I run rostopic echo /cmd_vel it says "WARNING: topic [/cmd_vel] does not appear to be published yet". There also seems to be no "/base_controller/command" topic.

meep gravatar image meep  ( 2016-02-29 20:57:15 -0500 )edit