Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Simox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Leander Singer
Simox
Commits
b4af7b08
Commit
b4af7b08
authored
2 years ago
by
Rainer Kartmann
Committed by
ARMAR-6 User
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
use explicit namespace qualification
parent
c20af0cd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SimoxUtility/json/eigen_conversion.cpp
+25
-28
25 additions, 28 deletions
SimoxUtility/json/eigen_conversion.cpp
with
25 additions
and
28 deletions
SimoxUtility/json/eigen_conversion.cpp
+
25
−
28
View file @
b4af7b08
...
...
@@ -5,44 +5,41 @@
#include
<Eigen/Geometry>
namespace
Eigen
void
Eigen
::
from_json
(
const
::
simox
::
json
::
json
&
j
,
Eigen
::
Vector3f
&
vector
)
{
void
from_json
(
const
::
simox
::
json
::
json
&
j
,
Eigen
::
Vector3f
&
vector
)
if
(
j
.
is_object
()
)
{
if
(
j
.
is_object
())
{
vector
.
x
()
=
j
.
at
(
"x"
).
get
<
float
>
();
vector
.
y
()
=
j
.
at
(
"y"
).
get
<
float
>
();
vector
.
z
()
=
j
.
at
(
"z"
).
get
<
float
>
();
}
else
// j.is_array()
{
jsonbase
::
from_json
(
j
,
vector
);
}
vector
.
x
()
=
j
.
at
(
"x"
).
get
<
float
>
();
vector
.
y
()
=
j
.
at
(
"y"
).
get
<
float
>
();
vector
.
z
()
=
j
.
at
(
"z"
).
get
<
float
>
();
}
else
// j.is_array()
{
jsonbase
::
from_json
(
j
,
vector
);
}
}
void
from_json
(
const
::
simox
::
json
::
json
&
j
,
Eigen
::
Matrix4f
&
matrix
)
void
Eigen
::
from_json
(
const
::
simox
::
json
::
json
&
j
,
Eigen
::
Matrix4f
&
matrix
)
{
if
(
j
.
is_object
())
{
if
(
j
.
is_object
())
const
auto
&
j_ori
=
j
.
at
(
"ori"
);
Eigen
::
Matrix3f
ori
;
if
(
j_ori
.
is_object
())
{
const
auto
&
j_ori
=
j
.
at
(
"ori"
);
Eigen
::
Matrix3f
ori
;
if
(
j_ori
.
is_object
())
{
ori
=
j_ori
.
get
<
Eigen
::
Quaternionf
>
().
toRotationMatrix
();
}
else
{
ori
=
j_ori
.
get
<
Eigen
::
Matrix3f
>
();
}
matrix
=
simox
::
math
::
pose
(
j
.
at
(
"pos"
).
get
<
Eigen
::
Vector3f
>
(),
ori
);
ori
=
j_ori
.
get
<
Eigen
::
Quaternionf
>
().
toRotationMatrix
();
}
else
{
jsonbase
::
from_json
(
j
,
m
atrix
);
ori
=
j_ori
.
get
<
Eigen
::
M
atrix
3f
>
(
);
}
matrix
=
simox
::
math
::
pose
(
j
.
at
(
"pos"
).
get
<
Eigen
::
Vector3f
>
(),
ori
);
}
else
{
jsonbase
::
from_json
(
j
,
matrix
);
}
}
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