本文整理汇总了Python中trajectory_msgs.msg.JointTrajectoryPoint.positions[i]方法的典型用法代码示例。如果您正苦于以下问题:Python JointTrajectoryPoint.positions[i]方法的具体用法?Python JointTrajectoryPoint.positions[i]怎么用?Python JointTrajectoryPoint.positions[i]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类trajectory_msgs.msg.JointTrajectoryPoint
的用法示例。
在下文中一共展示了JointTrajectoryPoint.positions[i]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: execute
# 需要导入模块: from trajectory_msgs.msg import JointTrajectoryPoint [as 别名]
# 或者: from trajectory_msgs.msg.JointTrajectoryPoint import positions[i] [as 别名]
def execute(self):
super(Pr2JointTrajectoryAction, self).execute()
goal = JointTrajectoryGoal()
point = JointTrajectoryPoint()
goal.trajectory.joint_names = [''] * len(self._joints)
point.positions = [0.0] * len(self._joints)
point.velocities = [0.0] * len(self._joints)
for i, desc in enumerate(self._joints):
goal.trajectory.joint_names[i] = desc['label']
point.positions[i] = self._values[i]
if self._transform_to_radian:
point.positions[i] *= math.pi / 180.0
point.time_from_start = rospy.Duration.from_sec(self.get_duration())
goal.trajectory.points = [ point ]
#print('Pr2JointTrajectoryAction.execute() %s: %s' % (self.__class__.__name__, ','.join([str(value) for value in self._values])))
self._client.send_goal(goal)
self._timer = rospy.Timer(rospy.Duration.from_sec(self.get_duration()), self._timer_finished, oneshot=True)