Robotics StackExchange | Archived questions

Keyboard commands to move PR2 robot on ROS Hydro not working

So I ran the following commands:

rosmake pr2teleop roslaunch pr2teleop 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

Asked by meep on 2016-02-26 21:09:08 UTC

Comments

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

Asked by ahendrix on 2016-02-26 22:14:45 UTC

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

Asked by meep on 2016-02-26 22:43:43 UTC

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?

Asked by meep on 2016-02-26 22:46:36 UTC

https://en.wikipedia.org/wiki/Focus_(computing)

Asked by ahendrix on 2016-02-26 23:08:34 UTC

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

Asked by meep on 2016-02-27 21:41:49 UTC

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

Asked by ahendrix on 2016-02-27 21:58:05 UTC

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

Asked by meep on 2016-02-28 22:18:37 UTC

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.

Asked by alee on 2016-02-29 09:10:24 UTC

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.

Asked by meep on 2016-02-29 21:57:15 UTC

Hm. Does that appear when you run the node too?

Asked by alee on 2016-02-29 22:17:27 UTC

when I run rostopic echo /base_controller/command it says "WARNING: no messages received and simulated time is active.Is /clock being published?"

Asked by meep on 2016-02-29 22:35:41 UTC

I meant to run the teleop node then check /cmd_vel. Also run rostopic info /cmd_vel and you can see if anything is subscribing to it. If there's a publisher but no subscriber, the disconnect is why there is no movement

Asked by alee on 2016-02-29 23:16:09 UTC

Answers