Commit 88d4a341 authored by Mayank Mittal's avatar Mayank Mittal

fixes camera class to support other fisheye projections

parent 6d855682
[package] [package]
# Note: Semantic Versioning is used: https://semver.org/ # Note: Semantic Versioning is used: https://semver.org/
version = "0.2.0" version = "0.2.1"
# Description # Description
title = "ORBIT framework for Robot Learning" title = "ORBIT framework for Robot Learning"
......
Changelog Changelog
--------- ---------
0.2.1 (2023-01-26)
~~~~~~~~~~~~~~~~~~
Fixed
^^^^^
* Fixed the :class:`Camera` class to support different fisheye projection types.
0.2.0 (2023-01-25) 0.2.0 (2023-01-25)
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
......
...@@ -69,6 +69,15 @@ class Camera(SensorBase): ...@@ -69,6 +69,15 @@ class Camera(SensorBase):
- ``"bounding_box_3d"``: The 3D view space bounding box data. - ``"bounding_box_3d"``: The 3D view space bounding box data.
- ``"occlusion"``: The occlusion information (such as instance id, semantic id and occluded ratio). - ``"occlusion"``: The occlusion information (such as instance id, semantic id and occluded ratio).
The camera sensor supports the following projection types:
- ``"pinhole"``: Standard pinhole camera model (disables fisheye parameters).
- ``"fisheye_orthographic"``: Fisheye camera model using orthographic correction.
- ``"fisheye_equidistant"``: Fisheye camera model using equidistant correction.
- ``"fisheye_equisolid"``: Fisheye camera model using equisolid correction.
- ``"fisheye_polynomial"``: Fisheye camera model with :math:`360^\\circ` spherical projection.
- ``"fisheye_spherical"``: Fisheye camera model with :math:`360^\\circ` full-frame projection.
Typically, the sensor comprises of two prims: Typically, the sensor comprises of two prims:
1. **Camera rig**: A dummy Xform prim to which the camera is attached to. 1. **Camera rig**: A dummy Xform prim to which the camera is attached to.
...@@ -356,12 +365,8 @@ class Camera(SensorBase): ...@@ -356,12 +365,8 @@ class Camera(SensorBase):
translation (Sequence[float], optional): The local position offset w.r.t. parent prim. Defaults to None. translation (Sequence[float], optional): The local position offset w.r.t. parent prim. Defaults to None.
orientation (Sequence[float], optional): The local rotation offset in `(w, x, y, z)` w.r.t. parent prim. Defaults to None. orientation (Sequence[float], optional): The local rotation offset in `(w, x, y, z)` w.r.t. parent prim. Defaults to None.
""" """
# Check projection type of the camera. # Convert to camel case
if isinstance(self.cfg, FisheyeCameraCfg): projection_type = to_camel_case(self.cfg.projection_type, to="cC")
projection_type: str = "fisheye_polynomial"
else:
projection_type = "pinhole"
# Create camera using replicator. This creates under it two prims: # Create camera using replicator. This creates under it two prims:
# 1) the rig: at the path f"{prim_path}/Camera_Xform" # 1) the rig: at the path f"{prim_path}/Camera_Xform"
# 2) the USD camera: at the path f"{prim_path}/Camera_Xform/Camera" # 2) the USD camera: at the path f"{prim_path}/Camera_Xform/Camera"
......
...@@ -19,24 +19,6 @@ __all__ = ["PinholeCameraCfg", "FisheyeCameraCfg"] ...@@ -19,24 +19,6 @@ __all__ = ["PinholeCameraCfg", "FisheyeCameraCfg"]
class PinholeCameraCfg: class PinholeCameraCfg:
"""Configuration for a pinhole camera sensor.""" """Configuration for a pinhole camera sensor."""
sensor_tick: float = 0.0
"""Simulation seconds between sensor buffers. Defaults to 0.0."""
data_types: List[str] = ["rgb"]
"""List of sensor names/types to enable for the camera. Defaults to ["rgb"]."""
width: int = MISSING
"""Width of the image in pixels."""
height: int = MISSING
"""Height of the image in pixels."""
semantic_types: List[str] = ["class"]
"""List of allowed semantic types the types. Defaults to ["class"].
For example, if semantic types is [“class”], only the bounding boxes for prims with semantics of
type “class” will be retrieved.
More information available at:
https://docs.omniverse.nvidia.com/app_code/prod_extensions/ext_replicator/semantic_schema_editor.html
"""
@configclass @configclass
class UsdCameraCfg: class UsdCameraCfg:
"""USD related configuration of the sensor. """USD related configuration of the sensor.
...@@ -71,6 +53,25 @@ class PinholeCameraCfg: ...@@ -71,6 +53,25 @@ class PinholeCameraCfg:
vertical_aperture_offset: float = None vertical_aperture_offset: float = None
"""Offsets Resolution/Film gate vertically.""" """Offsets Resolution/Film gate vertically."""
sensor_tick: float = 0.0
"""Simulation seconds between sensor buffers. Defaults to 0.0."""
data_types: List[str] = ["rgb"]
"""List of sensor names/types to enable for the camera. Defaults to ["rgb"]."""
width: int = MISSING
"""Width of the image in pixels."""
height: int = MISSING
"""Height of the image in pixels."""
semantic_types: List[str] = ["class"]
"""List of allowed semantic types the types. Defaults to ["class"].
For example, if semantic types is [“class”], only the bounding boxes for prims with semantics of
type “class” will be retrieved.
More information available at:
https://docs.omniverse.nvidia.com/app_code/prod_extensions/ext_replicator/semantic_schema_editor.html
"""
projection_type: str = "pinhole"
"""Type of projection to use for the camera. Defaults to "pinhole"."""
usd_params: UsdCameraCfg = UsdCameraCfg() usd_params: UsdCameraCfg = UsdCameraCfg()
"""Parameters for setting USD camera settings.""" """Parameters for setting USD camera settings."""
...@@ -103,5 +104,7 @@ class FisheyeCameraCfg(PinholeCameraCfg): ...@@ -103,5 +104,7 @@ class FisheyeCameraCfg(PinholeCameraCfg):
fisheye_polynomial_e: float = None fisheye_polynomial_e: float = None
"""Fifth component of fisheye polynomial.""" """Fifth component of fisheye polynomial."""
projection_type: str = "fisheye_polynomial"
"""Type of projection to use for the camera. Defaults to "fisheye_polynomial"."""
usd_params: UsdCameraCfg = UsdCameraCfg() usd_params: UsdCameraCfg = UsdCameraCfg()
"""Parameters for setting USD camera settings.""" """Parameters for setting USD camera settings."""
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment