Ejemplo n.º 1
0
Robot.urdfSuffix = '_capsule'
Robot.srdfSuffix= '_capsule'
#Robot.urdfSuffix = ''
#Robot.srdfSuffix= ''

robot = Robot ('hrp2_14')
robot.setJointBounds ("root_joint", [-3, 3, -3, 3, 0, 1,-1,1,-1,1,-1,1,-1,1])
cl = robot.client

q0 = robot.getInitialConfig()

# Add constraints
ps = ProblemSolver (robot)
# Remove joint bound validation
ps.hppcorba.problem.clearConfigValidations()
ps.addConfigValidation("CollisionValidation")
ps.addPartialCom ('hrp2_14', ['root_joint'])
robot.createSlidingStabilityConstraint ("balance/", 'hrp2_14', robot.leftAnkle,
                                        robot.rightAnkle,q0)
ps.addNumericalConstraints ("balance", ["balance/relative-com",
                                        "balance/relative-pose",
                                        "balance/pose-left-foot",])

# lock hands in closed position
lockedjointDict = robot.leftHandClosed ()
lockedJoints = list ()
for name, value in lockedjointDict.items ():
    ljName = "locked_" + name
    ps.createLockedJoint (ljName, name, value)
    lockedJoints.append (ljName)