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
!404
Add convenience functions for calling subskills
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add convenience functions for calling subskills
feature/subskill-convenience-functions
into
master
Overview
0
Commits
4
Pipelines
3
Changes
2
Merged
Rainer Kartmann
requested to merge
feature/subskill-convenience-functions
into
master
1 year ago
Overview
0
Commits
4
Pipelines
3
Changes
2
Expand
0
0
Merge request reports
Compare
master
version 2
3d0afcf0
1 year ago
version 1
929e7894
1 year ago
master (base)
and
latest version
latest version
b37cb8c2
4 commits,
1 year ago
version 2
3d0afcf0
3 commits,
1 year ago
version 1
929e7894
2 commits,
1 year ago
2 files
+
174
−
12
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/skills/core/Skill.cpp
+
44
−
3
Options
@@ -19,10 +19,22 @@ namespace armarx
}
std
::
optional
<
TerminatedSkillStatusUpdate
>
Skill
::
callSubskill
(
const
SkillProxy
&
pr
x
,
const
aron
::
data
::
DictPtr
&
params
)
Skill
::
callSubskill
(
const
SkillProxy
&
pr
oxy
)
{
auto
eid
=
callSubskillAsync
(
prx
,
params
);
auto
ret
=
prx
.
join
(
eid
);
return
callSubskill
(
proxy
,
proxy
.
getRootProfileParameters
());
}
std
::
optional
<
TerminatedSkillStatusUpdate
>
Skill
::
callSubskill
(
const
SkillProxy
&
proxy
,
const
aron
::
data
::
DictPtr
&
parameters
)
{
auto
executionId
=
callSubskillAsync
(
proxy
,
parameters
);
auto
ret
=
proxy
.
join
(
executionId
);
// While the sub skill was running, our skill might also have been aborted.
// In this case, the correct behavour would be aborting ourselves.
// The caller of callSubskill() can catch the thrown error::SkillAbortedException
// if necessary.
throwIfSkillShouldTerminate
();
return
ret
;
}
@@ -37,6 +49,35 @@ namespace armarx
return
eid
;
}
std
::
optional
<
TerminatedSkillStatusUpdate
>
Skill
::
callSubskill
(
const
SkillID
&
skillId
)
{
return
callSubskill
(
SkillProxy
(
manager
,
skillId
));
}
std
::
optional
<
TerminatedSkillStatusUpdate
>
Skill
::
callSubskill
(
const
SkillID
&
skillId
,
const
aron
::
data
::
DictPtr
&
parameters
)
{
return
callSubskill
(
SkillProxy
(
manager
,
skillId
),
parameters
);
}
std
::
optional
<
TerminatedSkillStatusUpdate
>
Skill
::
callSubskill
(
const
SkillID
&
skillId
,
std
::
function
<
void
(
aron
::
data
::
DictPtr
&
)
>
parametersFunction
)
{
SkillProxy
proxy
(
manager
,
skillId
);
aron
::
data
::
DictPtr
parameters
=
proxy
.
getRootProfileParameters
();
if
(
not
parameters
)
{
parameters
=
armarx
::
aron
::
make_dict
();
}
parametersFunction
(
parameters
);
return
callSubskill
(
proxy
,
parameters
);
}
void
Skill
::
updateParameters
(
const
aron
::
data
::
DictPtr
&
d
)
{
Loading