Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RobotAPI
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
Container Registry
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
RobotAPI
Commits
a04e7d16
Commit
a04e7d16
authored
3 years ago
by
Fabian Reister
Browse files
Options
Downloads
Patches
Plain Diff
transform writer: some checks
parent
44d3db97
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!157
armem/dev => master
,
!144
robot state memory update
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/RobotAPI/libraries/armem_robot_state/client/localization/TransformWriter.cpp
+26
-9
26 additions, 9 deletions
...armem_robot_state/client/localization/TransformWriter.cpp
with
26 additions
and
9 deletions
source/RobotAPI/libraries/armem_robot_state/client/localization/TransformWriter.cpp
+
26
−
9
View file @
a04e7d16
...
...
@@ -21,6 +21,7 @@
*/
#include
"TransformWriter.h"
#include
"RobotAPI/libraries/armem/core/MemoryID.h"
#include
<algorithm>
#include
<iterator>
...
...
@@ -46,6 +47,7 @@
#include
<RobotAPI/libraries/armem_robot_state/aron/Transform.aron.generated.h>
#include
<RobotAPI/libraries/armem_robot_state/aron_conversions.h>
#include
<optional>
namespace
armarx
::
armem
::
client
::
robot_state
::
localization
...
...
@@ -89,21 +91,36 @@ namespace armarx::armem::client::robot_state::localization
ARMARX_DEBUG
<<
"Trying to create core segment + provider segment"
;
const
auto
result
=
memoryWriter
.
addSegment
(
properties
.
localizationSegment
,
transform
.
header
.
agent
);
if
(
not
result
.
success
)
const
auto
providerId
=
[
&
]()
->
std
::
optional
<
armem
::
MemoryID
>
{
try
{
const
auto
result
=
memoryWriter
.
addSegment
(
properties
.
localizationSegment
,
transform
.
header
.
agent
);
if
(
not
result
.
success
)
{
ARMARX_WARNING
<<
"Could not obtain provider id! Reason: "
<<
result
.
errorMessage
;
return
std
::
nullopt
;
}
return
armem
::
MemoryID
(
result
.
segmentID
);
}
catch
(...)
{
ARMARX_WARNING
<<
"Could not obtain provider id!"
;
return
std
::
nullopt
;
}
}();
if
(
not
providerId
)
{
ARMARX_ERROR
<<
result
.
errorMessage
;
// TODO(fabian.reister): message
return
false
;
}
const
auto
timestamp
=
IceUtil
::
Time
::
microSeconds
(
transform
.
header
.
timestamp
);
const
auto
providerId
=
armem
::
MemoryID
(
result
.
segmentID
);
const
auto
entityID
=
providerId
.
withEntityName
(
transform
.
header
.
parentFrame
+
","
+
const
auto
entityID
=
providerId
->
withEntityName
(
transform
.
header
.
parentFrame
+
","
+
transform
.
header
.
frame
).
withTimestamp
(
timestamp
);
armem
::
EntityUpdate
update
;
...
...
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