tracker_impl.h
Go to the documentation of this file.
00001 
00018 #ifndef TRACKER_H
00019 #define TRACKER_H
00020 
00021 //MACROS
00022 #define DIEonERR(value) if (value<0) { \
00023  fprintf(stderr,"%i DIED in %s line %i with error %i\n",getpid(),__FILE__,__LINE__,-value);exit(1); }
00024 
00025 /* system includes */
00026 #include <string>
00027 
00028 /* my includes */
00029 #include "transformCoords.h"
00030 //KOGMO_RTDB standard includes
00031 #define KOGMO_RTDB_DONT_INCLUDE_ALL_OBJECTS
00032 #include "kogmo_rtdb.h"
00033 #include "kogmo_rtdb_obj_typeids.h"
00034 //KOGMO_RTDB special includes for our project with the id E1
00035 #include "itec/kogmo_rtdb_obj_e1_itec.h"
00036 using namespace KogniMobil;
00037 
00038 
00039 typedef enum{rightTracker=1, leftTracker}trackerID;
00040 
00041 //for reference purposes: the old data structure
00042 /*
00043     // Definition of a calibration data set
00044   struct fulcrum{
00045     double sensorVal[3];
00046     double sensorAngle[3];
00047         double worldVal[3];
00048         double worldAngle[3];
00049   };
00050   //typedef sequence<fulcrum> oneSensorCal;
00051   typedef sequence<fulcrum> allSensorCal;
00052 */
00053 
00054 class tracker_impl{
00055  public:
00056   tracker_impl(trackerID t, BirdTrack_impl* b, std::string trackerName);
00057   ~tracker_impl();
00058 
00059   void start();
00060   void stop();
00061   
00062   bool loadCalibFile(const char *srcFileName);
00063 
00064 
00065 private:
00066   trackerID myID;
00067   BirdTrack_impl* myBird;
00068   transformCoords* myTransformer;
00069   struct fulcrum{
00070     double sensorVal[3];
00071     double sensorAngle[3];
00072     double worldVal[3];
00073     double worldAngle[3];
00074   };
00075  /* variables that handle the database connection */
00076  kogmo_rtdb_handle_t *dbc; /*< the database connection handle */
00077  kogmo_rtdb_connect_info_t dbinfo; /*< information about the database connection */
00078 
00079  kogmo_rtdb_obj_info_t dataobj_info_data; /*< information about the type of the dataobject, for calibrated data */
00080  kogmo_rtdb_obj_info_t dataobj_info_raw; /*< information about the type of the dataobject, for raw data */
00081  
00082  kogmo_rtdb_obj_e1_fobtracker_t *dataobj_data; /*< the dataobject specific to the sensor */
00083  kogmo_rtdb_obj_e1_fobtracker_t *dataobj_raw; /*< the dataobject specific to the sensor */
00084 
00085  kogmo_rtdb_objid_t oid; /*< some id */
00086  kogmo_rtdb_objid_t pid; /*< another id */
00087   
00089   void workerThread();
00091   bool threadRunning;
00092   bool writeNotification(kogmo_rtdb_obj_info_t &dataobj_info, double*);
00093 
00095   pthread_t workerThreadHandle;
00097   static void *s_workerThread(void* arg);
00098 
00099   void printFulcrum(fulcrum fulc);
00100 
00101   bool loadCalibration(const fulcrum cal[255], unsigned int length);
00102   
00103 };
00104 
00105 #endif /* TRACKER_H */


asr_flock_of_birds
Author(s): Bernhardt Andre, Engelmann Stephan, Giesler Björn, Heller Florian, Jäkel Rainer, Nguyen Trung, Pardowitz Michael, Weckesser Peter, Yi Xie, Zöllner Raoul
autogenerated on Sat Jun 8 2019 19:36:21