Main MRPT website > C++ reference for MRPT 1.9.9
CSkeletonTracker.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #ifndef CSkeletonTracker_H
11 #define CSkeletonTracker_H
12 
14 #include <mrpt/comms/CSerialPort.h>
15 #include <mrpt/poses/CPose3D.h>
18 
19 namespace mrpt
20 {
21 namespace hwdrivers
22 {
23 // clang-format off
24 /** A class for grabbing mrpt::obs::CObservationSkeleton from a PrimeSense
25  *camera.
26  * It connects to a PrimeSense camera and tries to detect users while
27  *recording the positions of their skeletons' joints along time.
28  *
29  * See also the application "rawlog-grabber" for a ready-to-use application to
30  *gather data from this sensor.
31  *
32  * \code
33  * PARAMETERS IN THE ".INI"-LIKE CONFIGURATION STRINGS:
34  * -------------------------------------------------------
35  * [supplied_section_name]
36  * driver = CSkeletonTracker
37  * sensorLabel = <label> ; Label of the sensor
38  * grab_decimation = 1 ; [int] Grab skeletons in 1 out of 'grab_decimation' frames.
39  * show_preview = 1 ; [bool] {0,1} Opens a display window to show the recorded skeleton.
40  * pose_x = 0 ; [double] Sensor 3D position relative to the robot (meters)
41  * pose_y = 0
42  * pose_z = 0
43  * pose_yaw = 0 ; [double] Angles in degrees
44  * pose_pitch = 0
45  * pose_roll = 0
46  *
47  * \endcode
48  * \ingroup mrpt_hwdrivers_grp
49  */ // clang-format on
51 {
52  enum JOINT
53  {
54  HEAD = 0,
70  };
71 
72 #define NUM_JOINTS 15 // number of joints
73 #define NUM_LINES 14 // number of lines joining joints
74 
76  protected:
77  /** Opaque pointers to specific NITE data */
78  void* /* nite::SkeletonState* */ m_skeletons_ptr;
79  void* /* nite::userTracker* */ m_userTracker_ptr;
80 
81  /** Timestamp management */
84 
85  /** Sensor pose */
87  /** Number of detected users */
88  int m_nUsers;
89 
90  /** Preview window management */
93  /** Lines between joints */
94  std::vector<std::pair<JOINT, JOINT>> m_linesToPlot;
95  /** Joint angles when no skeleton has been detected */
96  std::vector<double> m_joint_theta;
97 
98  /** Timeout counter (for internal use only) */
99  unsigned int m_toutCounter;
100 
101  /** See the class documentation at the top for expected parameters */
103  const mrpt::utils::CConfigFileBase& configSource,
104  const std::string& iniSection);
105 
106  /** Displays real-time info for the captured skeleton */
108  void processPreviewNone();
109 
110  public:
111  /** Constructor
112  */
114 
115  /** Destructor
116  */
117  virtual ~CSkeletonTracker();
118 
119  /** This method will be invoked at a minimum rate of "process_rate" (Hz)
120  * \exception This method must throw an exception with a descriptive
121  * message if some critical error is found.
122  */
123  void doProcess();
124 
125  /** Connects to the PrimeSense camera and prepares it to get skeleton data
126  */
127  void initialize();
128 
129  /** Set/unset preview */
130  inline void setPreview(const bool setPreview = true)
131  {
133  }
134 }; // end of class
135 
136 } // end of namespace
137 } // end of namespace
138 
139 #endif
A generic interface for a wide-variety of sensors designed to be used in the application RawLogGrabbe...
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...
Definition: datetime.h:32
void doProcess()
This method will be invoked at a minimum rate of "process_rate" (Hz)
void * m_skeletons_ptr
Opaque pointers to specific NITE data.
virtual ~CSkeletonTracker()
Destructor.
mrpt::system::TTimeStamp m_timeStartTT
void loadConfig_sensorSpecific(const mrpt::utils::CConfigFileBase &configSource, const std::string &iniSection)
See the class documentation at the top for expected parameters.
unsigned int m_toutCounter
Timeout counter (for internal use only)
std::shared_ptr< CObservationSkeleton > Ptr
int m_nUsers
Number of detected users.
This class allows loading and storing values and vectors of different types from a configuration text...
mrpt::poses::CPose3D m_sensorPose
Sensor pose.
void processPreview(const mrpt::obs::CObservationSkeleton::Ptr &obs)
Displays real-time info for the captured skeleton.
A class for grabbing mrpt::obs::CObservationSkeleton from a PrimeSense camera.
void initialize()
Connects to the PrimeSense camera and prepares it to get skeleton data.
std::shared_ptr< CDisplayWindow3D > Ptr
std::vector< std::pair< JOINT, JOINT > > m_linesToPlot
Lines between joints.
GLsizei const GLchar ** string
Definition: glext.h:4101
#define DEFINE_GENERIC_SENSOR(class_name)
This declaration must be inserted in all CGenericSensor classes definition, within the class declarat...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
bool m_showPreview
Preview window management.
void setPreview(const bool setPreview=true)
Set/unset preview.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
unsigned __int32 uint32_t
Definition: rptypes.h:47
uint32_t m_timeStartUI
Timestamp management.
mrpt::gui::CDisplayWindow3D::Ptr m_win
std::vector< double > m_joint_theta
Joint angles when no skeleton has been detected.



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019