From 22d425634daf6643288409029128deda2d3b9138 Mon Sep 17 00:00:00 2001 From: Markus Grotz <markus.grotz@kit.edu> Date: Tue, 15 Nov 2022 16:06:46 +0100 Subject: [PATCH] update doc --- armarx_robots/sensors.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/armarx_robots/sensors.py b/armarx_robots/sensors.py index 902fb471..ea291078 100644 --- a/armarx_robots/sensors.py +++ b/armarx_robots/sensors.py @@ -10,8 +10,13 @@ from armarx_vision.image_utils import read_images from visionx import ReferenceFrameInterfacePrx from functools import partial +from typing import Any +from typing import Dict class Camera: + """ + Convenience class for accessing the camera information and images + """ def __init__(self, name): self.provider_name = name self.images = partial(read_images, name) @@ -19,10 +24,16 @@ class Camera: @property @lru_cache(1) def proxy(self): + """ + Returns the proxy of the visionx.ImageProvider + """ return ImageProviderInterfacePrx.get_proxy(self.provider_name) @property - def info(self): + def info(self) -> Dict[str, Any]: + """ + Returns camera information such as width, height of the image + """ proxy = self.proxy image_format = proxy.getImageFormat() image_format = proxy.getImageFormat() @@ -42,17 +53,26 @@ class Camera: @property @lru_cache(1) def reference_frame_name(self): + """ + Returns the frame the camera images are reported in + """ proxy = ReferenceFrameInterfacePrx.get_proxy(self.provider_name) return proxy.getReferenceFrame() @property @lru_cache(1) def num_images(self): + """ + Returns the number of images + """ return self.proxy.getNumberImages() @property @lru_cache(1) def calibration(self): + """ + Returns the camera calibration matrix + """ if self.num_images == 2: return get_stereo_calibration(self.provider_name) else: -- GitLab