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
!512
Skill-Gui Stability and QOL
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Skill-Gui Stability and QOL
feature/skill-gui-stability
into
master
Overview
10
Commits
19
Pipelines
16
Changes
2
Merged
Peter Albrecht
requested to merge
feature/skill-gui-stability
into
master
3 months ago
Overview
10
Commits
19
Pipelines
16
Changes
2
Expand
Fix the skill details widget not resetting correctly when the provider dies
Add a dialog box asking the user whether to reset the parameters when they attempt so
Edited
2 months ago
by
Peter Albrecht
0
0
Merge request reports
Viewing commit
ca7ac9fd
Prev
Next
Show latest version
2 files
+
53
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
Verified
ca7ac9fd
feat: parameter history
· ca7ac9fd
Peter Albrecht
authored
1 month ago
source/RobotAPI/libraries/skills_gui/memory/SkillManagerWrapper.cpp
+
38
−
1
Options
#include
"SkillManagerWrapper.h"
#include
<mutex>
#include
<optional>
#include
<SimoxUtility/algorithm/string/string_tools.h>
@@ -241,6 +242,39 @@ namespace armarx::skills::gui
// notify registered widgets of update
emit
updateAvailable
(
filterUpdate
(
snapshot
));
}
std
::
vector
<
Parameters
>
SkillManagerWrapper
::
getParameterHistoryForSkill
(
const
skills
::
SkillID
&
sid
)
const
{
if
(
not
this
->
skillParameterHistory
.
contains
(
sid
))
{
return
{};
}
return
this
->
skillParameterHistory
[
sid
];
}
void
SkillManagerWrapper
::
addParametersToHistory
(
const
skills
::
SkillID
&
sid
,
const
Parameters
&
params
)
{
if
(
not
this
->
skillParameterHistory
.
contains
(
sid
))
{
// no history exists for this skill. Assign new
this
->
skillParameterHistory
.
insert
({
sid
,
{
params
}});
}
else
{
// history already exists. Append to list
this
->
skillParameterHistory
[
sid
].
emplace_back
(
params
);
}
}
std
::
optional
<
Parameters
>
SkillManagerWrapper
::
getLatestParametersForSkill
(
const
skills
::
SkillID
&
sid
)
const
{
auto
parameterList
=
getParameterHistoryForSkill
(
sid
);
if
(
parameterList
.
empty
())
{
return
std
::
nullopt
;
}
return
parameterList
.
back
();
}
const
std
::
optional
<
ProviderID
>
SkillManagerWrapper
::
findFirstProvider
(
SkillMap
const
&
map
,
SkillID
const
&
skillId
)
@@ -391,8 +425,11 @@ namespace armarx::skills::gui
.
parameters
=
params
};
ARMARX_CHECK
(
skillId
.
isFullySpecified
());
// sanity check
ARMARX_IMPORTANT
<<
"Executing skill from GUI: "
<<
skillId
<<
"."
;
this
->
addParametersToHistory
(
skillId
,
params
);
ARMARX_INFO
<<
"Saved skill parameters to history..."
;
ARMARX_IMPORTANT
<<
"Executing skill from GUI: "
<<
skillId
<<
"."
;
try
{
std
::
scoped_lock
l
(
mutex_memory
);
Loading