Skip to content


Bases: AbsoluteObjectState, RobotStateMixin

Source code in omnigibson/object_states/
class ObjectsInFOVOfRobot(AbsoluteObjectState, RobotStateMixin):
    def _get_value(self):
        Gets all objects in the robot's field of view.

            list: List of objects in the robot's field of view
        if not any(isinstance(sensor, VisionSensor) for sensor in self.robot.sensors.values()):
            raise ValueError("No vision sensors found on robot.")
        obj_names = []
        names_to_exclude = set(['background', 'unlabelled'])
        for sensor in self.robot.sensors.values():
            if isinstance(sensor, VisionSensor):
                _, info = sensor.get_obs()
                obj_names.extend([name for name in info['seg_instance'].values() if name not in names_to_exclude])
        return [x for x in [og.sim.scene.object_registry("name", x) for x in obj_names] if x is not None]