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
1757e7c6
Commit
1757e7c6
authored
1 year ago
by
Fabian Tërnava
Browse files
Options
Downloads
Patches
Plain Diff
added new aliases for vectors and matrices in aron
parent
f0f746d5
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
source/RobotAPI/libraries/aron/codegeneration/typereader/xml/Data.h
+68
-23
68 additions, 23 deletions
...otAPI/libraries/aron/codegeneration/typereader/xml/Data.h
with
68 additions
and
23 deletions
source/RobotAPI/libraries/aron/codegeneration/typereader/xml/Data.h
+
68
−
23
View file @
1757e7c6
...
...
@@ -24,12 +24,13 @@
#pragma once
// STD/STL
#include
<memory>
#include
<map>
#include
<memory>
#include
<optional>
// ArmarX
#include
<SimoxUtility/xml.h>
#include
<ArmarXCore/core/rapidxml/wrapper/RapidXmlReader.h>
/**
...
...
@@ -116,36 +117,80 @@ namespace armarx::aron::typereader::xml
};
// Replacements ({tagName, {replacementsTag, additionalAronDTOXMLIncludePackagePath}, deprecationwarning})
const
std
::
map
<
std
::
string
,
Replacement
>
REPLACEMENTS
=
{
{
"int"
,
{
"<int32 />"
,
{},
"The <int />-tag is deprecated. Please use <int32 /> instead."
}},
{
"long"
,
{
"<int64 />"
,
{},
"The <long />-tag is deprecated. Please use <int64 /> instead."
}},
{
"float"
,
{
"<float32 />"
,
{},
"The <float />-tag is deprecated. Please use <float32 /> instead."
}},
{
"double"
,
{
"<float64 />"
,
{},
"The <double />-tag is deprecated. Please use <float64 /> instead."
}},
{
"position"
,
{
"<matrix rows='3' cols='1' type='float32' />"
,
{},
""
}},
{
"pose"
,
{
"<matrix rows='4' cols='4' type='float32' />"
,
{},
""
}},
{
"orientation"
,
{
"<quaternion type='float32' />"
,
{},
""
}},
const
std
::
map
<
std
::
string
,
Replacement
>
REPLACEMENTS
=
{
{
"int"
,
{
"<int32 />"
,
{},
"The <int />-tag is deprecated. Please use <int32 /> instead."
}},
{
"long"
,
{
"<int64 />"
,
{},
"The <long />-tag is deprecated. Please use <int64 /> instead."
}},
{
"float"
,
{
"<float32 />"
,
{},
"The <float />-tag is deprecated. Please use <float32 /> instead."
}},
{
"double"
,
{
"<float64 />"
,
{},
"The <double />-tag is deprecated. Please use <float64 /> instead."
}},
// should that be deprecated?
{
"position"
,
{
"<matrix rows='3' cols='1' type='float32' />"
,
{},
""
}},
{
"pose"
,
{
"<matrix rows='4' cols='4' type='float32' />"
,
{},
""
}},
{
"orientation"
,
{
"<quaternion type='float32' />"
,
{},
""
}},
// values similar to eigen
{
"quaternionf"
,
{
"<quaternion type='float32' />"
,
{},
""
}},
{
"quaterniond"
,
{
"<quaternion type='float64' />"
,
{},
""
}},
{
"vector2f"
,
{
"<matrix rows='2' cols='1' type='float32' />"
,
{},
""
}},
{
"vector2d"
,
{
"<matrix rows='2' cols='1' type='float64' />"
,
{},
""
}},
{
"vector3f"
,
{
"<matrix rows='3' cols='1' type='float32' />"
,
{},
""
}},
{
"vector3d"
,
{
"<matrix rows='3' cols='1' type='float64' />"
,
{},
""
}},
{
"vector4f"
,
{
"<matrix rows='4' cols='1' type='float32' />"
,
{},
""
}},
{
"vector4d"
,
{
"<matrix rows='4' cols='1' type='float64' />"
,
{},
""
}},
{
"matrix2f"
,
{
"<matrix rows='2' cols='2' type='float32' />"
,
{},
""
}},
{
"matrix2d"
,
{
"<matrix rows='2' cols='2' type='float64' />"
,
{},
""
}},
{
"matrix3f"
,
{
"<matrix rows='3' cols='3' type='float32' />"
,
{},
""
}},
{
"matrix3d"
,
{
"<matrix rows='3' cols='3' type='float64' />"
,
{},
""
}},
{
"matrix4f"
,
{
"<matrix rows='4' cols='4' type='float32' />"
,
{},
""
}},
{
"matrix4d"
,
{
"<matrix rows='4' cols='4' type='float64' />"
,
{},
""
}},
// You can also add replacements for arondtos here!
// structure: {xml-identifier, {replacement, auto-include}, deprecationwarning}
{
"datetime"
,
{
"<armarx::arondto::DateTime />"
,
{
"RobotAPI"
,
"libraries/aron/common/aron/time.xml"
},
""
}},
{
"time"
,
{
"<armarx::arondto::DateTime />"
,
{
"RobotAPI"
,
"libraries/aron/common/aron/time.xml"
},
""
}},
{
"duration"
,
{
"<armarx::arondto::Duration />"
,
{
"RobotAPI"
,
"libraries/aron/common/aron/time.xml"
},
""
}},
{
"framedposition"
,
{
"<armarx::arondto::FramedPosition />"
,
{
"RobotAPI"
,
"libraries/aron/common/aron/framed.xml"
},
""
}},
{
"framedorientation"
,
{
"<armarx::arondto::FramedOrientation />"
,
{
"RobotAPI"
,
"libraries/aron/common/aron/framed.xml"
},
""
}},
{
"framedpose"
,
{
"<armarx::arondto::FramedPose />"
,
{
"RobotAPI"
,
"libraries/aron/common/aron/framed.xml"
},
""
}}
};
}
{
"datetime"
,
{
"<armarx::arondto::DateTime />"
,
{
"RobotAPI"
,
"libraries/aron/common/aron/time.xml"
},
""
}},
{
"time"
,
{
"<armarx::arondto::DateTime />"
,
{
"RobotAPI"
,
"libraries/aron/common/aron/time.xml"
},
""
}},
{
"duration"
,
{
"<armarx::arondto::Duration />"
,
{
"RobotAPI"
,
"libraries/aron/common/aron/time.xml"
},
""
}},
{
"framedposition"
,
{
"<armarx::arondto::FramedPosition />"
,
{
"RobotAPI"
,
"libraries/aron/common/aron/framed.xml"
},
""
}},
{
"framedorientation"
,
{
"<armarx::arondto::FramedOrientation />"
,
{
"RobotAPI"
,
"libraries/aron/common/aron/framed.xml"
},
""
}},
{
"framedpose"
,
{
"<armarx::arondto::FramedPose />"
,
{
"RobotAPI"
,
"libraries/aron/common/aron/framed.xml"
},
""
}}};
}
// namespace constantes
namespace
util
{
std
::
optional
<
RapidXmlReaderNode
>
GetFirstNodeWithTag
(
const
RapidXmlReaderNode
&
node
,
const
std
::
string
&
name
);
std
::
optional
<
RapidXmlReaderNode
>
GetFirstNodeWithTag
(
const
RapidXmlReaderNode
&
node
,
const
std
::
string
&
name
);
void
EnforceAttribute
(
const
RapidXmlReaderNode
&
node
,
const
std
::
string
&
att
);
bool
HasAttribute
(
const
RapidXmlReaderNode
&
node
,
const
std
::
string
&
att
);
std
::
string
GetAttribute
(
const
RapidXmlReaderNode
&
node
,
const
std
::
string
&
att
);
std
::
string
GetAttributeWithDefault
(
const
RapidXmlReaderNode
&
node
,
const
std
::
string
&
att
,
const
std
::
string
&
def
);
std
::
string
GetAttributeWithDefault
(
const
RapidXmlReaderNode
&
node
,
const
std
::
string
&
att
,
const
std
::
string
&
def
);
bool
AttributeIsTrue
(
const
RapidXmlReaderNode
&
node
,
const
std
::
string
&
att
);
bool
HasTagName
(
const
RapidXmlReaderNode
&
node
,
const
std
::
string
&
name
);
...
...
@@ -158,5 +203,5 @@ namespace armarx::aron::typereader::xml
void
EnforceChildSize
(
const
RapidXmlReaderNode
&
node
,
const
size_t
size
);
void
EnforceChildSizeGreaterEqual
(
const
RapidXmlReaderNode
&
node
,
const
size_t
size
);
void
EnforceChildSizeGreater
(
const
RapidXmlReaderNode
&
node
,
const
size_t
size
);
}
}
}
// namespace util
}
// namespace armarx::aron::typereader::xml
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