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
Commits
482aee62
Commit
482aee62
authored
2 years ago
by
Timo Weberruß
Browse files
Options
Downloads
Patches
Plain Diff
Add human tracker test (this, for real)
parent
c5939506
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!68
Add human tracking
,
!28
Draft: Dev -> Main
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/armarx/navigation/human/test/human_tracker_test.cpp
+96
-0
96 additions, 0 deletions
source/armarx/navigation/human/test/human_tracker_test.cpp
with
96 additions
and
0 deletions
source/armarx/navigation/human/test/human_tracker_test.cpp
0 → 100644
+
96
−
0
View file @
482aee62
/**
* 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/>.
*
* @author Timo Weberruß ( timo dot weberruss at student dot kit dot edu )
* @date 2022
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#include
<ArmarXCore/core/time/DateTime.h>
#include
<ArmarXCore/core/time/Duration.h>
#include
<ArmarXCore/interface/core/BasicVectorTypes.h>
#include
<VisionX/libraries/armem_human/types.h>
#include
<armarx/navigation/core/basic_types.h>
#include
<armarx/navigation/human/HumanFilter.h>
#include
<armarx/navigation/human/HumanTracker.h>
#include
<armarx/navigation/human/types.h>
// test includes
#define BOOST_TEST_MODULE Navigation::ArmarXLibraries::human
#define ARMARX_BOOST_TEST
#include
<armarx/navigation/Test.h>
using
armarx
::
armem
::
human
::
HumanPose
;
using
armarx
::
armem
::
human
::
PoseKeypoint
;
using
armarx
::
navigation
::
core
::
Pose2D
;
using
CamMm
=
armarx
::
navigation
::
human
::
HumanTracker
::
CameraMeasurement
;
using
LaserMm
=
armarx
::
navigation
::
human
::
HumanTracker
::
LaserMeasurement
;
using
Eigen
::
Vector2f
;
namespace
armarx
::
navigation
::
human
{
Eigen
::
Quaternionf
quatFromEuler
(
float
roll
,
float
pitch
,
float
yaw
)
{
return
Eigen
::
AngleAxisf
(
roll
,
Eigen
::
Vector3f
::
UnitX
())
*
Eigen
::
AngleAxisf
(
pitch
,
Eigen
::
Vector3f
::
UnitY
())
*
Eigen
::
AngleAxisf
(
yaw
,
Eigen
::
Vector3f
::
UnitZ
());
}
BOOST_AUTO_TEST_CASE
(
testLaserTracking
)
{
HumanTracker
tracker
=
HumanTracker
();
Eigen
::
Vector3f
initialPosition
(
0
,
0
,
2
);
Eigen
::
Quaternionf
orientation
=
quatFromEuler
(
0
,
0
,
M_PI_2
);
std
::
int64_t
timestepMs
=
100
;
Eigen
::
Vector3f
movementSpeedMetPerSec
(
1
,
0
,
0
);
int
cameraSteps
=
10
;
Eigen
::
Vector3f
posDelta
=
movementSpeedMetPerSec
*
(
timestepMs
/
1000
);
std
::
vector
<
CamMm
>
camMeasurements
=
std
::
vector
<
CamMm
>
();
for
(
int
i
=
0
;
i
<
cameraSteps
;
i
++
)
{
DateTime
t
=
DateTime
(
Duration
::
MilliSeconds
(
i
*
timestepMs
));
Eigen
::
Vector3f
newPos
=
initialPosition
+
i
*
posDelta
;
FramedPosition
headPosition
=
FramedPosition
(
newPos
,
""
,
""
);
FramedOrientation
headOrientation
=
FramedOrientation
(
orientation
,
""
,
""
);
PoseKeypoint
head
=
{.
label
=
"HEAD"
,
.
confidence
=
0.95
,
.
positionGlobal
=
headPosition
,
.
orientationGlobal
=
headOrientation
};
HumanPose
pose
=
{
"posemodelid"
,
{{
"HEAD"
,
head
}}};
std
::
vector
<
armem
::
human
::
HumanPose
>
humanPoses
=
{
pose
};
CamMm
camMm
=
{
t
,
humanPoses
};
tracker
.
update
(
camMm
);
}
// TODO: now add a lasersensor measurement roughly at the next human pose
DateTime
tLaser
=
DateTime
(
Duration
::
MilliSeconds
(
cameraSteps
*
timestepMs
));
std
::
vector
<
Cluster
>
clusters
=
std
::
vector
<
Cluster
>
();
LaserMm
laserMm
;
tracker
.
update
(
laserMm
);
}
}
// namespace armarx::navigation::human
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