From 8a9cc95451e4a6e748b553da427e0243849fc2d0 Mon Sep 17 00:00:00 2001 From: hello-binit <64861565+hello-binit@users.noreply.github.com> Date: Fri, 19 Jun 2020 02:29:08 -0400 Subject: [PATCH] Removed unnecessary first_time conditional --- stretch_core/nodes/joint_trajectory_server.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/stretch_core/nodes/joint_trajectory_server.py b/stretch_core/nodes/joint_trajectory_server.py index 135e27d..306c10b 100644 --- a/stretch_core/nodes/joint_trajectory_server.py +++ b/stretch_core/nodes/joint_trajectory_server.py @@ -96,20 +96,15 @@ class JointTrajectoryAction: self.node.robot_mode_rwlock.release_read() return - first_time = True + robot_status = self.node.robot.get_status() # uses lock held by robot + [c.init_execution(robot_status) for c in command_groups] incremental_commands_executed = False update_rate = rospy.Rate(15.0) goal_start_time = rospy.Time.now() while True: - # Get copy of the current robot status (uses lock held by the robot). robot_status = self.node.robot.get_status() - if first_time: - for c in command_groups: - c.init_execution(robot_status) - first_time = False - if self.node.use_lift: lift_error_m = self.lift_cg.update_execution(robot_status, self.node.backlash_state) extension_error_m = self.telescoping_cg.update_execution(robot_status,