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
Merge requests
!316
Laser scans memory: Synchronize robot in regular intervals
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Laser scans memory: Synchronize robot in regular intervals
feature/laser-scans-memory_fix-robot-synchronization
into
master
Overview
1
Commits
1
Pipelines
0
Changes
2
Merged
Tobias Gröger
requested to merge
feature/laser-scans-memory_fix-robot-synchronization
into
master
2 years ago
Overview
1
Commits
1
Pipelines
0
Changes
2
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
00484236
1 commit,
2 years ago
2 files
+
30
−
18
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
source/RobotAPI/libraries/armem_laser_scans/server/Visu.cpp
+
27
−
17
Options
@@ -45,6 +45,9 @@ namespace armarx::armem::server::laser_scans
p
.
enabled
,
prefix
+
"enabled"
,
"Enable or disable visualization of objects."
);
defs
->
optional
(
p
.
frequencyHz
,
prefix
+
"frequenzyHz"
,
"Frequency of visualization."
);
defs
->
optional
(
p
.
uniformColor
,
prefix
+
"uniformColor"
,
"If enabled, points will be drawn in red."
);
defs
->
optional
(
p
.
maxRobotAgeMs
,
prefix
+
"maxRobotAgeMs"
,
"Maximum age of robot state before a new one is retrieved in milliseconds."
);
}
@@ -295,29 +298,36 @@ namespace armarx::armem::server::laser_scans
VirtualRobot
::
RobotPtr
Visu
::
getSynchronizedRobot
(
const
std
::
string
&
name
,
const
DateTime
&
timestamp
)
{
if
(
robots
.
count
(
name
)
>
0
)
if
(
robots
.
count
(
name
)
==
0
)
{
return
robots
.
at
(
name
);
}
ARMARX_CHECK_NOT_NULL
(
virtualRobotReader
);
const
auto
robot
=
virtualRobotReader
->
getRobot
(
name
,
timestamp
,
VirtualRobot
::
RobotIO
::
RobotDescription
::
eStructure
);
ARMARX_CHECK_NOT_NULL
(
virtualRobotReader
);
const
auto
robot
=
virtualRobotReader
->
getRobot
(
name
,
timestamp
,
VirtualRobot
::
RobotIO
::
RobotDescription
::
eStructure
);
if
(
robot
)
{
robots
[
name
]
=
robot
;
}
else
{
return
nullptr
;
if
(
robot
)
{
robots
[
name
]
=
{
robot
,
DateTime
::
Invalid
()};
}
else
{
return
nullptr
;
}
}
if
(
not
virtualRobotReader
->
synchronizeRobot
(
*
robot
,
timestamp
))
auto
&
entry
=
robots
.
at
(
name
);
if
(
entry
.
second
.
isInvalid
()
||
(
timestamp
-
entry
.
second
)
>
Duration
::
MilliSeconds
(
p
.
maxRobotAgeMs
))
{
ARMARX_VERBOSE
<<
"Faield to synchronize robot `"
<<
name
<<
"`"
;
if
(
virtualRobotReader
->
synchronizeRobot
(
*
entry
.
first
,
timestamp
))
{
entry
.
second
=
timestamp
;
}
else
{
ARMARX_VERBOSE
<<
"Faield to synchronize robot `"
<<
name
<<
"`"
;
}
}
return
robots
.
at
(
name
);
return
entry
.
first
;
}
}
// namespace armarx::armem::server::laser_scans
Loading