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
d482b53d
Commit
d482b53d
authored
2 years ago
by
Fabian Reister
Browse files
Options
Downloads
Patches
Plain Diff
ArticulatedObjectWriter: fixing data path
parent
7e335efe
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!317
Feature/open fridge
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/RobotAPI/libraries/armem_objects/client/articulated_object/ArticulatedObjectWriter.cpp
+32
-23
32 additions, 23 deletions
...cts/client/articulated_object/ArticulatedObjectWriter.cpp
with
32 additions
and
23 deletions
source/RobotAPI/libraries/armem_objects/client/articulated_object/ArticulatedObjectWriter.cpp
+
32
−
23
View file @
d482b53d
...
...
@@ -3,44 +3,53 @@
#include
<Eigen/Core>
#include
<Eigen/Geometry>
#include
<VirtualRobot/Robot.h>
#include
<ArmarXCore/core/exceptions/local/ExpressionException.h>
#include
<ArmarXCore/core/logging/Logging.h>
#include
<ArmarXCore/core/system/ArmarXDataPath.h>
#include
<VirtualRobot/Robot.h>
#include
<ArmarXCore/core/system/cmake/CMakePackageFinder.h>
namespace
armarx
::
armem
::
articulated_object
{
armem
::
articulated_object
::
ArticulatedObject
convert
(
const
VirtualRobot
::
Robot
&
obj
,
const
armem
::
Time
&
timestamp
)
armem
::
articulated_object
::
ArticulatedObject
convert
(
const
VirtualRobot
::
Robot
&
obj
,
const
armem
::
Time
&
timestamp
)
{
ARMARX_DEBUG
<<
"Filename is "
<<
obj
.
getFilename
();
// TODO(fabian.reister): remove "PriorKnowledgeData" below
const
std
::
vector
<
std
::
string
>
packages
=
armarx
::
CMakePackageFinder
::
FindAllArmarXSourcePackages
();
const
std
::
string
package
=
armarx
::
ArmarXDataPath
::
getProject
(
packages
,
obj
.
getFilename
());
return
armem
::
articulated_object
::
ArticulatedObject
// make sure that the relative path is without the 'package/' prefix
const
std
::
string
fileRelPath
=
[
&
obj
,
&
package
]()
->
std
::
string
{
.
description
=
{
.
name
=
obj
.
getType
(),
.
xml
=
PackagePath
(
armarx
::
ArmarXDataPath
::
getProject
(
{
"PriorKnowledgeData"
},
obj
.
getFilename
()),
obj
.
getFilename
())
},
.
instance
=
obj
.
getName
(),
.
config
=
{
.
timestamp
=
timestamp
,
.
globalPose
=
Eigen
::
Affine3f
(
obj
.
getRootNode
()
->
getGlobalPose
()),
.
jointMap
=
obj
.
getJointValues
()
},
.
timestamp
=
timestamp
};
if
(
simox
::
alg
::
starts_with
(
obj
.
getFilename
(),
package
))
{
// remove "package" + "/"
const
std
::
string
fixedFilename
=
obj
.
getFilename
().
substr
(
package
.
size
()
+
1
,
-
1
);
return
fixedFilename
;
}
return
obj
.
getFilename
();
}();
return
armem
::
articulated_object
::
ArticulatedObject
{
.
description
=
{.
name
=
obj
.
getType
(),
.
xml
=
PackagePath
(
armarx
::
ArmarXDataPath
::
getProject
(
{
package
},
fileRelPath
),
obj
.
getFilename
())},
.
instance
=
obj
.
getName
(),
.
config
=
{.
timestamp
=
timestamp
,
.
globalPose
=
Eigen
::
Affine3f
(
obj
.
getRootNode
()
->
getGlobalPose
()),
.
jointMap
=
obj
.
getJointValues
()},
.
timestamp
=
timestamp
};
}
bool
ArticulatedObjectWriter
::
storeArticulatedObject
(
const
VirtualRobot
::
RobotPtr
&
articulatedObject
,
const
armem
::
Time
&
timestamp
)
ArticulatedObjectWriter
::
storeArticulatedObject
(
const
VirtualRobot
::
RobotPtr
&
articulatedObject
,
const
armem
::
Time
&
timestamp
)
{
ARMARX_CHECK_NOT_NULL
(
articulatedObject
);
...
...
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