PersonInstance.cpp
Go to the documentation of this file.
1
#include "
PersonInstance.h
"
2
3
#include <
ArmarXCore/core/logging/Logging.h
>
4
5
#include <
RobotAPI/libraries/armem/client/Reader.h
>
6
7
#include <
VisionX/libraries/armem_human/server/face_recognition/Segment.h
>
8
9
namespace
armarx
10
{
11
void
12
viz::addPersonInstanceToLayer
(
const
armarx::armem::human::FaceRecognition
& faceReco,
13
const
std::string& name,
14
armarx::viz::Layer
& personInstanceLayer,
15
const
std::string& prefix)
16
{
17
ARMARX_TRACE
;
18
static
const
int
radius = 100;
19
armarx::viz::Color
color =
armarx::viz::Color::fromRGBA
(255, 255, 0, 255);
20
Eigen::Matrix
pos3D = faceReco.
position3DGlobal
;
21
armarx::viz::Sphere
facePos =
armarx::viz::Sphere
(
"Person instance of "
+ name)
22
.
position
(pos3D.x(), pos3D.y(), pos3D.z())
23
.
radius
(radius)
24
.
color
(color);
25
Eigen::Matrix4f
nameTagRotation;
26
nameTagRotation << -1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1;
27
armarx::viz::Text
nameTag =
28
armarx::viz::Text
(
"Name of"
+ name)
29
.
text
(name)
30
.
scale
(15)
31
.
pose
(nameTagRotation)
32
.
position
(pos3D.x(), pos3D.y() + (
int
)(radius / 2) + 10, pos3D.z());
33
personInstanceLayer.
add
(facePos);
34
personInstanceLayer.
add
(nameTag);
35
}
36
}
// namespace armarx
Reader.h
armarx::armem::human::FaceRecognition
Definition:
types.h:59
armarx::viz::Color::fromRGBA
static Color fromRGBA(int r, int g, int b, int a=255)
Construct a byte color from R, G, B and optional alpha.
Definition:
Color.h:42
armarx::viz::Layer::add
void add(ElementT const &element)
Definition:
Layer.h:29
armarx::viz::Text::text
Text & text(std::string const &t)
Definition:
Elements.h:189
armarx::viz::Sphere
Definition:
Elements.h:134
armarx::viz::ElementOps::position
DerivedT & position(float x, float y, float z)
Definition:
ElementOps.h:127
ARMARX_TRACE
#define ARMARX_TRACE
Definition:
trace.h:69
armarx::viz::Sphere::radius
Sphere & radius(float r)
Definition:
Elements.h:138
armarx::viz::Color
Definition:
Color.h:13
PersonInstance.h
armarx::viz::addPersonInstanceToLayer
void addPersonInstanceToLayer(const armarx::armem::human::FaceRecognition &faceReco, const std::string &name, armarx::viz::Layer &personInstanceLayer, const std::string &prefix)
Definition:
PersonInstance.cpp:12
armarx::viz::Text
Definition:
Elements.h:185
armarx::armem::human::FaceRecognition::position3DGlobal
Eigen::Matrix< float, 3, 1 > position3DGlobal
Definition:
types.h:62
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition:
MatrixXX.h:601
armarx::viz::ElementOps::pose
DerivedT & pose(Eigen::Matrix4f const &pose)
Definition:
ElementOps.h:159
Segment.h
armarx::viz::ElementOps::scale
DerivedT & scale(Eigen::Vector3f scale)
Definition:
ElementOps.h:227
armarx::viz::ElementOps::color
DerivedT & color(Color color)
Definition:
ElementOps.h:195
Eigen::Matrix
Definition:
EigenForwardDeclarations.h:27
Logging.h
armarx::viz::Layer
Definition:
Layer.h:12
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition:
ArmarXTimeserver.cpp:28
VisionX
libraries
ArViz
PersonInstance.cpp
Generated on Sat Oct 12 2024 09:14:18 for armarx_documentation by
1.8.17