Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parse_visual_obs_mode_to_struct doesn't support obs_mode="sensor_data" #605

Closed
hesic73 opened this issue Oct 5, 2024 · 1 comment · Fixed by #606
Closed

parse_visual_obs_mode_to_struct doesn't support obs_mode="sensor_data" #605

hesic73 opened this issue Oct 5, 2024 · 1 comment · Fixed by #606

Comments

@hesic73
Copy link
Contributor

hesic73 commented Oct 5, 2024

SUPPORTED_OBS_MODES = ("state", "state_dict", "none", "sensor_data", "rgb", "depth", "segmentation", "rgbd", "rgb+depth", "rgb+depth+segmentation", "rgb+segmentation", "depth+segmentation", "pointcloud")

def parse_visual_obs_mode_to_struct(obs_mode: str) -> CameraObsTextures:
"""Given user supplied observation mode, return a struct with the relevant textures that are to be captured"""
if obs_mode == "rgb":
return CameraObsTextures(
rgb=True, depth=False, segmentation=False, position=False
)
elif obs_mode == "rgbd":
return CameraObsTextures(
rgb=True, depth=True, segmentation=False, position=False
)
elif obs_mode == "depth":
return CameraObsTextures(
rgb=False, depth=True, segmentation=False, position=False
)
elif obs_mode == "segmentation":
return CameraObsTextures(
rgb=False, depth=False, segmentation=True, position=False
)
elif obs_mode == "rgb+depth":
return CameraObsTextures(
rgb=True, depth=True, segmentation=False, position=False
)
elif obs_mode == "rgb+depth+segmentation":
return CameraObsTextures(
rgb=True, depth=True, segmentation=True, position=False
)
elif obs_mode == "rgb+segmentation":
return CameraObsTextures(
rgb=True, depth=False, segmentation=True, position=False
)
elif obs_mode == "depth+segmentation":
return CameraObsTextures(
rgb=False, depth=True, segmentation=True, position=False
)
elif obs_mode == "pointcloud":
return CameraObsTextures(
rgb=True, depth=False, segmentation=True, position=True
)
else:
return None

The 3D Diffusion Policy seems to require not only point cloud data and RGB images but also depth information, which obs_mode="pointcloud" doesn't support. Therefore, I expect the return value for obs_mode="sensor_data" should be:

CameraObsTextures(
            rgb=True, depth=True, segmentation=True, position=True
        )

By the way, in the point cloud representation xyzw, what does the w stand for?

@StoneT2000
Copy link
Member

StoneT2000 commented Oct 5, 2024

w stand for infinite points, it's a mask. 0 is infinity points and shouldn't be used if it's a pointcloud / depth datapoint

Your fix is correct, feel free to make a PR to fix (currently away so can't get to it now)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants