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
7e90504e
Commit
7e90504e
authored
2 years ago
by
Rainer Kartmann
Browse files
Options
Downloads
Patches
Plain Diff
Change to running task to reduce IMPORTANT log by periodic task
parent
cb5cb122
No related branches found
No related tags found
1 merge request
!302
Change to running task to reduce IMPORTANT log by periodic task
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/RobotAPI/components/RobotToArViz/RobotToArViz.cpp
+19
-7
19 additions, 7 deletions
source/RobotAPI/components/RobotToArViz/RobotToArViz.cpp
source/RobotAPI/components/RobotToArViz/RobotToArViz.h
+4
-3
4 additions, 3 deletions
source/RobotAPI/components/RobotToArViz/RobotToArViz.h
with
23 additions
and
10 deletions
source/RobotAPI/components/RobotToArViz/RobotToArViz.cpp
+
19
−
7
View file @
7e90504e
...
...
@@ -24,7 +24,7 @@
#include
<filesystem>
#include
<ArmarXCore/core/time/
CycleUtil
.h>
#include
<ArmarXCore/core/time/
Metronome
.h>
namespace
armarx
...
...
@@ -39,7 +39,7 @@ namespace armarx
armarx
::
PropertyDefinitionsPtr
defs
(
new
RobotToArVizPropertyDefinitions
(
getConfigIdentifier
()));
// defs->optional(updateFrequency, "updateFrequency", "Target number of updates per second.");
defs
->
defineOptionalProperty
(
"updateFrequency"
,
updateFrequency
,
"Target number of updates per second."
);
defs
->
defineOptionalProperty
(
"updateFrequency"
,
updateFrequency
Hz
,
"Target number of updates per second."
);
defs
->
optional
(
gui
.
useCollisionModel
,
"UseCollisionModel"
,
"Use the collision model for visualization"
);
defs
->
optional
(
gui
.
showRobotNodeFrames
,
"ShowRobotNodeFrames"
,
...
...
@@ -57,7 +57,7 @@ namespace armarx
void
RobotToArViz
::
onInitComponent
()
{
getProperty
(
updateFrequency
,
"updateFrequency"
);
getProperty
(
updateFrequency
Hz
,
"updateFrequency"
);
}
...
...
@@ -83,10 +83,10 @@ namespace armarx
createRemoteGuiTab
();
RemoteGui_startRunningTask
();
task
=
new
Simple
Periodic
Task
<>
([
this
]()
task
=
new
Simple
Running
Task
<>
([
this
]()
{
this
->
updateRobot
();
}
,
int
(
1000
/
updateFrequency
)
);
this
->
updateRobot
Run
();
});
task
->
start
();
}
...
...
@@ -135,7 +135,19 @@ namespace armarx
}
void
RobotToArViz
::
updateRobot
()
void
RobotToArViz
::
updateRobotRun
()
{
Metronome
metronome
(
Frequency
::
Hertz
(
updateFrequencyHz
));
while
(
task
and
not
task
->
isStopped
())
{
updateRobotOnce
();
metronome
.
waitForNextTick
();
}
}
void
RobotToArViz
::
updateRobotOnce
()
{
RobotState
::
synchronizeLocalClone
(
robotName
);
...
...
This diff is collapsed.
Click to expand it.
source/RobotAPI/components/RobotToArViz/RobotToArViz.h
+
4
−
3
View file @
7e90504e
...
...
@@ -96,14 +96,15 @@ namespace armarx
private:
void
updateRobot
();
void
updateRobotRun
();
void
updateRobotOnce
();
static
bool
trySetFilePathFromDataDir
(
viz
::
Robot
&
robotViz
,
const
std
::
string
&
absolutePath
);
private:
float
updateFrequency
=
100
;
Simple
Periodic
Task
<>::
pointer_type
task
;
float
updateFrequency
Hz
=
100
;
Simple
Running
Task
<>::
pointer_type
task
;
std
::
string
robotName
=
"robot"
;
...
...
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