intrinsic.solutions.perception.Camera
![]() View source on GitHub |
Convenience wrapper for Camera.
intrinsic.solutions.perception.Camera(
channel: grpc.Channel,
handle: resource_handle_pb2.ResourceHandle,
resource_registry: resource_registry_client.ResourceRegistryClient,
executive: intrinsic.solutions.execution.Executive,
is_simulated: bool
)
Args | |
|---|---|
The grpc channel to the respective camera server. | |
Resource handle for the camera. | |
Resource registry to fetch camera resources from. | |
The executive for checking the state. | |
Whether or not the world is being simulated. | |
Methods
capture
View source
capture(
timeout: datetime.timedelta = datetime.timedelta(seconds=_MAX_FRAME_WAIT_TIME_SECONDS),
sensor_ids: Optional[list[int]] = None
) -> data_classes.CaptureResult
Performs grpc request to capture sensor images from the camera.
If the camera handle is no longer valid (eg, if the server returns a NOT_FOUND status), the camera will be reopened (once) on the camera server; if re-opening the camera fails an exception is raised.
| Args | |
|---|---|
| Timeout duration for Capture() service calls. |
| List of selected sensor identifiers for Capture() service calls. |
| Returns | |
|---|---|
The acquired list of sensor images. |
| Raises | |
|---|---|
grpc.RpcError from the camera or resource service. |
get_frame
View source
get_frame(
timeout: datetime.timedelta = datetime.timedelta(seconds=_MAX_FRAME_WAIT_TIME_SECONDS),
skip_undistortion: bool = False,
encoding: Optional[intrinsic.solutions.perception.ImageEncoding] = None
) -> camera_utils.Frame
Performs grpc request to retrieve a frame from the camera.
If the camera handle is no longer valid (eg, if the server returns a NOT_FOUND status), the camera will be reopened (once) on the camera server; if re-opening the camera fails an exception is raised.
| Args | |
|---|---|
| Timeout duration for GetFrame() service calls. |
| If set to true the returned frame will be distorted. |
| The encoding of the image (UNSPECIFIED, PNG, JPEG, WEPB). If not set defaults to uncompressed. |
| Returns | |
|---|---|
The acquired frame. |
| Raises | |
|---|---|
grpc.RpcError from the camera or resource service. |
show_capture
View source
show_capture(
figsize: Tuple[float, float] = (_PLOT_WIDTH_INCHES, _PLOT_HEIGHT_INCHES)
) -> None
Acquires and plots all sensor images from a capture call in a grid plot.
| Args | |
|---|---|
| Size of grid plot. It is defined as a (width, height) tuple with the dimensions in inches. |
show_depth_frame
View source
show_depth_frame() -> None
Acquires and plots depth frame.
show_rgb_frame
View source
show_rgb_frame() -> None
Acquires and plots frame.
