Reduce calls to the physics engine
This commit is contained in:
parent
e04361dd8c
commit
0cdeaa34f3
@ -105,7 +105,7 @@ class BtSimNode:
|
|||||||
def handle_updates(self):
|
def handle_updates(self):
|
||||||
if self.step_cnt % int(self.sim.rate / self.controller_update_rate) == 0:
|
if self.step_cnt % int(self.sim.rate / self.controller_update_rate) == 0:
|
||||||
self.cartesian_pose_controller.update()
|
self.cartesian_pose_controller.update()
|
||||||
self.gripper_interface.update(1.0 / 60.0)
|
self.gripper_interface.update(1.0 / self.controller_update_rate)
|
||||||
if self.step_cnt % int(self.sim.rate / self.joint_state_publish_rate) == 0:
|
if self.step_cnt % int(self.sim.rate / self.joint_state_publish_rate) == 0:
|
||||||
self.publish_joint_state()
|
self.publish_joint_state()
|
||||||
if self.step_cnt % int(self.sim.rate / self.camera_publish_rate) == 0:
|
if self.step_cnt % int(self.sim.rate / self.camera_publish_rate) == 0:
|
||||||
|
@ -10,6 +10,11 @@ from robot_tools.utils import scan_dir_for_urdfs
|
|||||||
class Simulation(BtManipulationSim):
|
class Simulation(BtManipulationSim):
|
||||||
def __init__(self, gui=True, sleep=True):
|
def __init__(self, gui=True, sleep=True):
|
||||||
super().__init__(gui, sleep)
|
super().__init__(gui, sleep)
|
||||||
|
|
||||||
|
self.rate = 60
|
||||||
|
self.dt = 1.0 / self.rate
|
||||||
|
p.setPhysicsEngineParameter(fixedTimeStep=self.dt, numSubSteps=4)
|
||||||
|
|
||||||
p.configureDebugVisualizer(p.COV_ENABLE_GUI, 0)
|
p.configureDebugVisualizer(p.COV_ENABLE_GUI, 0)
|
||||||
p.resetDebugVisualizerCamera(1.4, 50, -35, [0.0, 0.0, 0.6])
|
p.resetDebugVisualizerCamera(1.4, 50, -35, [0.0, 0.0, 0.6])
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user