ConfigureBodyTracking.cpp
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 * @package VisionX::AzureKinectGroup
17 * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
18 * @date 2023
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
24
25//#include <ArmarXCore/core/time/TimeUtil.h>
26//#include <ArmarXCore/observers/variant/DatafieldRef.h>
27
29{
30 // DO NOT EDIT NEXT LINE
31 ConfigureBodyTracking::SubClassRegistry
32 ConfigureBodyTracking::Registry(ConfigureBodyTracking::GetName(),
34
35 void
37 {
38 // put your user code for the enter-point here
39 // execution time should be short (<100ms)
40 }
41
42 void
44 {
45 std::stringstream warn;
46
47 AzureKinectPointCloudProviderInterfacePrx ak = getAzureKinectPointCloudProvider();
48
49 if (in.isMaxDepthInMillimetersSet())
50 {
51 ak->setMaxDepthBodyTracking(in.getMaxDepthInMillimeters());
52 }
53
54 const bool isMinSet = in.isWidthMinPixelSet();
55 const bool isMaxSet = in.isWidthMinPixelSet();
56 if (isMinSet and isMaxSet)
57 {
58 ak->setWidthBodyTracking(in.getWidthMinPixel(), in.getWidthMaxPixel());
59 }
60 else if (isMinSet != isMaxSet)
61 {
62 if (isMinSet and not isMaxSet)
63 {
64 warn << "WidthMinPixel is set, but WidthMaxPixel is not.";
65 }
66 else
67 {
68 ARMARX_CHECK(not isMinSet);
69 ARMARX_CHECK(isMaxSet);
70 warn << "WidthMaxPixel is set, but WidthMinPixel is not.";
71 }
72 warn << "\nThese parameters only have an effect if set together.";
73 }
74
75 if (not warn.str().empty())
76 {
77 ARMARX_WARNING << warn.str();
78 }
79
80 emitSuccess();
81 }
82
83 //void ConfigureBodyTracking::onBreak()
84 //{
85 // // put your user code for the breaking point here
86 // // execution time should be short (<100ms)
87 //}
88
89 void
91 {
92 // put your user code for the exit point here
93 // execution time should be short (<100ms)
94 }
95
96 // DO NOT EDIT NEXT FUNCTION
102} // namespace armarx::AzureKinectGroup
ConfigureBodyTracking(const XMLStateConstructorParams &stateData)
static XMLStateFactoryBasePtr CreateInstance(XMLStateConstructorParams stateData)
#define ARMARX_CHECK(expression)
Shortcut for ARMARX_CHECK_EXPRESSION.
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
Definition Logging.h:193
IceInternal::Handle< XMLStateFactoryBase > XMLStateFactoryBasePtr
Definition XMLState.h:64