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


Python ProblemSolver.lockJoint方法代码示例

本文整理汇总了Python中hpp.corbaserver.ProblemSolver.lockJoint方法的典型用法代码示例。如果您正苦于以下问题:Python ProblemSolver.lockJoint方法的具体用法?Python ProblemSolver.lockJoint怎么用?Python ProblemSolver.lockJoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在hpp.corbaserver.ProblemSolver的用法示例。


在下文中一共展示了ProblemSolver.lockJoint方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: ViewerFactory

# 需要导入模块: from hpp.corbaserver import ProblemSolver [as 别名]
# 或者: from hpp.corbaserver.ProblemSolver import lockJoint [as 别名]
# q = ['shoulder_pan_joint', 'shoulder_lift_joint', 'elbow_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint'] 6 DoF#
q1 = [0, -1.57, 1.57, 0, 0, 0]; q2 = [0.2, -1.57, -1.8, 0, 0.8, 0]
q3 = [0, -1.57, 1.57, 3.267256451, 0, 0]

q_init = q1;
# q_goal = q2
q_goal = q3

from hpp.gepetto import ViewerFactory, PathPlayerGui
vf = ViewerFactory (ps)
# vf.loadObstacleModel ("ur_description","obstacles","obstacles")
vf.loadObstacleModel ("ur_description","table","table")
# vf.loadObstacleModel ("ur_description","wall","wall")
vf(q1)

ps.lockJoint("elbow_joint", [q1[2]])

ps.selectPathValidation("Progressive", .05)

ps.setParameter("SplineGradientBased/alphaInit", CORBA.Any(CORBA.TC_double, 0.3))
ps.setParameter("SplineGradientBased/alwaysStopAtFirst", CORBA.Any(CORBA.TC_boolean, True))
ps.setParameter("SplineGradientBased/linearizeAtEachStep", CORBA.Any(CORBA.TC_boolean, False))

print "Optimizer parameters are:"
print "alphaInit:", ps.getParameter("SplineGradientBased/alphaInit").value()
print "alwaysStopAtFirst:", ps.getParameter("SplineGradientBased/alwaysStopAtFirst").value()
print "linearizeAtEachStep:", ps.getParameter("SplineGradientBased/linearizeAtEachStep").value()
print ""

import datetime as dt
totalSolveTime = dt.timedelta (0)
开发者ID:humanoid-path-planner,项目名称:hpp_benchmark,代码行数:33,代码来源:script.py

示例2: WsClient

# 需要导入模块: from hpp.corbaserver import ProblemSolver [as 别名]
# 或者: from hpp.corbaserver.ProblemSolver import lockJoint [as 别名]
wcl = WsClient ()
wcl.problem.addStaticStabilityConstraints ("balance", q0, robot.leftAnkle,
                                           robot.rightAnkle, "",
                                           Problem.SLIDING)

ps = ProblemSolver (robot)
ps.setNumericalConstraints ("balance", ["balance/relative-com",
                                                "balance/relative-orientation",
                                                "balance/relative-position",
                                                "balance/orientation-left-foot",
                                                "balance/position-left-foot"])

# lock hands in closed position
lockedjoints = robot.leftHandClosed ()
for name, value in lockedjoints.iteritems ():
    ps.lockJoint (name, value)

lockedjoints = robot.rightHandClosed ()
for name, value in lockedjoints.iteritems ():
    ps.lockJoint (name, value)


q1 = [0.0, 0.0, 0.705, 0., 0., 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, -0.4, 0, -1.2, -1.0, 0.0, 0.0, 0.174532, -0.174532, 0.174532, -0.174532, 0.174532, -0.174532, 0.261799, -0.17453, 0.0, -0.523599, 0.0, 0.0, 0.174532, -0.174532, 0.174532, -0.174532, 0.174532, -0.174532, 0.0, 0.0, -0.453786, 0.872665, -0.418879, 0.0, 0.0, 0.0, -0.453786, 0.872665, -0.418879, 0.0]

res = ps.applyConstraints (q1)
if res [0]:
    q1proj = res [1]
else:
    raise RuntimeError ("Failed to apply constraint.")

开发者ID:humanoid-path-planner,项目名称:hpp_benchmark,代码行数:31,代码来源:script.py

示例3: RuntimeError

# 需要导入模块: from hpp.corbaserver import ProblemSolver [as 别名]
# 或者: from hpp.corbaserver.ProblemSolver import lockJoint [as 别名]
    'l_wrist_3_joint': -1.37711410223,
    'r_shoulder_pan_joint': 1.57079632679,
    'r_shoulder_lift_joint': -2.05619449019,
    'r_elbow_joint': -0.2,
    'r_wrist_1_joint': -2.61799387799,
    'r_wrist_2_joint': 2.09439510239,
    'r_wrist_3_joint': 0.785398163397,
}

q_goal = robot.halfSitting [::]
for j, v in dict_goal.iteritems ():
    i = robot.rankInConfiguration [j]
    q_goal [i] = v

for j, v in robot.openHand (None, 0.2, 'left').iteritems ():
    ps.lockJoint (j, [v,])

for j, v in robot.openHand (None, 0.2, 'right').iteritems ():
    ps.lockJoint (j, [v,])

ps.lockJoint ('base_joint_xy', [0,0])
ps.lockJoint ('base_joint_rz', [1,0])

res = ps.applyConstraints (q_init)
if res [0]:
    q_init = res [1]
else:
    raise RuntimeError ('Failed to apply constraints on init config.')

res = ps.applyConstraints (q_goal)
if res [0]:
开发者ID:humanoid-path-planner,项目名称:hpp-tom,代码行数:33,代码来源:test.py


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