PR2 cmd_vel: publishing and latching message

I have been following the video tutorial found at the following link: PR2 sim quick start with ROS Noetic - YouTube

I have been trying to get the PR2 to move with the following commands and I do not see any movement even when I echo it there is no message.

  1. roslaunch pr2_tc_gazebo world.launch
  2. roslaunch pr2_tc_description robot_spawn.launch x:=2.0 y:=2.0 z:=0.08
  3. roslaunch pr2_tc_teleop pr2_teleop_bridge.launch
  4. rostopic pub /pr2/cmd_vel geometry_msgs/Twist “linear:
    x: 200.0
    y: 0.0
    z: 0.0
    angular:
    x: 0.0
    y: 0.0
    z: 0.0”

It still does not work and just says “publishing and latching message. Press ctrl-C to terminate”

Then I did another terminal:
user:~$ rostopic echo /pr2/cmd_vel
linear: x: 200.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0

Can you please help me understand why it is not been published?

Many thanks for your help!

Updating from

#!/usr/bin/env python

to

#!/usr/bin/env python3

Solved everything! Thank you for trying
2 Likes