From 5e3eea8fede8a0e98520108e9920a67a08f41c97 Mon Sep 17 00:00:00 2001 From: Maulesh S Trivedi Date: Thu, 12 Nov 2015 16:17:01 -0500 Subject: [PATCH] Dont allow zeros in time_from_start to prevent the use of time_from_start in end_time in follow_controller.py --- arbotix_python/src/arbotix_python/follow_controller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arbotix_python/src/arbotix_python/follow_controller.py b/arbotix_python/src/arbotix_python/follow_controller.py index 775193b..68aa23f 100644 --- a/arbotix_python/src/arbotix_python/follow_controller.py +++ b/arbotix_python/src/arbotix_python/follow_controller.py @@ -136,9 +136,9 @@ def executeTrajectory(self, traj): desired = [ point.positions[k] for k in indexes ] # two modes: First the transition time / total duration is specified that implies joint velocities (synchronous transition) - if point.time_from_start.secs > 0 or point.time_from_start.nsecs > 0: + if point.time_from_start.secs >= 0 or point.time_from_start.nsecs >= 0: sync_transition = True - if len(point.velocities)>0: + if len(point.velocities)>0 and not all(v == 0 for v in point.velocities): rospy.logwarn("Found both a nonzero time_from_start and individual joint velocities. Chosing synchronous transition w.r.t. time_from_start.") endtime = start + point.time_from_start else: # second mode: command user-defined velocity profile until desired position is reached (consider joints separately)