Skip to content

Commit

Permalink
Single waypoint (end) working with joint controller. Need to get time…
Browse files Browse the repository at this point in the history
… slices correctly for all waypoint version
  • Loading branch information
DasGuna committed Nov 21, 2023
1 parent 3c74b33 commit 29a6079
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions armer/robots/ROSRobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1091,19 +1091,19 @@ def pose_cb(self, goal: MoveToPoseGoal) -> None:
jt_traj.header.stamp = rospy.Time.now()
jt_traj.joint_names = list(self.joint_names)
print(f"traj joint names: {jt_traj.joint_names}")
for idx in range(0,len(traj.s)):
#for idx in range(0,len(traj.s)):
# print(f"current time array: {time_array[idx]} | rospy duration: {rospy.Duration(time_array[idx])}")
jt_traj_point = JointTrajectoryPoint()
jt_traj_point.time_from_start = rospy.Duration(time_array[idx])
jt_traj_point.positions = list(traj.s[idx])
#jt_traj_point = JointTrajectoryPoint()
#jt_traj_point.time_from_start = rospy.Duration(time_array[idx])
#jt_traj_point.positions = list(traj.s[idx])
#jt_traj_point.velocities = list(traj.sd[idx])
jt_traj.points.append(jt_traj_point)
#jt_traj.points.append(jt_traj_point)

#jt_traj_point = JointTrajectoryPoint()
#jt_traj_point.time_from_start = rospy.Duration(np.max(traj.t))
#jt_traj_point.positions = list(traj.s[-1])
##jt_traj_point.velocities = traj.sd[idx]
#jt_traj.points.append(jt_traj_point)
jt_traj_point = JointTrajectoryPoint()
jt_traj_point.time_from_start = rospy.Duration(np.max(traj.t))
jt_traj_point.positions = list(traj.s[-1])
#jt_traj_point.velocities = traj.sd[idx]
jt_traj.points.append(jt_traj_point)

# Conduct 'Ghost' Robot Check for Collision throughout trajectory
# NOTE: also publishes marker representation of trajectory for visual confirmation (Rviz)
Expand Down

0 comments on commit 29a6079

Please sign in to comment.