include/tracker_impl.h
Go to the documentation of this file.
1 
18 #ifndef TRACKER_H
19 #define TRACKER_H
20 
21 //MACROS
22 #define DIEonERR(value) if (value<0) { \
23  fprintf(stderr,"%i DIED in %s line %i with error %i\n",getpid(),__FILE__,__LINE__,-value);exit(1); }
24 
25 /* system includes */
26 #include <string>
27 
28 /* my includes */
29 #include "ros/ros.h"
30 #include <geometry_msgs/Pose.h>
32 #include <asr_msgs/AsrObject.h>
33 
34 #include "transform_coords.h"
35 
37 
38 //for reference purposes: the old data structure
39 /*
40  // Definition of a calibration data set
41  struct fulcrum{
42  double sensorVal[3];
43  double sensorAngle[3];
44  double worldVal[3];
45  double worldAngle[3];
46  };
47  //typedef sequence<fulcrum> oneSensorCal;
48  typedef sequence<fulcrum> allSensorCal;
49 */
50 
52  public:
53  tracker_impl(trackerID t, BirdTrack_impl* b, std::string trackerName);
54  ~tracker_impl();
55 
56  void start();
57  void stop();
58 
59  bool loadCalibFile(const char *srcFileName);
60 
61 
62 private:
66  unsigned int seqId;
67 
68  struct fulcrum{
69  double sensorVal[3];
70  double sensorAngle[3];
71  double worldVal[3];
72  double worldAngle[3];
73  };
74 
76  void workerThread();
79  bool writeNotification(trackerID id, double* raw, double *calibrated);
80 
82  pthread_t workerThreadHandle;
84  static void *s_workerThread(void* arg);
85 
86  void printFulcrum(fulcrum fulc);
87 
88  bool loadCalibration(const fulcrum cal[255], unsigned int length);
89 
90  void getPbdObject(std::string name, double *data, asr_msgs::AsrObject &object);
91  void getTransform(double *data, tf::Transform &transform);
92 
96 };
97 
98 #endif /* TRACKER_H */
ros::NodeHandle node
void getPbdObject(std::string name, double *data, asr_msgs::AsrObject &object)
bool threadRunning
flag switching on/off thread
void getTransform(double *data, tf::Transform &transform)
void workerThread()
this method is called by static method s_workerthread
static void * s_workerThread(void *arg)
Thread is bound to this method.
bool loadCalibration(const fulcrum cal[255], unsigned int length)
tf::TransformBroadcaster transformPublisher
bool loadCalibFile(const char *srcFileName)
tracker_impl(trackerID t, BirdTrack_impl *b, std::string trackerName)
unsigned int seqId
pthread_t workerThreadHandle
Thread for delivering tracker data to nCenter.
bool writeNotification(trackerID id, double *raw, double *calibrated)
BirdTrack_impl * myBird
ros::Publisher generalPublisher
bool calibrated
transformCoords * myTransformer


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 Mon Jun 10 2019 12:44:40