    def compute_reward(self, obs, gripper_action_effective) -> bool:
        """We are using a sparse reward function."""
        current_pose = obs["state"]["tcp_pose"]
        # convert from quat to euler first
        euler_angles = quat_2_euler(current_pose[3:])
        euler_angles = np.abs(euler_angles)
        current_pose = np.hstack([current_pose[:3], euler_angles])
        delta = np.abs(current_pose - self._TARGET_POSE)
        if np.all(delta < self._REWARD_THRESHOLD):
            reward = 1
        else:
            # print(f'Goal not reached, the difference is {delta}, the desired threshold is {_REWARD_THRESHOLD}')
            reward = 0

        if self.config.APPLY_GRIPPER_PENALTY and gripper_action_effective:
            reward -= self.config.GRIPPER_PENALTY

        return reward
We are using a sparse reward function.
serl_robot_infra/franka_env/envs/franka_env.py