本文整理汇总了Python中PyPR2.moveArmWithJointTrajectoryAndSpeed方法的典型用法代码示例。如果您正苦于以下问题:Python PyPR2.moveArmWithJointTrajectoryAndSpeed方法的具体用法?Python PyPR2.moveArmWithJointTrajectoryAndSpeed怎么用?Python PyPR2.moveArmWithJointTrajectoryAndSpeed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyPR2
的用法示例。
在下文中一共展示了PyPR2.moveArmWithJointTrajectoryAndSpeed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run_config_trajectory
# 需要导入模块: import PyPR2 [as 别名]
# 或者: from PyPR2 import moveArmWithJointTrajectoryAndSpeed [as 别名]
def run_config_trajectory(j_traj, duration = 10.0, dt = None, phi_dot = None, is_left_arm = False):
global rarm_reached, rarm_failed
global larm_reached, larm_failed
if is_left_arm:
larm_failed = False
larm_reached = False
else:
rarm_failed = False
rarm_reached = False
phi = 0.0
dic_list = []
t = 0.0
if phi_dot == None:
phi_dot = j_traj.phi_end/duration
if dt == None:
dt = 0.1*duration
stay = True
while stay:
if (t > duration) or gen.equal(t, duration, epsilon = 0.1*dt):
t = duration
stay = False
j_traj.set_phi(t*phi_dot)
if is_left_arm:
g = gen_larm_joint_posvel_dict(j_traj.current_position, j_traj.current_velocity*phi_dot, dt)
else:
g = gen_rarm_joint_posvel_dict(j_traj.current_position, j_traj.current_velocity*phi_dot, dt)
dic_list.append(g)
t = t + dt
PyPR2.moveArmWithJointTrajectoryAndSpeed(dic_list)