本文整理汇总了Python中PyPR2.getRelativeTF方法的典型用法代码示例。如果您正苦于以下问题:Python PyPR2.getRelativeTF方法的具体用法?Python PyPR2.getRelativeTF怎么用?Python PyPR2.getRelativeTF使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyPR2
的用法示例。
在下文中一共展示了PyPR2.getRelativeTF方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: larm_elbow_position
# 需要导入模块: import PyPR2 [as 别名]
# 或者: from PyPR2 import getRelativeTF [as 别名]
def larm_elbow_position():
'''
returns the elbow position of the right arm comparable to function wrist_position() in the arm object
'''
p0 = PyPR2.getRelativeTF('torso_lift_link' , 'l_shoulder_pan_link')['position']
p = PyPR2.getRelativeTF('torso_lift_link' , 'l_elbow_flex_link')['position']
x = p[0] - p0[0]
y = p[1] - p0[1]
z = p[2] - p0[2]
pos = numpy.array([x,y,z])
return(pos)
示例2: pos_larm_grip_wrt_tor_shpan
# 需要导入模块: import PyPR2 [as 别名]
# 或者: from PyPR2 import getRelativeTF [as 别名]
def pos_larm_grip_wrt_tor_shpan():
'''
Returns the left arm gripper position vector(endeffector position) with respect to the torso shoulder pan joint center
'''
p0 = PyPR2.getRelativeTF('torso_lift_link' , 'l_shoulder_pan_link')['position']
pr = vecmat.as_vector(PyPR2.getRelativeTF('torso_lift_link' , 'l_gripper_r_finger_tip_link')['position'])
pl = vecmat.as_vector(PyPR2.getRelativeTF('torso_lift_link' , 'l_gripper_l_finger_tip_link')['position'])
p = (pl + pr)/2
x = p[0] - p0[0]
y = p[1] - p0[1]
z = p[2] - p0[2]
pos = numpy.array([x,y,z])
return(pos)
示例3: pos_rarm_grip_wrt_tor
# 需要导入模块: import PyPR2 [as 别名]
# 或者: from PyPR2 import getRelativeTF [as 别名]
def pos_rarm_grip_wrt_tor():
'''
Returns the right arm gripper position vector(endeffector position) with respect to the (torso) at the origin. (Refer to pos_larm_grip_wrt_tor())
'''
p0 = PyPR2.getRelativeTF('base_link' , 'r_shoulder_pan_link')['position']
p = p0 + pos_rarm_grip_wrt_tor_shpan() + numpy.array([0.0, 0.0, 0.051])
return p
示例4: pos_rarm_grip
# 需要导入模块: import PyPR2 [as 别名]
# 或者: from PyPR2 import getRelativeTF [as 别名]
def pos_rarm_grip():
'''
Returns the global position of the right arm gripper finger tip
'''
pr = vecmat.as_vector(PyPR2.getRelativeTF('base_footprint' , 'r_gripper_r_finger_tip_link')['position'])
pl = vecmat.as_vector(PyPR2.getRelativeTF('base_footprint' , 'r_gripper_l_finger_tip_link')['position'])
p = (pl + pr)/2
orient = geo.Orientation_3D(PyPR2.getRobotPose()['orientation'], representation = 'quaternion')
pg = numpy.dot(orient.matrix(), p) # p global is Rb Multiply by p
p0 = PyPR2.getRobotPose()['position']
x = pg[0] + p0[0]
y = pg[1] + p0[1]
z = pg[2] + p0[2]
pos = numpy.array([x,y,z])
return(pos)
示例5: pos_larm_grip_wrt_tor
# 需要导入模块: import PyPR2 [as 别名]
# 或者: from PyPR2 import getRelativeTF [as 别名]
def pos_larm_grip_wrt_tor():
'''
Returns the left arm gripper position vector(endeffector position) with respect to the (torso) at the origin.
The torso origin is at the floor footprint (projection) of the middle point between the two shoulder pan joint centers.
The torso origin is about 51 mm below the base_link origin and 50 mm shifted towards the back. The orientations of torso and base are identical.
'''
p0 = PyPR2.getRelativeTF('base_link' , 'l_shoulder_pan_link')['position']
p = p0 + pos_larm_grip_wrt_tor_shpan() + numpy.array([0.05, 0.0, 0.051])
return p
示例6: look_rg
# 需要导入模块: import PyPR2 [as 别名]
# 或者: from PyPR2 import getRelativeTF [as 别名]
def look_rg():
pos = PyPR2.getRelativeTF( '/base_link', '/r_gripper_tool_frame' )['position']
PyPR2.pointHeadTo('base_link', pos[0],pos[1],pos[2])
示例7: look_lg
# 需要导入模块: import PyPR2 [as 别名]
# 或者: from PyPR2 import getRelativeTF [as 别名]
def look_lg():
#pos = pos_larm_grip_wrt_tor_shpan()
pos = PyPR2.getRelativeTF( '/base_link', '/l_gripper_tool_frame' )['position']
PyPR2.pointHeadTo('base_link', pos[0],pos[1],pos[2])
示例8: bl_midpoint
# 需要导入模块: import PyPR2 [as 别名]
# 或者: from PyPR2 import getRelativeTF [as 别名]
def bl_midpoint():
'''
Returns the univrsal coordinates of the base laser middle point
'''
p0 = PyPR2.getRelativeTF('base_footprint' , 'base_laserscan')['position']
示例9: rarm_wrist_orientation
# 需要导入模块: import PyPR2 [as 别名]
# 或者: from PyPR2 import getRelativeTF [as 别名]
def rarm_wrist_orientation():
'''
returns the wrist orientation of the right arm (the same orientation returned by function wrist_orientation() in the arm object but in quaternions)
'''
q = PyPR2.getRelativeTF('torso_lift_link' , 'r_wrist_flex_link')['orientation']
return(q)