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
07be1978
Commit
07be1978
authored
2 years ago
by
Rainer Kartmann
Browse files
Options
Downloads
Patches
Plain Diff
Provide from_aron_ice() method
parent
75c6b75b
No related branches found
No related tags found
1 merge request
!33
Improve aron dict to dataclass
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
armarx_memory/core/MemoryID.py
+11
-2
11 additions, 2 deletions
armarx_memory/core/MemoryID.py
with
11 additions
and
2 deletions
armarx_memory/core/MemoryID.py
+
11
−
2
View file @
07be1978
...
...
@@ -225,8 +225,9 @@ class MemoryID(ice_twin.IceTwin):
self
.
timestamp_usec
=
date_time_conv
.
from_ice
(
ice
.
timestamp
)
self
.
instance_index
=
ice
.
instanceIndex
@classmethod
def
from_aron
(
cls
,
aron
:
"
armarx.aron.data.dto.GenericData
"
)
->
"
MemoryID
"
:
def
from_aron
_ice
(
cls
,
aron
:
"
armarx.aron.data.dto.GenericData
"
)
->
"
MemoryID
"
:
from
armarx_memory.aron.conversion
import
from_aron
data
=
from_aron
(
aron
)
...
...
@@ -239,7 +240,11 @@ class MemoryID(ice_twin.IceTwin):
self
.
instance_index
=
data
[
"
instanceIndex
"
]
return
self
def
to_aron
(
self
)
->
"
armarx.aron.data.dto.GenericData
"
:
@classmethod
def
from_aron
(
cls
,
aron
:
"
armarx.aron.data.dto.GenericData
"
)
->
"
MemoryID
"
:
return
cls
.
from_aron_ice
(
aron
=
aron
)
def
to_aron_ice
(
self
)
->
"
armarx.aron.data.dto.GenericData
"
:
import
numpy
as
np
from
armarx_memory.aron.conversion
import
to_aron
...
...
@@ -264,3 +269,7 @@ class MemoryID(ice_twin.IceTwin):
"
instanceIndex
"
:
self
.
instance_index
,
}
return
to_aron
(
data
)
def
to_aron
(
self
)
->
"
armarx.aron.data.dto.GenericData
"
:
return
self
.
to_aron_ice
()
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