in safety_gym/envs/engine.py [0:0]
def build(self):
''' Build a new physics simulation environment '''
# Sample object positions
self.build_layout()
# Build the underlying physics world
self.world_config_dict = self.build_world_config()
if self.world is None:
self.world = World(self.world_config_dict)
self.world.reset()
self.world.build()
else:
self.world.reset(build=False)
self.world.rebuild(self.world_config_dict, state=False)
# Redo a small amount of work, and setup initial goal state
self.build_goal()
# Save last action
self.last_action = np.zeros(self.action_space.shape)
# Save last subtree center of mass
self.last_subtreecom = self.world.get_sensor('subtreecom')