fix loadpanda video generation
remove duplicate code (formerly Windows ffpmeg needed different settings?)
This commit is contained in:
@@ -7,23 +7,26 @@ import pybullet_robots.panda.panda_sim_grasp as panda_sim
|
||||
|
||||
#video requires ffmpeg available in path
|
||||
createVideo=False
|
||||
fps=240.
|
||||
timeStep = 1./fps
|
||||
|
||||
if createVideo:
|
||||
p.connect(p.GUI, options="--mp4=\"pybullet_grasp.mp4\", --mp4fps=240")
|
||||
p.connect(p.GUI, options="--minGraphicsUpdateTimeMs=0 --mp4=\"pybullet_grasp.mp4\" --mp4fps="+str(fps) )
|
||||
else:
|
||||
p.connect(p.GUI)
|
||||
|
||||
p.configureDebugVisualizer(p.COV_ENABLE_Y_AXIS_UP,1)
|
||||
p.configureDebugVisualizer(p.COV_ENABLE_GUI,0)
|
||||
|
||||
p.setPhysicsEngineParameter(maxNumCmdPer1ms=1000)
|
||||
p.resetDebugVisualizerCamera(cameraDistance=1.3, cameraYaw=38, cameraPitch=-22, cameraTargetPosition=[0.35,-0.13,0])
|
||||
p.setAdditionalSearchPath(pd.getDataPath())
|
||||
|
||||
timeStep=1./120.#240.
|
||||
p.setTimeStep(timeStep)
|
||||
p.setGravity(0,-9.8,0)
|
||||
|
||||
panda = panda_sim.PandaSimAuto(p,[0,0,0])
|
||||
panda.control_dt = timeStep
|
||||
|
||||
logId = panda.bullet_client.startStateLogging(panda.bullet_client.STATE_LOGGING_PROFILE_TIMINGS, "log.json")
|
||||
panda.bullet_client.submitProfileTiming("start")
|
||||
for i in range (100000):
|
||||
@@ -32,7 +35,8 @@ for i in range (100000):
|
||||
p.stepSimulation()
|
||||
if createVideo:
|
||||
p.configureDebugVisualizer(p.COV_ENABLE_SINGLE_STEP_RENDERING,1)
|
||||
time.sleep(timeStep)
|
||||
if not createVideo:
|
||||
time.sleep(timeStep)
|
||||
panda.bullet_client.submitProfileTiming()
|
||||
panda.bullet_client.submitProfileTiming()
|
||||
panda.bullet_client.stopStateLogging(logId)
|
||||
|
||||
@@ -39,7 +39,7 @@ class PandaSim(object):
|
||||
self.panda = self.bullet_client.loadURDF("franka_panda/panda.urdf", np.array([0,0,0])+self.offset, orn, useFixedBase=True, flags=flags)
|
||||
index = 0
|
||||
self.state = 0
|
||||
self.control_dt = 1./120.
|
||||
self.control_dt = 1./240.
|
||||
self.finger_target = 0
|
||||
self.gripper_height = 0.2
|
||||
#create a constraint to keep the fingers centered
|
||||
|
||||
Reference in New Issue
Block a user