Skip to content

Commit 9cdc4ff

Browse files
committed
skip trajectory points faster than sample_rate
1 parent de4be32 commit 9cdc4ff

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cob_hardware_emulation/scripts/emulation_follow_joint_trajectory.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ def fjta_cb(self, goal):
7777
self.as_fjta.set_aborted()
7878
return
7979

80+
point_time_delta = point.time_from_start - time_since_start_of_previous_point
81+
if point_time_delta.to_sec() < self.sample_rate_dur_secs:
82+
rospy.logwarn("current trajectory point has time_delta smaller than sample_rate: {} < {}! Skipping".format(point_time_delta.to_sec(), self.sample_rate_dur_secs))
83+
continue
84+
8085
# we need to resort the positions array because moveit sorts alphabetically but all other ROS components sort in the URDF order
8186
positions_sorted = []
8287
for joint_name in self.joint_names:

0 commit comments

Comments
 (0)