diff --git a/bt_sim_node.py b/bt_sim_node.py index 8a291bd..dfe75c6 100755 --- a/bt_sim_node.py +++ b/bt_sim_node.py @@ -105,7 +105,7 @@ class BtSimNode: def handle_updates(self): if self.step_cnt % int(self.sim.rate / self.controller_update_rate) == 0: 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: self.publish_joint_state() if self.step_cnt % int(self.sim.rate / self.camera_publish_rate) == 0: diff --git a/simulation.py b/simulation.py index ed61f21..9acc657 100644 --- a/simulation.py +++ b/simulation.py @@ -10,6 +10,11 @@ from robot_tools.utils import scan_dir_for_urdfs class Simulation(BtManipulationSim): def __init__(self, gui=True, sleep=True): 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.resetDebugVisualizerCamera(1.4, 50, -35, [0.0, 0.0, 0.6])