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
78b854f2
Commit
78b854f2
authored
1 year ago
by
Fabian Tërnava
Browse files
Options
Downloads
Patches
Plain Diff
clang
parent
ddca9f08
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!388
Refactor skills framework
Pipeline
#15608
canceled
1 year ago
Stage: build-and-test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/RobotAPI/statecharts/ObjectMemoryGroup/RequestObjects.cpp
+29
-20
29 additions, 20 deletions
...RobotAPI/statecharts/ObjectMemoryGroup/RequestObjects.cpp
with
29 additions
and
20 deletions
source/RobotAPI/statecharts/ObjectMemoryGroup/RequestObjects.cpp
+
29
−
20
View file @
78b854f2
...
...
@@ -3,30 +3,34 @@
//#include <ArmarXCore/core/time/TimeUtil.h>
//#include <ArmarXCore/observers/variant/DatafieldRef.h>
#include
<RobotAPI/libraries/armem_objects/client/instance/ObjectReader.h>
#include
<RobotAPI/libraries/ArmarXObjects/ObjectID.h>
#include
<RobotAPI/libraries/ArmarXObjects/ice_conversions.h>
#include
<RobotAPI/libraries/armem_objects/client/instance/ObjectReader.h>
#include
"ObjectMemoryGroupStatechartContext.generated.h"
namespace
armarx
::
ObjectMemoryGroup
{
// DO NOT EDIT NEXT LINE
RequestObjects
::
SubClassRegistry
RequestObjects
::
Registry
(
RequestObjects
::
GetName
(),
&
RequestObjects
::
CreateInstance
);
RequestObjects
::
SubClassRegistry
RequestObjects
::
Registry
(
RequestObjects
::
GetName
(),
&
RequestObjects
::
CreateInstance
);
RequestObjects
::
RequestObjects
(
const
XMLStateConstructorParams
&
stateData
)
:
XMLStateTemplate
<
RequestObjects
>
(
stateData
),
RequestObjectsGeneratedBase
<
RequestObjects
>
(
stateData
)
RequestObjects
::
RequestObjects
(
const
XMLStateConstructorParams
&
stateData
)
:
XMLStateTemplate
<
RequestObjects
>
(
stateData
),
RequestObjectsGeneratedBase
<
RequestObjects
>
(
stateData
)
{
}
void
RequestObjects
::
onEnter
()
void
RequestObjects
::
onEnter
()
{
// put your user code for the enter-point here
// execution time should be short (<100ms)
}
void
RequestObjects
::
run
()
void
RequestObjects
::
run
()
{
if
(
not
in
.
getEnable
())
{
...
...
@@ -39,7 +43,8 @@ namespace armarx::ObjectMemoryGroup
const
std
::
string
provider
=
in
.
isProviderSet
()
?
in
.
getProvider
()
:
""
;
const
std
::
vector
<
std
::
string
>
objectIdsString
=
in
.
getObjectIds
();
const
armarx
::
Duration
relativeTimeout
=
armarx
::
Duration
::
MilliSeconds
(
in
.
getRelativeTimeoutMilliseconds
());
const
armarx
::
Duration
relativeTimeout
=
armarx
::
Duration
::
MilliSeconds
(
in
.
getRelativeTimeoutMilliseconds
());
std
::
stringstream
info
;
std
::
stringstream
warn
;
...
...
@@ -49,21 +54,22 @@ namespace armarx::ObjectMemoryGroup
{
try
{
armarx
::
ObjectID
id
=
armarx
::
ObjectID
::
FromString
(
idString
);
objectIds
.
push_back
(
id
);
info
<<
"Requesting object "
<<
id
<<
"
\n
"
;
armarx
::
ObjectID
id
=
armarx
::
ObjectID
::
FromString
(
idString
);
objectIds
.
push_back
(
id
);
info
<<
"Requesting object "
<<
id
<<
"
\n
"
;
}
catch
(
const
armarx
::
LocalException
&
e
)
{
warn
<<
"
\n
Given object ID '"
<<
idString
<<
"' could not parsed as ObjectID: "
<<
e
.
what
();
warn
<<
"
\n
Given object ID '"
<<
idString
<<
"' could not parsed as ObjectID: "
<<
e
.
what
();
}
}
auto
context
=
getContext
<
ObjectMemoryGroupStatechartContext
>
();
armarx
::
armem
::
client
::
MemoryNameSystem
mns
(
getMemoryNameSystem
(),
context
);
Reader
reader
{
mns
}
;
reader
.
connect
();
Reader
reader
;
reader
.
connect
(
mns
);
objpose
::
ObjectPoseStorageInterfacePrx
storage
=
reader
.
getObjectPoseStorage
();
armarx
::
objpose
::
observer
::
RequestObjectsInput
input
;
...
...
@@ -91,7 +97,8 @@ namespace armarx::ObjectMemoryGroup
{
if
(
result
.
result
.
success
)
{
info
<<
"Requested object "
<<
id
<<
" via provider '"
<<
result
.
providerName
<<
"'.
\n
"
;
info
<<
"Requested object "
<<
id
<<
" via provider '"
<<
result
.
providerName
<<
"'.
\n
"
;
}
else
{
...
...
@@ -105,8 +112,9 @@ namespace armarx::ObjectMemoryGroup
}
if
(
not
warn
.
str
().
empty
())
{
ARMARX_WARNING
<<
"The following issues occurred whhen requesting objects for localization:"
<<
warn
.
str
();
ARMARX_WARNING
<<
"The following issues occurred whhen requesting objects for localization:"
<<
warn
.
str
();
}
emitSuccess
();
...
...
@@ -118,16 +126,17 @@ namespace armarx::ObjectMemoryGroup
// // execution time should be short (<100ms)
//}
void
RequestObjects
::
onExit
()
void
RequestObjects
::
onExit
()
{
// put your user code for the exit point here
// execution time should be short (<100ms)
}
// DO NOT EDIT NEXT FUNCTION
XMLStateFactoryBasePtr
RequestObjects
::
CreateInstance
(
XMLStateConstructorParams
stateData
)
XMLStateFactoryBasePtr
RequestObjects
::
CreateInstance
(
XMLStateConstructorParams
stateData
)
{
return
XMLStateFactoryBasePtr
(
new
RequestObjects
(
stateData
));
}
}
}
// namespace armarx::ObjectMemoryGroup
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