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

Revision history [back]

You would expect it to only go straight, right?

This is not happening, because the robot rotates, until it points at the goal. Then it drives. But while getting closer to the goal, the heading angle difference keeps increasing until it is out of the .1 rad margin.

Maybe you would like the behaviour better if it could also turn in the other direction ..

if angle_to_go-theta > 0:
    speed.angular.z = -0.3
elif angle_to_go-theta < 0:
    speed.angular.z = 0.3

You would expect it to only go straight, right?

This is not happening, because the robot rotates, until it points at the goal. Then it drives. But while getting closer to the goal, the heading angle difference keeps increasing until it is out of the .1 rad margin.

Maybe you would like the behaviour better if it could also turn in the other direction ..

if angle_to_go-theta > 0:
    speed.angular.z = -0.3
elif angle_to_go-theta < 0:
    speed.angular.z = 0.3

You would expect it to only go straight, right?

This is not happening, because the robot rotates, until it points at the goal. Then it drives. But while getting closer to the goal, the heading angle difference keeps increasing until it is out of the .1 rad margin.

Maybe you would like the behaviour better if it could also turn in the other direction ..

if angle_to_go-theta > 0:
    speed.angular.z = -0.3
0.3
elif angle_to_go-theta < 0:
    speed.angular.z = 0.3
-0.3