OpenTracker

An Open Architecture for Reconfigurable Tracking based on XML | Contact

ARTDataTrackerChomp.h

Go to the documentation of this file.
00001 /* ========================================================================
00002  * Copyright (c) 2006,
00003  * Institute for Computer Graphics and Vision
00004  * Graz University of Technology
00005  * All rights reserved.
00006  *
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted provided that the following conditions are
00009  * met:
00010  *
00011  * Redistributions of source code must retain the above copyright notice,
00012  * this list of conditions and the following disclaimer.
00013  *
00014  * Redistributions in binary form must reproduce the above copyright
00015  * notice, this list of conditions and the following disclaimer in the
00016  * documentation and/or other materials provided with the distribution.
00017  *
00018  * Neither the name of the Graz University of Technology nor the names of
00019  * its contributors may be used to endorse or promote products derived from
00020  * this software without specific prior written permission.
00021  *
00022  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
00023  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
00024  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
00025  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
00026  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00027  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00028  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00029  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00030  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00031  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00032  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033  * ========================================================================
00034  * PROJECT: OpenTracker
00035  * ======================================================================== */
00042 /* ======================================================================= */
00043 
00044 #ifndef _ARTDATATRACKERCHOMP_H
00045 #define _ARTDATATRACKERCHOMP_H
00046 
00047 #include <string>
00048 #include <map>
00049 #include "../OpenTracker.h"
00050 
00051 
00052 
00121 #ifndef OT_NO_ARTDATATRACKER_SUPPORT
00122 
00123 
00124 namespace ot {
00125 
00126     class ARTDataTrackerChomp
00127     {   
00128     
00129     public:
00130     
00131     typedef struct BodyRecord       // Structur for the 6d Bodies
00132     {
00133         unsigned long id;           // Body ID taken from the Datagramm
00134         float quality;              // Quality taken from the Datagramm (not used by DTrack in this Version of DTrack)
00135         float location[3];          // Array for the loaction of the Body (s0 s1 s2)
00136         float eulerAngles[3];       // Array for the Eulerangles
00137         float rotationMatrix[9];            // Array for the Rotation Matrix
00138         float orientation[4];       // Array for the Quaternion (calculated by ARTDataTrackerModule) pushed in the Nodetree
00139         bool  valid;            // Flag is true if body is tracked by DTrack
00140     } BodyRecord;
00141     
00142     typedef struct MarkerRecord             // Structur for the 3d Markers
00143     {
00144         unsigned long id;           // Marker ID taken from the Datagramm
00145         float quality;          // Quality taken from the Datagramm (not used by DTrack in this Version of DTrack)
00146         float location[3];          // Array for the loaction of the Body (s0 s1 s2)        
00147         bool  valid;            // Flag is true if body is tracked by DTrack
00148 
00149     } MarkerRecord;
00150 
00151     typedef struct FlystickRecord
00152     {
00153         unsigned long id;
00154         float quality;
00155         unsigned long buttons;
00156         float location[3];
00157         float eulerAngles[3];            // Array for the Eulerangles
00158         float rotationMatrix[9];             // Array for the Rotation Matrix
00159         float orientation[4];        // Array for the Quaternion (calculated by ARTDataTrackerModule) pushed in the Nodetree
00160         bool  valid;                 // Flag is true if body is tracked by DTrack
00161     } FlystickRecord;
00162 
00163     typedef struct MeasuretargetRecord
00164     {       
00165         unsigned long id;
00166         float quality;
00167         unsigned long buttons;
00168         float location[3];
00169         float rotationMatrix[9];             // Array for the Rotation Matrix
00170         float orientation[4];       // Array for the Quaternion (calculated by ARTDataTrackerModule) pushed in the Nodetree
00171         bool  valid;            // Flag is true if body is tracked by DTrack
00172     } MeasuretargetRecord;
00173 
00174     protected:
00175     int frameNumber;
00176     int numberTrackedBodies;
00177     int numberTrackedMarkers;
00178     int numberTrackedFlysticks;
00179     int numberTrackedMeasuretargets;
00180     int numberTrackedCalBodies;
00181 
00182     std::map<int, BodyRecord > tempBodyRecord;
00183     std::map<int, MarkerRecord > tempMarkerRecord;
00184     std::map<int, MeasuretargetRecord > tempMeasuretargetRecord;
00185     std::map<int, FlystickRecord > tempFlystickRecord;
00186 
00187     /* Methods of ARTDataTrackerChomp
00188      *
00189      */
00190 
00191 
00192     public:
00193     ARTDataTrackerChomp();
00194     virtual ~ARTDataTrackerChomp();
00195     virtual void displayRecords();                                 // Display the contens of the RecordArray
00196     virtual void chomp(std::string Datagramm);                     // Main part that chomp the string
00197     virtual int getFrameNumber();                                  // return the framenumber
00198     virtual int getTrackedBodyNumber();                            // return the Number of tracked Bodies
00199     virtual int getCalibratedTrackedBodyNumber();              // return the Number of calibrated & tracked Bodies  
00200     virtual std::map<int, BodyRecord > & getBodyRecord();          // return the BodyRecord
00201     virtual int getTrackedMarkerNumber();                  // return the Number of tracked Markers  
00202     virtual std::map<int, MarkerRecord > & getMarkerRecord();      // return the MarkerRecord
00203     virtual int getTrackedFlystickNumber();                      // return the Number of tracked flysticks
00204     virtual std::map<int, FlystickRecord > & getFlystickRecord();        // return the FlystickRecord
00205     virtual int getTrackedMeasuretargetNumber();                      // return the Number of tracked measurement targets
00206     virtual std::map<int, MeasuretargetRecord > & getMeasuretargetRecord();  // return the MeasuretargetRecord
00207     };
00208 
00209 } // namespace ot
00210 
00211 
00212 #endif // OT_NO_ARTDATATRACKER_SUPPORT
00213 
00214 
00215 #endif
00216 
00217 /* ===========================================================================
00218    End of ARTDataTrackerChomp.h
00219    ===========================================================================
00220    Automatic Emacs configuration follows.
00221    Local Variables:
00222    mode:c++
00223    c-basic-offset: 4
00224    eval: (c-set-offset 'subeventment-open 0)
00225    eval: (c-set-offset 'case-label '+)
00226    eval: (c-set-offset 'eventment 'c-lineup-runin-eventments)
00227    eval: (setq indent-tabs-mode nil)
00228    End:
00229    =========================================================================== */

copyright (c) 2006 Graz University of Technology