Skip to content
Snippets Groups Projects
Commit e99f4b6b authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Merge branch 'aron-types' into 'master'

Add common ARON types

See merge request ArmarX/RobotAPI!231
parents cec653e7 2184589e
No related branches found
No related tags found
No related merge requests found
......@@ -13,19 +13,29 @@ armarx_add_library(
HEADERS
aron_conversions.h
forward_declarations.h
json_conversions.h
aron_conversions/core.h
aron_conversions/armarx.h
aron_conversions/simox.h
aron_conversions/stl.h
aron_conversions/eigen.h
json_conversions/armarx.h
util/object_finders.h
SOURCES
aron_conversions/core.cpp
aron_conversions/armarx.cpp
aron_conversions/simox.cpp
aron_conversions/stl.cpp
aron_conversions/eigen.cpp
json_conversions/armarx.cpp
util/object_finders.cpp
)
......@@ -34,13 +44,15 @@ armarx_enable_aron_file_generation_for_target(
TARGET_NAME
"${LIB_NAME}"
ARON_FILES
aron/trajectory.xml
aron/color.xml
aron/PackagePath.xml
aron/AxisAlignedBoundingBox.xml
aron/color.xml
aron/Color.xml
aron/framed.xml
aron/Names.xml
aron/OrientedBox.xml
aron/PackagePath.xml
aron/time.xml
aron/framed.xml
aron/trajectory.xml
)
add_library(aron::common ALIAS aroncommon)
......
<?xml version="1.0" encoding="UTF-8" ?>
<AronTypeDefinition>
<GenerateTypes>
<Object name='simox::arondto::Color'>
<ObjectChild key='r'>
<int />
</ObjectChild>
<ObjectChild key='g'>
<int />
</ObjectChild>
<ObjectChild key='b'>
<int />
</ObjectChild>
<ObjectChild key='a'>
<int />
</ObjectChild>
</Object>
</GenerateTypes>
</AronTypeDefinition>
<!--
Recognized and spoken names of a named entity.
-->
<?xml version="1.0" encoding="UTF-8" ?>
<AronTypeDefinition>
<GenerateTypes>
<Object name="armarx::arondto::Names">
<ObjectChild key="recognized">
<List>
<String/>
</List>
</ObjectChild>
<ObjectChild key="spoken">
<List>
<String/>
</List>
</ObjectChild>
</Object>
</GenerateTypes>
</AronTypeDefinition>
#include "simox.h"
#include <RobotAPI/libraries/aron/common/aron/AxisAlignedBoundingBox.aron.generated.h>
#include <RobotAPI/libraries/aron/common/aron/Color.aron.generated.h>
#include <RobotAPI/libraries/aron/common/aron/OrientedBox.aron.generated.h>
void simox::fromAron(const arondto::AxisAlignedBoundingBox& dto, AxisAlignedBoundingBox& bo)
......@@ -15,7 +18,6 @@ void simox::toAron(arondto::AxisAlignedBoundingBox& dto, const AxisAlignedBoundi
}
void simox::fromAron(const arondto::OrientedBox& dto, OrientedBoxf& bo)
{
bo = OrientedBoxf(dto.center, dto.orientation, dto.extents);
......@@ -28,3 +30,19 @@ void simox::toAron(arondto::OrientedBox& dto, const OrientedBoxf& bo)
dto.extents = bo.dimensions();
}
void simox::fromAron(const arondto::Color& dto, Color& bo)
{
bo.r = dto.r;
bo.g = dto.g;
bo.b = dto.b;
bo.a = dto.a;
}
void simox::toAron(arondto::Color& dto, const Color& bo)
{
dto.r = bo.r;
dto.g = bo.g;
dto.b = bo.b;
dto.a = bo.a;
}
#pragma once
#include <SimoxUtility/color/Color.h>
#include <SimoxUtility/shapes/AxisAlignedBoundingBox.h>
#include <RobotAPI/libraries/aron/common/aron/AxisAlignedBoundingBox.aron.generated.h>
#include <SimoxUtility/shapes/OrientedBox.h>
#include <RobotAPI/libraries/aron/common/aron/OrientedBox.aron.generated.h>
#include <RobotAPI/libraries/aron/common/forward_declarations.h>
namespace simox
......@@ -14,5 +14,8 @@ namespace simox
void fromAron(const arondto::OrientedBox& dto, OrientedBoxf& bo);
void toAron(arondto::OrientedBox& dto, const OrientedBoxf& bo);
void fromAron(const arondto::Color& dto, Color& bo);
void toAron(arondto::Color& dto, const Color& bo);
}
#pragma once
namespace simox::arondto
{
class AxisAlignedBoundingBox;
class Color;
class OrientedBox;
}
namespace armarx::arondto
{
class Names;
}
#pragma once
#include "json_conversions/armarx.h"
#include "armarx.h"
#include <RobotAPI/libraries/aron/common/aron/Names.aron.generated.h>
void armarx::arondto::to_json(nlohmann::json& j, const Names& bo)
{
j["recognized"] = bo.recognized;
j["spoken"] = bo.spoken;
}
void armarx::arondto::from_json(const nlohmann::json& j, Names& bo)
{
j.at("recognized").get_to(bo.recognized);
j.at("spoken").get_to(bo.spoken);
}
#pragma once
#include <SimoxUtility/json/json.h>
#include <RobotAPI/libraries/aron/common/forward_declarations.h>
namespace armarx::arondto
{
void to_json(nlohmann::json& j, const Names& bo);
void from_json(const nlohmann::json& j, Names& bo);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment