Fawkes API  Fawkes Development Version
urg_aqt.h
1 
2 /***************************************************************************
3  * urg_aqt.h - Thread to retrieve laser data from Hokuyo URG
4  *
5  * Created: Sat Nov 28 01:29:48 2009
6  * Copyright 2008-2011 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #ifndef _PLUGINS_LASER_URG_AQT_H_
24 #define _PLUGINS_LASER_URG_AQT_H_
25 
26 #include "acquisition_thread.h"
27 
28 #include <map>
29 #include <string>
30 
31 namespace qrk {
32 class UrgCtrl;
33 }
34 
35 namespace fawkes {
36 class TimeWait;
37 }
38 
40 {
41 public:
42  HokuyoUrgAcquisitionThread(std::string &cfg_name, std::string &cfg_prefix);
43 
44  // from LaserAcquisitionThread
46 
47  virtual void init();
48  virtual void finalize();
49  virtual void loop();
50 
51 private:
52  std::map<std::string, std::string> get_device_info(qrk::UrgCtrl *ctrl);
53 
54 private:
55  bool pre_init_done_;
56  unsigned int number_of_values_;
57  qrk::UrgCtrl *ctrl_;
58  int fd_;
59 
60  fawkes::TimeWait *timer_;
61 
62  std::string cfg_name_;
63  std::string cfg_prefix_;
64 
65  std::map<std::string, std::string> device_info_;
66 
67  std::string cfg_device_;
68  std::string cfg_serial_;
69  float cfg_time_offset_;
70 
71  unsigned int first_ray_;
72  unsigned int last_ray_;
73  unsigned int front_ray_;
74  unsigned int slit_division_;
75  float step_per_angle_;
76  float angle_per_step_;
77  float angular_range_;
78  long int scan_msec_;
79 };
80 
81 #endif
HokuyoUrgAcquisitionThread::HokuyoUrgAcquisitionThread
HokuyoUrgAcquisitionThread(std::string &cfg_name, std::string &cfg_prefix)
Constructor.
Definition: urg_aqt.cpp:63
HokuyoUrgAcquisitionThread::init
virtual void init()
Initialize the thread.
Definition: urg_aqt.cpp:85
LaserAcquisitionThread
Definition: acquisition_thread.h:37
fawkes::Configuration
Definition: config.h:68
fawkes::LoggingAspect::logger
Logger * logger
Definition: logging.h:50
fawkes::Logger
Definition: logger.h:40
fawkes
fawkes::ConfigurableAspect::config
Configuration * config
Definition: configurable.h:50
HokuyoUrgAcquisitionThread::loop
virtual void loop()
Code to execute in the thread.
Definition: urg_aqt.cpp:313
fawkes::TimeWait
Definition: wait.h:36
HokuyoUrgAcquisitionThread::pre_init
virtual void pre_init(fawkes::Configuration *config, fawkes::Logger *logger)
Definition: urg_aqt.cpp:74
HokuyoUrgAcquisitionThread::finalize
virtual void finalize()
Finalize the thread.
Definition: urg_aqt.cpp:297
HokuyoUrgAcquisitionThread
Definition: urg_aqt.h:38