Skip to content

Commit 98d2703

Browse files
committed
Don't drive if we're already at the goal
1 parent 0de581c commit 98d2703

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/robot_callbacks.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,11 @@ def _move_to_pose(goal, publisher, controller):
192192
-_MOVE_ANGULAR_LIMIT
193193
if vel_msg.angular.z < -_MOVE_ANGULAR_LIMIT else vel_msg.angular.z)
194194

195-
# Publish velocity
196-
publisher.publish(vel_msg)
197-
hz_rate.sleep()
195+
# Publish velocity (don't move if we're already there!)
196+
if (rho > _MOVE_TOL_DIST):
197+
publisher.publish(vel_msg)
198+
hz_rate.sleep()
199+
_move_to_angle(goal, publisher, controller)
198200
publisher.publish(Twist())
199201

200202

0 commit comments

Comments
 (0)