Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MantleAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Bauer
MantleAPI
Commits
fde7bd3f
Commit
fde7bd3f
authored
3 years ago
by
Islam Abed
Browse files
Options
Downloads
Patches
Plain Diff
Add interface function for points and polyline transformation
parent
019aef26
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MantleAPI/include/MantleAPI/Common/i_geometry_helper.h
+22
-0
22 additions, 0 deletions
MantleAPI/include/MantleAPI/Common/i_geometry_helper.h
MantleAPI/test/MantleAPI/Test/test_utils.h
+23
-1
23 additions, 1 deletion
MantleAPI/test/MantleAPI/Test/test_utils.h
with
45 additions
and
1 deletion
MantleAPI/include/MantleAPI/Common/i_geometry_helper.h
+
22
−
0
View file @
fde7bd3f
...
@@ -17,6 +17,8 @@
...
@@ -17,6 +17,8 @@
#include
<MantleAPI/Common/pose.h>
#include
<MantleAPI/Common/pose.h>
#include
<vector>
namespace
mantle_api
namespace
mantle_api
{
{
/// Interface that provides functionality to perform geometrical calculations
/// Interface that provides functionality to perform geometrical calculations
...
@@ -36,6 +38,26 @@ public:
...
@@ -36,6 +38,26 @@ public:
const
Vec3
<
units
::
length
::
meter_t
>&
global_position
,
const
Vec3
<
units
::
length
::
meter_t
>&
global_position
,
const
Orientation3
<
units
::
angle
::
radian_t
>&
local_orientation
,
const
Orientation3
<
units
::
angle
::
radian_t
>&
local_orientation
,
const
Vec3
<
units
::
length
::
meter_t
>&
local_translation
)
const
=
0
;
const
Vec3
<
units
::
length
::
meter_t
>&
local_translation
)
const
=
0
;
/// @brief Transforms world polyline positions to local coordinate system.
/// @param polyline_points world polyline points to be transformed
/// @param position local system position
/// @param orientation local system orientation
/// @return converted polyline points
virtual
std
::
vector
<
Vec3
<
units
::
length
::
meter_t
>>
TransformPolylinePointsFromWorldToLocal
(
const
std
::
vector
<
Vec3
<
units
::
length
::
meter_t
>>&
polyline_points
,
const
Vec3
<
units
::
length
::
meter_t
>&
position
,
const
Orientation3
<
units
::
angle
::
radian_t
>&
orientation
)
const
=
0
;
/// @brief Transforms world position to local coordinate system.
/// @param point_position world point position to be transformed
/// @param position local system position
/// @param orientation local system orientation
/// @return transformed point
virtual
Vec3
<
units
::
length
::
meter_t
>
TransformPointPositionFromWorldToLocal
(
const
Vec3
<
units
::
length
::
meter_t
>&
point_position
,
const
Vec3
<
units
::
length
::
meter_t
>&
position
,
const
Orientation3
<
units
::
angle
::
radian_t
>&
orientation
)
const
=
0
;
};
};
}
// namespace mantle_api
}
// namespace mantle_api
...
...
This diff is collapsed.
Click to expand it.
MantleAPI/test/MantleAPI/Test/test_utils.h
+
23
−
1
View file @
fde7bd3f
...
@@ -43,7 +43,29 @@ public:
...
@@ -43,7 +43,29 @@ public:
std
::
ignore
=
local_orientation
;
std
::
ignore
=
local_orientation
;
std
::
ignore
=
local_translation
;
std
::
ignore
=
local_translation
;
return
global_position
;
return
global_position
;
};
}
virtual
std
::
vector
<
Vec3
<
units
::
length
::
meter_t
>>
TransformPolylinePointsFromWorldToLocal
(
const
std
::
vector
<
Vec3
<
units
::
length
::
meter_t
>>&
polyline_points
,
const
Vec3
<
units
::
length
::
meter_t
>&
position
,
const
Orientation3
<
units
::
angle
::
radian_t
>&
orientation
)
const
{
// do not translate but return original points
std
::
ignore
=
position
;
std
::
ignore
=
orientation
;
return
polyline_points
;
}
virtual
Vec3
<
units
::
length
::
meter_t
>
TransformPointPositionFromWorldToLocal
(
const
Vec3
<
units
::
length
::
meter_t
>&
point_position
,
const
Vec3
<
units
::
length
::
meter_t
>&
position
,
const
Orientation3
<
units
::
angle
::
radian_t
>&
orientation
)
const
{
// do not translate but return original points
std
::
ignore
=
position
;
std
::
ignore
=
orientation
;
return
point_position
;
}
};
};
class
MockConverter
:
public
mantle_api
::
ICoordConverter
class
MockConverter
:
public
mantle_api
::
ICoordConverter
...
...
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