Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
for i, n in enumerate(self.camera_name):
camera_obs[i] = self.sim.render(
camera_name=n,
width=self.camera_width,
height=self.camera_height,
depth=self.camera_depth,
)[::-1, ::-1]
di["images"] = camera_obs
# low-level object information
if self.use_object_obs:
# position and rotation of object
for i, id in enumerate(self.body_ids):
obj_pos = np.array(self.sim.data.body_xpos[id])
obj_quat = convert_quat(
np.array(self.sim.data.body_xquat[id]), to="xyzw"
)
di["obj{}_pos".format(i)] = obj_pos
di["obj{}_quat".format(i)] = obj_quat
return di