How to use the robosuite.utils.transform_utils.convert_quat function in robosuite

To help you get started, we’ve selected a few robosuite examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SudeepDasari / visual_foresight / visual_mpc / envs / mujoco_env / sawyer_env / robosuite_wrappers / SawyerIKEnv.py View on Github external
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