Beispiel #1
0
                   cubeStartPos,
                   cubeStartOrientation,
                   useFixedBase=0)
"""
#To get info of the robot
print("Join Info: ")
for i in range(p.getNumJoints(robot)):
 	print(p.getJointInfo(robot, i))

print("Link Info: ")
for i in range(p.getNumJoints(robot)+1):
           print(p.getLinkStates(robot, [i]))
"""

walk_gen = walkGenerator.WalkGenerator(l0, l1, l2, l3, hip_shift,
                                       sittinghip_shift, swayLength, t0, robot,
                                       physicsClient, motor_force)

#################################################################################################################################################################
################################################### What your Robot should do for you, write below! #############################################################
#################################################################################################################################################################

# time.sleep(1.5)
# walk_gen.sit_stand_motion(d = "sit")
# time.sleep(1.5)

# # forward motion
# swayLength = 0.2
# print(p.getLinkStates(robot, [0])[0][0])
# print(p.getEulerFromQuaternion(p.getLinkStates(robot, [0])[0][1]))
planeID = p.loadURDF("plane.urdf")
robotID = p.loadURDF(os.path.abspath(os.path.dirname(__file__)) +
                     '/humanoid_leg_12dof.8.urdf', [0, 0, 0.31],
                     p.getQuaternionFromEuler([0, 0, 0]),
                     useFixedBase=False)

motorsController = motorController.MotorController(robotID, physicsClient,
                                                   fixedTimeStep, motor_kp,
                                                   motor_kd, motor_torque,
                                                   motor_max_velocity)
print(motorsController.getRevoluteJoint_nameToId())

# %%
motorController.MotorController()

walk = walkGenerator.WalkGenerator()
walk.setWalkParameter(bodyMovePoint=8,
                      legMovePoint=8,
                      height=50,
                      stride=90,
                      sit=50,
                      swayBody=30,
                      swayFoot=0,
                      bodyPositionForwardPlus=5,
                      swayShift=3,
                      liftPush=0.5,
                      landPull=0.7,
                      timeStep=0.06,
                      damping=0.0,
                      incline=0.0)
walk.generate()