tweak tensorflow humanoid_running.py demo to be more robust against mouse dragging
(mouse dragging adds energy in the system that can cause explosions/instability): use solverResidualThreshold and increase number of sub steps, also clamp the max force.
This commit is contained in:
@@ -10,7 +10,7 @@ if (cid<0):
|
|||||||
cid = p.connect(p.GUI) #DIRECT is much faster, but GUI shows the running gait
|
cid = p.connect(p.GUI) #DIRECT is much faster, but GUI shows the running gait
|
||||||
|
|
||||||
p.setGravity(0,0,-9.8)
|
p.setGravity(0,0,-9.8)
|
||||||
p.setPhysicsEngineParameter(fixedTimeStep=1.0/60., numSolverIterations=5, numSubSteps=2)
|
p.setPhysicsEngineParameter(fixedTimeStep=1.0/60.,solverResidualThreshold=1-10, numSolverIterations=50, numSubSteps=4)
|
||||||
#this mp4 recording requires ffmpeg installed
|
#this mp4 recording requires ffmpeg installed
|
||||||
#mp4log = p.startStateLogging(p.STATE_LOGGING_VIDEO_MP4,"humanoid.mp4")
|
#mp4log = p.startStateLogging(p.STATE_LOGGING_VIDEO_MP4,"humanoid.mp4")
|
||||||
|
|
||||||
@@ -180,11 +180,14 @@ def demo_run():
|
|||||||
|
|
||||||
forces = [0.] * len(motors)
|
forces = [0.] * len(motors)
|
||||||
for m in range(len(motors)):
|
for m in range(len(motors)):
|
||||||
forces[m] = motor_power[m]*actions[m]*0.082
|
limit=15
|
||||||
|
ac = np.clip(actions[m],-limit,limit)
|
||||||
|
print (ac)
|
||||||
|
forces[m] = motor_power[m]*ac*0.082
|
||||||
p.setJointMotorControlArray(human, motors,controlMode=p.TORQUE_CONTROL, forces=forces)
|
p.setJointMotorControlArray(human, motors,controlMode=p.TORQUE_CONTROL, forces=forces)
|
||||||
|
|
||||||
p.stepSimulation()
|
p.stepSimulation()
|
||||||
time.sleep(0.01)
|
#time.sleep(0.01)
|
||||||
distance=5
|
distance=5
|
||||||
yaw = 0
|
yaw = 0
|
||||||
humanPos, humanOrn = p.getBasePositionAndOrientation(human)
|
humanPos, humanOrn = p.getBasePositionAndOrientation(human)
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -582,7 +582,7 @@ if 'BT_USE_EGL' in EGL_CXX_FLAGS:
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name = 'pybullet',
|
name = 'pybullet',
|
||||||
version='2.3.3',
|
version='2.3.4',
|
||||||
description='Official Python Interface for the Bullet Physics SDK specialized for Robotics Simulation and Reinforcement Learning',
|
description='Official Python Interface for the Bullet Physics SDK specialized for Robotics Simulation and Reinforcement Learning',
|
||||||
long_description='pybullet is an easy to use Python module for physics simulation, robotics and deep reinforcement learning based on the Bullet Physics SDK. With pybullet you can load articulated bodies from URDF, SDF and other file formats. pybullet provides forward dynamics simulation, inverse dynamics computation, forward and inverse kinematics and collision detection and ray intersection queries. Aside from physics simulation, pybullet supports to rendering, with a CPU renderer and OpenGL visualization and support for virtual reality headsets.',
|
long_description='pybullet is an easy to use Python module for physics simulation, robotics and deep reinforcement learning based on the Bullet Physics SDK. With pybullet you can load articulated bodies from URDF, SDF and other file formats. pybullet provides forward dynamics simulation, inverse dynamics computation, forward and inverse kinematics and collision detection and ray intersection queries. Aside from physics simulation, pybullet supports to rendering, with a CPU renderer and OpenGL visualization and support for virtual reality headsets.',
|
||||||
url='https://github.com/bulletphysics/bullet3',
|
url='https://github.com/bulletphysics/bullet3',
|
||||||
|
|||||||
Reference in New Issue
Block a user