k4a_bt_body_32.h
Go to the documentation of this file.
1 /**
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @author Fabian Reister ( fabian dot reister at kit dot edu )
17  * @date 2022
18  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19  * GNU General Public License
20  */
21 
22 #pragma once
23 
24 #include <SimoxUtility/color/Color.h>
25 #include <SimoxUtility/meta/enum/EnumNames.hpp>
26 
27 
28 /**
29  * Body model taken from https://docs.microsoft.com/en-us/azure/kinect-dk/body-joints and used
30  * with Azure Kinect Body Tracking SDK 1.1.1.
31  */
33 {
34  inline const std::string ModelId = "K4ABT_BODY_32";
35 
36  /**
37  * Joints with index as defined in the body model.
38  */
39  enum class Joints
40  {
41  Pelvis,
42  SpineNaval,
43  SpineChest,
44  Neck,
47  ElbowLeft,
48  WristLeft,
49  HandLeft,
51  ThumbLeft,
54  ElbowRight,
55  WristRight,
56  HandRight,
58  ThumbRight,
59  HipLeft,
60  KneeLeft,
61  AnkleLeft,
62  FootLeft,
63  HipRight,
64  KneeRight,
65  AnkleRight,
66  FootRight,
67  Head,
68  Nose,
69  EyeLeft,
70  EarLeft,
71  EyeRight,
72  EarRight
73  };
74 
75  /**
76  * Names of the joints as defined in the body model.
77  */
78  inline const simox::meta::EnumNames<Joints> JointNames{{Joints::Pelvis, "Pelvis"},
79  {Joints::SpineNaval, "SpineNaval"},
80  {Joints::SpineChest, "SpineChest"},
81  {Joints::Neck, "Neck"},
82  {Joints::ClavicleLeft, "ClavicleLeft"},
83  {Joints::ShoulderLeft, "ShoulderLeft"},
84  {Joints::ElbowLeft, "ElbowLeft"},
85  {Joints::WristLeft, "WristLeft"},
86  {Joints::HandLeft, "HandLeft"},
87  {Joints::HandtipLeft, "HandtipLeft"},
88  {Joints::ThumbLeft, "ThumbLeft"},
89  {Joints::ClavicleRight, "ClavicleRight"},
90  {Joints::ShoulderRight, "ShoulderRight"},
91  {Joints::ElbowRight, "ElbowRight"},
92  {Joints::WristRight, "WristRight"},
93  {Joints::HandRight, "HandRight"},
94  {Joints::HandtipRight, "HandtipRight"},
95  {Joints::ThumbRight, "ThumbRight"},
96  {Joints::HipLeft, "HipLeft"},
97  {Joints::KneeLeft, "KneeLeft"},
98  {Joints::AnkleLeft, "AnkleLeft"},
99  {Joints::FootLeft, "FootLeft"},
100  {Joints::HipRight, "HipRight"},
101  {Joints::KneeRight, "KneeRight"},
102  {Joints::AnkleRight, "AnkleRight"},
103  {Joints::FootRight, "FootRight"},
104  {Joints::Head, "Head"},
105  {Joints::Nose, "Nose"},
106  {Joints::EyeLeft, "EyeLeft"},
107  {Joints::EarLeft, "EarLeft"},
108  {Joints::EyeRight, "EyeRight"},
109  {Joints::EarRight, "EarRight"}};
110 
111  /**
112  * Segments (defined by pairs of joints) as defined in the body model.
113  */
114  inline const std::vector<std::pair<Joints, Joints>> Segments{
146 
147 
148  inline const std::map<Joints, simox::Color> Colors = {
149  {Joints::Pelvis, {0.f, 1.f, 0.f}},
150  {Joints::SpineNaval, {0.f, 1.f, 0.f}},
151  {Joints::SpineChest, {1.f, 0.f, 85.f / 255.f}},
152  {Joints::Neck, {1.f, 0.f, 85.f / 255.f}},
153  {Joints::ClavicleLeft, {1.f, 1.f, 0.f}},
154  {Joints::ShoulderLeft, {1.f, 1.f, 0.f}},
155  {Joints::ElbowLeft, {170.f / 255.f, 1.f, 0.f}},
156  {Joints::WristLeft, {85.f / 255.f, 1.f, 0.f}},
157  {Joints::HandLeft, {1.f, 0.f, 0.f}},
158  {Joints::HandtipLeft, {0.f, 1.f, 0.f}},
159  {Joints::ThumbLeft, {0.f, 0.f, 1.f}},
160  {Joints::ClavicleRight, {1.f, 0.f, 0.f}},
161  {Joints::ShoulderRight, {1.f, 0.f, 0.f}},
162  {Joints::ElbowRight, {1.f, 85.f / 255.f, 0.f}},
163  {Joints::WristRight, {1.f, 170.f / 255.f, 0.f}},
164  {Joints::HandRight, {1.f, 0.f, 0.f}},
165  {Joints::HandtipRight, {0.f, 1.f, 0.f}},
166  {Joints::ThumbRight, {0.f, 0.f, 1.f}},
167  {Joints::HipLeft, {0.f, 1.f, 1.f}},
168  {Joints::KneeLeft, {0.f, 170.f / 255.f, 1.f}},
169  {Joints::AnkleLeft, {0.f, 85.f / 255.f, 1.f}},
170  {Joints::FootLeft, {85.f / 255.f, 0.f, 1.f}},
171  {Joints::HipRight, {1.f, 0.f, 0.f}},
172  {Joints::KneeRight, {0.f, 1.f, 85.f / 255.f}},
173  {Joints::AnkleRight, {0.f, 1.f, 170.f / 255.f}},
174  {Joints::FootRight, {0.f, 0.f, 1.f}},
175  {Joints::Head, {1.f, 0.f, 85.f / 255.f}},
176  {Joints::Nose, {1.f, 0.f, 85.f / 255.f}},
177  {Joints::EyeLeft, {1.f, 0.f, 170.f / 255.f}},
178  {Joints::EarLeft, {1.f, 0.f, 1.f}},
179  {Joints::EyeRight, {0.f, 0.f, 1.f}},
180  {Joints::EarRight, {170.f / 255.f, 0.f, 1.f}}};
181 
182 } // namespace armarx::human::pose::model::k4a_bt_body_32
armarx::human::pose::model::k4a_bt_body_32::Joints::EarLeft
@ EarLeft
armarx::human::pose::model::k4a_bt_body_32::Joints::ElbowLeft
@ ElbowLeft
armarx::human::pose::model::k4a_bt_body_32::Joints::SpineChest
@ SpineChest
armarx::human::pose::model::k4a_bt_body_32::Joints
Joints
Joints with index as defined in the body model.
Definition: k4a_bt_body_32.h:39
armarx::human::pose::model::k4a_bt_body_32::Joints::HandRight
@ HandRight
armarx::human::pose::model::k4a_bt_body_32::Joints::FootLeft
@ FootLeft
armarx::human::pose::model::k4a_bt_body_32
This file is part of ArmarX.
Definition: k4a_bt_body_32.h:32
armarx::human::pose::model::k4a_bt_body_32::Joints::Neck
@ Neck
armarx::human::pose::model::k4a_bt_body_32::Joints::EarRight
@ EarRight
armarx::human::pose::model::k4a_bt_body_32::Joints::EyeLeft
@ EyeLeft
armarx::human::pose::model::k4a_bt_body_32::Joints::HipLeft
@ HipLeft
armarx::human::pose::model::k4a_bt_body_32::Joints::FootRight
@ FootRight
armarx::human::pose::model::k4a_bt_body_32::Joints::Head
@ Head
armarx::human::pose::model::k4a_bt_body_32::Joints::HipRight
@ HipRight
armarx::human::pose::model::k4a_bt_body_32::Joints::SpineNaval
@ SpineNaval
armarx::human::pose::model::k4a_bt_body_32::Joints::WristLeft
@ WristLeft
armarx::human::pose::model::k4a_bt_body_32::Joints::Pelvis
@ Pelvis
armarx::human::pose::model::k4a_bt_body_32::Joints::WristRight
@ WristRight
armarx::human::pose::model::k4a_bt_body_32::Joints::ShoulderRight
@ ShoulderRight
armarx::human::pose::model::k4a_bt_body_32::JointNames
const simox::meta::EnumNames< Joints > JointNames
Names of the joints as defined in the body model.
Definition: k4a_bt_body_32.h:78
armarx::human::pose::model::k4a_bt_body_32::Joints::ClavicleRight
@ ClavicleRight
armarx::human::pose::model::k4a_bt_body_32::Joints::KneeRight
@ KneeRight
armarx::human::pose::model::k4a_bt_body_32::Segments
const std::vector< std::pair< Joints, Joints > > Segments
Segments (defined by pairs of joints) as defined in the body model.
Definition: k4a_bt_body_32.h:114
armarx::human::pose::model::k4a_bt_body_32::Joints::HandLeft
@ HandLeft
armarx::human::pose::model::k4a_bt_body_32::Joints::ElbowRight
@ ElbowRight
armarx::human::pose::model::k4a_bt_body_32::Joints::ShoulderLeft
@ ShoulderLeft
armarx::human::pose::model::k4a_bt_body_32::Joints::ThumbLeft
@ ThumbLeft
armarx::human::pose::model::k4a_bt_body_32::ModelId
const std::string ModelId
Definition: k4a_bt_body_32.h:34
armarx::human::pose::model::k4a_bt_body_32::Joints::KneeLeft
@ KneeLeft
armarx::human::pose::model::k4a_bt_body_32::Joints::AnkleRight
@ AnkleRight
armarx::human::pose::model::k4a_bt_body_32::Joints::HandtipLeft
@ HandtipLeft
armarx::human::pose::model::k4a_bt_body_32::Joints::HandtipRight
@ HandtipRight
armarx::human::pose::model::k4a_bt_body_32::Joints::Nose
@ Nose
armarx::human::pose::model::k4a_bt_body_32::Joints::ThumbRight
@ ThumbRight
armarx::human::pose::model::k4a_bt_body_32::Joints::ClavicleLeft
@ ClavicleLeft
armarx::human::pose::model::k4a_bt_body_32::Joints::AnkleLeft
@ AnkleLeft
armarx::human::pose::model::k4a_bt_body_32::Colors
const std::map< Joints, simox::Color > Colors
Definition: k4a_bt_body_32.h:148
armarx::human::pose::model::k4a_bt_body_32::Joints::EyeRight
@ EyeRight