本文整理汇总了Python中hpp.corbaserver.ProblemSolver.resetConstraints方法的典型用法代码示例。如果您正苦于以下问题:Python ProblemSolver.resetConstraints方法的具体用法?Python ProblemSolver.resetConstraints怎么用?Python ProblemSolver.resetConstraints使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hpp.corbaserver.ProblemSolver
的用法示例。
在下文中一共展示了ProblemSolver.resetConstraints方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ProblemSolver
# 需要导入模块: from hpp.corbaserver import ProblemSolver [as 别名]
# 或者: from hpp.corbaserver.ProblemSolver import resetConstraints [as 别名]
ps = ProblemSolver (robot)
# create static stability constraint
wcl = WholebodyStepClient ()
wcl.problem.addStaticStabilityConstraints ("balance", q, robot.leftAnkle,
robot.rightAnkle)
# Define quatenion for righthand orientation constraints
#quat = Quaternion()
#quat.fromRPY(-1.55, -1.55, 0.0) # Right hand horizontal, grasping to -z
#quat.fromRPY(-1.55, 0.0, 0.0) # Right hand vertical, pointing down
#quat.fromRPY(0.0, 0.0, -1.55) # Right hand vertical, pointing forward
#quat.normalize()
ps.resetConstraints()
# Add constraints to problem solver
ps.setNumericalConstraints ("balance", ["balance/relative-com",
"balance/relative-orientation",
"balance/relative-position",
"balance/orientation-left-foot",
"balance/position-left-foot",])
ps.createPositionConstraint("RightHandPos", "RWristPitch", "", [0.0, 0.0, 0.0], [-2.6, -4, 0.75], True, True, True)
#ps.createOrientationConstraint("RightHandOr", "", "RWristPitch", [quat.array[0], quat.array[1], quat.array[2], quat.array[3]], True, True, True)
#ps.setNumericalConstraints ("eef", ["RightHandPos", "RightHandOr"])
ps.setNumericalConstraints ("eef", ["RightHandPos"])
ps.createPositionConstraint("LeftAnklePos", robot.leftAnkle, "", [0.0, 0.0, 0.0], [robot.getJointPosition(robot.leftAnkle)[0], robot.getJointPosition(robot.leftAnkle)[1], robot.getJointPosition(robot.leftAnkle)[2]], True, True, False)
ps.createOrientationConstraint("LeftAnkleOr", "", robot.leftAnkle, [robot.getJointPosition(robot.leftAnkle)[3], robot.getJointPosition(robot.leftAnkle)[4], robot.getJointPosition(robot.leftAnkle)[5], robot.getJointPosition(robot.leftAnkle)[6]], False, False, True)
ps.setNumericalConstraints ("lock", ["LeftAnklePos", "LeftAnkleOr"])