本文整理汇总了Python中trajectory_msgs.msg.JointTrajectoryPoint.positions[0]方法的典型用法代码示例。如果您正苦于以下问题:Python JointTrajectoryPoint.positions[0]方法的具体用法?Python JointTrajectoryPoint.positions[0]怎么用?Python JointTrajectoryPoint.positions[0]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类trajectory_msgs.msg.JointTrajectoryPoint
的用法示例。
在下文中一共展示了JointTrajectoryPoint.positions[0]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: JointTrajectoryGoal
# 需要导入模块: from trajectory_msgs.msg import JointTrajectoryPoint [as 别名]
# 或者: from trajectory_msgs.msg.JointTrajectoryPoint import positions[0] [as 别名]
#!/usr/bin/python
import rospy
from control_msgs.msg import JointTrajectoryGoal, JointTrajectoryAction
from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint
import actionlib
if __name__=='__main__':
rospy.init_node('commando')
client = actionlib.SimpleActionClient('/r2/r_arm_controller/joint_trajectory_action',
JointTrajectoryAction)
client.wait_for_server()
goal = JointTrajectoryGoal()
t = goal.trajectory
t.header.stamp = rospy.Time.now()
t.joint_names = ['/r2/right_arm/joint%d'%i for i in range(7)]
for i in range(0, 10):
pt = JointTrajectoryPoint()
pt.positions = [0.0]*7
pt.positions[0] = -1.5 + i * 3.0/10
pt.time_from_start = rospy.Duration(i)
t.points.append(pt)
client.send_goal(goal)
client.wait_for_result()
print client.get_result()
rospy.spin()