Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Python3 ArmarX
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software
ArmarX
Python3 ArmarX
Commits
22d42563
Commit
22d42563
authored
2 years ago
by
Markus Grotz
Browse files
Options
Downloads
Patches
Plain Diff
update doc
parent
a1708114
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#6246
canceled
2 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
armarx_robots/sensors.py
+21
-1
21 additions, 1 deletion
armarx_robots/sensors.py
with
21 additions
and
1 deletion
armarx_robots/sensors.py
+
21
−
1
View file @
22d42563
...
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment