From e1484b8216eb749d9ee58301ac5a623061318781 Mon Sep 17 00:00:00 2001 From: Kei Okada Date: Sat, 16 Jul 2016 16:58:39 +0900 Subject: [PATCH 1/2] always add current poisition as the first point in trajectory points --- src/joint_trajectory_action/joint_trajectory_action.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/joint_trajectory_action/joint_trajectory_action.py b/src/joint_trajectory_action/joint_trajectory_action.py index 99b2171..4b0366a 100644 --- a/src/joint_trajectory_action/joint_trajectory_action.py +++ b/src/joint_trajectory_action/joint_trajectory_action.py @@ -361,7 +361,7 @@ def _on_trajectory_action(self, goal): dimensions_dict = self._determine_dimensions(trajectory_points) - if num_points == 1: + if num_points >= 1 and trajectory_points[0].time_from_start.to_sec() > 0: # Add current position as trajectory point first_trajectory_point = JointTrajectoryPoint() first_trajectory_point.positions = self._get_current_position(joint_names) From 2684437f4367f72b62d6601393f07913305a8ecc Mon Sep 17 00:00:00 2001 From: Kei Okada Date: Mon, 26 Sep 2016 20:48:39 +0900 Subject: [PATCH 2/2] it already retuned when num_points == 0 --- src/joint_trajectory_action/joint_trajectory_action.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/joint_trajectory_action/joint_trajectory_action.py b/src/joint_trajectory_action/joint_trajectory_action.py index 4b0366a..4d03eee 100644 --- a/src/joint_trajectory_action/joint_trajectory_action.py +++ b/src/joint_trajectory_action/joint_trajectory_action.py @@ -361,7 +361,7 @@ def _on_trajectory_action(self, goal): dimensions_dict = self._determine_dimensions(trajectory_points) - if num_points >= 1 and trajectory_points[0].time_from_start.to_sec() > 0: + if trajectory_points[0].time_from_start.to_sec() > 0: # it already retuned when num_points == 0 (see 10 lines above) # Add current position as trajectory point first_trajectory_point = JointTrajectoryPoint() first_trajectory_point.positions = self._get_current_position(joint_names)