Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Navigation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
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
Skills
Navigation
Merge requests
!109
Social layers
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Social layers
feature/store-proxemics-in-memory
into
master
Overview
0
Commits
69
Pipelines
0
Changes
3
Open
Fabian Reister
requested to merge
feature/store-proxemics-in-memory
into
master
6 months ago
Overview
0
Commits
69
Pipelines
0
Changes
3
Expand
0
0
Merge request reports
Viewing commit
3a5e3413
Prev
Next
Show latest version
3 files
+
35
−
6
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
3a5e3413
Add test for combined distance
· 3a5e3413
Timo Weberruß
authored
2 years ago
source/armarx/navigation/human/test/human_test.cpp
+
24
−
0
Options
@@ -40,6 +40,7 @@
#include
<armarx/navigation/Test.h>
#include
<armarx/navigation/core/basic_types.h>
#include
<armarx/navigation/human/CombinedDistance.h>
#include
<armarx/navigation/human/MovementDistance.h>
#include
<armarx/navigation/human/types.h>
@@ -47,6 +48,7 @@ using armarx::navigation::core::Pose2D;
using
armarx
::
navigation
::
human
::
EuclideanDistance
;
using
armarx
::
navigation
::
human
::
OrientationDistance
;
using
armarx
::
navigation
::
human
::
MovementDistance
;
using
armarx
::
navigation
::
human
::
CombinedDistance
;
using
armarx
::
navigation
::
human
::
Human
;
BOOST_AUTO_TEST_CASE
(
testEuclideanDistance1_standardDistance
)
@@ -137,6 +139,28 @@ BOOST_AUTO_TEST_CASE(testMovementDistance1_roughlyMovingTogether)
BOOST_CHECK_CLOSE
(
d
,
0.5
,
0.001
);
}
BOOST_AUTO_TEST_CASE
(
testCombinedDistance1_threeDistances
)
{
const
CombinedDistance
combined
=
CombinedDistance
(
2
,
3
);
Pose2D
pose1
=
Pose2D
::
Identity
();
pose1
.
translation
()
=
Eigen
::
Vector2f
(
0
,
0
);
pose1
.
linear
()
=
Eigen
::
Rotation2Df
(
-
M_PI_2
).
toRotationMatrix
();
const
Human
h1
=
{.
pose
=
pose1
,
.
linearVelocity
=
Eigen
::
Vector2f
(
1.0
,
1.0
),
.
detectionTime
=
armarx
::
DateTime
::
Now
()};
Pose2D
pose2
=
Pose2D
::
Identity
();
pose2
.
translation
()
=
Eigen
::
Vector2f
(
2
,
0
);
pose2
.
linear
()
=
Eigen
::
Rotation2Df
(
M_PI_2
).
toRotationMatrix
();
const
Human
h2
=
{.
pose
=
pose2
,
.
linearVelocity
=
Eigen
::
Vector2f
(
1.3
,
1.4
),
.
detectionTime
=
armarx
::
DateTime
::
Now
()};
double
d
=
combined
.
computeDistance
(
h1
,
h2
);
printf
(
"Distance is %.2f
\n
"
,
d
);
BOOST_CHECK_CLOSE
(
d
,
2
*
1.5
*
2.5
,
0.001
);
}
//BOOST_AUTO_TEST_CASE(testPathLength)
//{
// armarx::navigation::core::Path path{
Loading