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
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
RobotAPI
Commits
575ace44
Commit
575ace44
authored
4 years ago
by
Rainer Kartmann
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/master' into ObjectFinder-no-throw-on-init
parents
50aa0531
a0a8d077
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/RobotAPI/libraries/core/CMakeLists.txt
+2
-0
2 additions, 0 deletions
source/RobotAPI/libraries/core/CMakeLists.txt
source/RobotAPI/libraries/core/json_conversions.h
+64
-0
64 additions, 0 deletions
source/RobotAPI/libraries/core/json_conversions.h
with
66 additions
and
0 deletions
source/RobotAPI/libraries/core/CMakeLists.txt
+
2
−
0
View file @
575ace44
...
...
@@ -108,6 +108,8 @@ set(LIB_HEADERS
#diffik/NaturalDiffIK.h
#diffik/SimpleDiffIK.h
json_conversions.h
)
add_subdirectory
(
test
)
...
...
This diff is collapsed.
Click to expand it.
source/RobotAPI/libraries/core/json_conversions.h
0 → 100644
+
64
−
0
View file @
575ace44
/*
* This file is part of ArmarX.
*
* ArmarX is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* ArmarX is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package RobotAPI::Core
* @author Christian R. G. Dreher <c.dreher@kit.edu>
* @date 2020
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#pragma once
// Simox
#include
<SimoxUtility/json.h>
// RobotAPI
#include
<RobotAPI/libraries/core/FramedPose.h>
namespace
armarx
{
void
to_json
(
nlohmann
::
json
&
j
,
const
FramedPose
&
fp
)
{
j
=
nlohmann
::
json
{
{
"agent"
,
fp
.
agent
},
{
"frame"
,
fp
.
frame
},
{
"qw"
,
fp
.
orientation
->
qw
},
{
"qx"
,
fp
.
orientation
->
qx
},
{
"qy"
,
fp
.
orientation
->
qy
},
{
"qz"
,
fp
.
orientation
->
qz
},
{
"x"
,
fp
.
position
->
x
},
{
"y"
,
fp
.
position
->
y
},
{
"z"
,
fp
.
position
->
z
}
};
}
void
from_json
(
const
nlohmann
::
json
&
j
,
FramedPose
&
fp
)
{
j
.
at
(
"agent"
).
get_to
(
fp
.
agent
);
j
.
at
(
"frame"
).
get_to
(
fp
.
frame
);
j
.
at
(
"qw"
).
get_to
(
fp
.
orientation
->
qw
);
j
.
at
(
"qx"
).
get_to
(
fp
.
orientation
->
qx
);
j
.
at
(
"qy"
).
get_to
(
fp
.
orientation
->
qy
);
j
.
at
(
"qz"
).
get_to
(
fp
.
orientation
->
qz
);
j
.
at
(
"x"
).
get_to
(
fp
.
position
->
x
);
j
.
at
(
"y"
).
get_to
(
fp
.
position
->
y
);
j
.
at
(
"z"
).
get_to
(
fp
.
position
->
z
);
}
}
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