chernyadev/bigym

Modifying external camera specs

Closed this issue · 3 comments

Hi,
Thanks again for the cool simulation! I am trying to write a wrapper for the envs so that my observations come from both the head and external camera. I have noticed, however, that the external camera is not well focused on the objects and the agent and I would like to modify its positioning (see attached image, for the task PickBox, the box isn't even in the frame). Could I ask for some help in doing so? Adding a position argument to the function didn't seem to do anything. Thanks in advance, please find attached my env wrapper and an image depicting the issue.

Best regards,
Adria

class BiGymStages(BiGymEnv):
    def __init__(self, obs_mode, img_size, *args, **kwargs):
        if obs_mode.startswith("rgb"):
            observation_config=ObservationConfig(
                cameras=[
                    CameraConfig(
                        name="head",
                        rgb=True,
                        depth=False,
                        resolution=(img_size, img_size),
                    ),
                    CameraConfig(
                        name="external",
                        rgb=True,
                        depth=False,
                        resolution=(img_size, img_size),
                    ),
                ],
            )
        elif obs_mode == "state":
            observation_config=ObservationConfig(
                cameras=[],
                privileged_information=True,
            )
        else:
            raise NotImplementedError

        super().__init__(
            observation_config=observation_config,
            *args, **kwargs
        )

Screenshot from 2024-10-10 14-51-59

Hi @adrialopezescoriza thank you for identifying this issue! Please see #24, the fix is on the way :)

Thank you! Just a follow up, there seems to be typo in bigym/utils/observation_config as the camera config expects an array of 3 for the quaternon. I proposed a fix here #25

Thank you @adrialopezescoriza, will merge your PR in soon!