HandModelV2.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5 *
6 * ArmarX is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ArmarX is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * @package
19 * @author
20 * @date
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24#pragma once
25
26#include <string>
27
28// IVT
30#include "Calibration/Calibration.h"
31#include "Calibration/StereoCalibration.h"
32#include "Math/Math3d.h"
33
34namespace visionx
35{
37 {
38 public:
39 class CFinger
40 {
41 public:
42 CFinger(std::vector<float> aJointOffsets, std::vector<Vec3d> aFingerTipCorners);
43
44 void UpdateJointAngles(std::vector<float> aNewJointValues);
45
46 std::vector<Vec3d>
47 m_aFingerTipCornersInFingerBaseCS; // positions of the fingertip corners in the coordinate system of the finger base
48 std::vector<Vec3d>
49 m_aFingerJointsInFingerBaseCS; // positions of the finger joints in the coordinate system of the finger base
50
51 private:
52 std::vector<float> m_aJointOffsets; // distance from one joint to the next
53 std::vector<float> m_aJointAngles;
54 std::vector<Vec3d>
55 m_aFingerTipCornersInLocalCS; // relative positions of the fingertip corners in the coordinate system after the last joint
56 };
57
58 CHandModelV2(std::string sConfigFileName, CStereoCalibration* pStereoCalibration);
59
60 virtual ~CHandModelV2()
61 {
62 }
63
64 virtual void UpdateHand(double* pConfig);
65 void UpdateHand(Vec3d vHandPosition,
66 Mat3d mHandOrientation,
67 float fPalmJointAngle,
68 std::vector<std::vector<float>>& aFingerJointAngles);
69
70 std::vector<std::vector<Vec3d>> m_aFingerJointsInWorldCS;
71 std::vector<std::vector<Vec3d>> m_aFingerTipCornersInWorldCS;
72
75
76 std::vector<ConvexPolygonCalculations::Polygon> m_aFingerTipPolygonsLeftCam,
78
81
82 protected:
84 {
85 } // for derived classes
86
87 std::string GetNextNonCommentLine(std::ifstream& sFileStream);
88
90
91 CStereoCalibration* m_pStereoCalibration;
92
93 std::vector<CFinger*> m_aFingers; // 0th finger is thumb
94 std::vector<Vec3d>
95 m_aOffsetsToFingers; // 0: from hand base to first thumb joint, rest: from palm joint to first finger joint
97
100 };
101} // namespace visionx
std::vector< Vec3d > m_aFingerJointsInFingerBaseCS
Definition HandModelV2.h:49
std::vector< Vec3d > m_aFingerTipCornersInFingerBaseCS
Definition HandModelV2.h:47
CFinger(std::vector< float > aJointOffsets, std::vector< Vec3d > aFingerTipCorners)
void UpdateJointAngles(std::vector< float > aNewJointValues)
std::vector< ConvexPolygonCalculations::Polygon > m_aFingerTipPolygonsRightCam
Definition HandModelV2.h:77
virtual void UpdateHand(double *pConfig)
std::string GetNextNonCommentLine(std::ifstream &sFileStream)
CStereoCalibration * m_pStereoCalibration
Definition HandModelV2.h:91
std::vector< std::vector< Vec3d > > m_aFingerTipCornersInWorldCS
Definition HandModelV2.h:71
CHandModelV2(std::string sConfigFileName, CStereoCalibration *pStereoCalibration)
std::vector< ConvexPolygonCalculations::Polygon > m_aFingerTipPolygonsLeftCam
Definition HandModelV2.h:76
std::vector< std::vector< Vec3d > > m_aFingerJointsInWorldCS
Definition HandModelV2.h:70
std::vector< CFinger * > m_aFingers
Definition HandModelV2.h:93
float m_fTrackingBallRadiusRightCam
Definition HandModelV2.h:80
std::vector< Vec3d > m_aOffsetsToFingers
Definition HandModelV2.h:95
float m_fTrackingBallRadiusLeftCam
Definition HandModelV2.h:80
ArmarX headers.