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

Revision history [back]

click to hide/show revision 1
initial version

Your pub.publish(speed) is inside the else condition. Most probably, else condition is not being satisfied. Bring it outside the condition like the following and it will publish the twist msg.

 If abs(angle_to_goal - theta) > 0.1:
      speed.linear.x = 0.0
      speed.angular.z = 0.3
 else:
       speed.linear.x = 0.5
       speed.angular.z = 0.0

 pub.publish(speed)
 r.sleep()