当前位置: 首页>>代码示例>>Python>>正文


Python PyPR2.getRelativeTF方法代码示例

本文整理汇总了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)    
开发者ID:Sidiitd,项目名称:shooting_experiment,代码行数:13,代码来源:pyride_interpreter.py

示例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)    
开发者ID:Sidiitd,项目名称:shooting_experiment,代码行数:15,代码来源:pyride_interpreter.py

示例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
开发者ID:Sidiitd,项目名称:shooting_experiment,代码行数:11,代码来源:pyride_interpreter.py

示例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)    
开发者ID:Sidiitd,项目名称:shooting_experiment,代码行数:21,代码来源:pyride_interpreter.py

示例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
开发者ID:Sidiitd,项目名称:shooting_experiment,代码行数:13,代码来源:pyride_interpreter.py

示例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]) 
开发者ID:Sidiitd,项目名称:shooting_experiment,代码行数:5,代码来源:pyride_interpreter.py

示例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]) 
开发者ID:Sidiitd,项目名称:shooting_experiment,代码行数:6,代码来源:pyride_interpreter.py

示例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']    
开发者ID:Sidiitd,项目名称:shooting_experiment,代码行数:7,代码来源:pyride_interpreter.py

示例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)    
开发者ID:Sidiitd,项目名称:shooting_experiment,代码行数:8,代码来源:pyride_interpreter.py


注:本文中的PyPR2.getRelativeTF方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。