Fawkes API  Fawkes Development Version
sick_tim55x_common_aqt.h
1 
2 /***************************************************************************
3  * sick_tim55x_common_aqt.h - Super class of TiM55x drivers
4  *
5  * Created: Sun Jun 15 18:47:08 2014
6  * Copyright 2008-2014 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_SICK_TIM55X_COMMON_AQT_H_
24 #define __PLUGINS_LASER_SICK_TIM55X_COMMON_AQT_H_
25 
26 #include "acquisition_thread.h"
27 
28 #include <string>
29 #include <map>
30 
31 namespace fawkes {
32  class Mutex;
33 }
34 
36 {
37  public:
38  SickTiM55xCommonAcquisitionThread(std::string &cfg_name, std::string &cfg_prefix);
40 
41  // from LaserAcquisitionThread
42  virtual void pre_init(fawkes::Configuration *config, fawkes::Logger *logger);
43 
44  void read_common_config();
45 
46  protected:
47  void init_device();
48  void resync();
49  void parse_datagram(const unsigned char *datagram, size_t datagram_length);
50 
51  virtual void send_with_reply(const char *request, std::string *reply = NULL) = 0;
52  virtual void open_device() = 0;
53  virtual void close_device() = 0;
54  virtual void flush_device() = 0;
55 
56  private:
57  bool pre_init_done_;
58  float cfg_time_offset_;
59 
60  protected:
61  std::string cfg_name_;
62  std::string cfg_prefix_;
63 
64  std::string dev_model_;
65 
66  private:
67  unsigned int expected_num_data_;
68 };
69 
70 
71 #endif
Laser acqusition thread for Sick TiM55x laser range finders.
std::string cfg_name_
Name of the particular configuration instance.
Laser acqusition thread.
Fawkes library namespace.
std::string dev_model_
Device model type as string.
Interface for configuration handling.
Definition: config.h:67
std::string cfg_prefix_
Configuration path prefix for this configuration.
Interface for logging.
Definition: logger.h:34