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


Python ProblemSolver.applyConstraints方法代码示例

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


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

示例1:

# 需要导入模块: from hpp.corbaserver import ProblemSolver [as 别名]
# 或者: from hpp.corbaserver.ProblemSolver import applyConstraints [as 别名]
ps.lockOneDofJoint("NeckYaw",   robot.getJointDofValue("NeckYaw"))
ps.lockOneDofJoint("NeckPitch", robot.getJointDofValue("NeckPitch"))
ps.lockOneDofJoint("HeadPitch", robot.getJointDofValue("HeadPitch"))
ps.lockOneDofJoint("HeadRoll",  robot.getJointDofValue("HeadRoll"))
ps.lockOneDofJoint("LToePitch", robot.getJointDofValue("LToePitch"))
ps.lockOneDofJoint("RToePitch", robot.getJointDofValue("RToePitch"))
ps.lockOneDofJoint("LEyeYaw",   robot.getJointDofValue("LEyeYaw"))
ps.lockOneDofJoint("LEyePitch", robot.getJointDofValue("LEyePitch"))
ps.lockOneDofJoint("REyeYaw",   robot.getJointDofValue("REyeYaw"))
ps.lockOneDofJoint("REyePitch", robot.getJointDofValue("REyePitch"))

q_init = robot.getCurrentConfig()
#q_start = robot.getCurrentConfig()

# Get one config wrt constraints
res, q, error, time = ps.applyConstraints (q_init)
full_time = time
while res == False:
	full_time += time
	res, q, error, time = ps.applyConstraints (q)

#robot.shootRandomConfig()
#robot.setCurrentConfig(q)
#q = robot.getRightHandOpenConfig()

full_time
r(q)


###################################################
# Test de timing pour trouver une solution IK
开发者ID:RenaudViry,项目名称:hpp_romeo,代码行数:33,代码来源:romeo.py

示例2: RuntimeError

# 需要导入模块: from hpp.corbaserver import ProblemSolver [as 别名]
# 或者: from hpp.corbaserver.ProblemSolver import applyConstraints [as 别名]
                                                "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.")


q2 = [0.0, 0.0, 0.705, 0, 0, 0, 1, 0.0, 0.0, 0.0, 0.0, 1.0, 0, -1.4, -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 (q2)
if res [0]:
    q2proj = res [1]
else:
    raise RuntimeError ("Failed to apply constraint.")

ps.selectPathValidation ("Progressive", 0.025)
开发者ID:humanoid-path-planner,项目名称:hpp_benchmark,代码行数:33,代码来源:script.py

示例3: RuntimeError

# 需要导入模块: from hpp.corbaserver import ProblemSolver [as 别名]
# 或者: from hpp.corbaserver.ProblemSolver import applyConstraints [as 别名]
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]:
    q_goal = res [1]
else:
    raise RuntimeError ('Failed to apply constraints on goal config.')

robot.setCurrentConfig (q_init)
r = vf.createViewer (collisionURDF = True)
r (q_init)
开发者ID:humanoid-path-planner,项目名称:hpp-tom,代码行数:31,代码来源:test.py


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