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 <config/change_handler.h>
29
30#include <map>
31#include <string>
32
33namespace fawkes {
34class Mutex;
35}
36
39{
40public:
41 SickTiM55xCommonAcquisitionThread(std::string &cfg_name, std::string &cfg_prefix);
43
44 // from LaserAcquisitionThread
46
47 void read_common_config();
48
49protected:
50 void init_device();
51 void resync();
52 void parse_datagram(const unsigned char *datagram, size_t datagram_length);
53
54 virtual void send_with_reply(const char *request, std::string *reply = NULL) = 0;
55 virtual void open_device() = 0;
56 virtual void close_device() = 0;
57 virtual void flush_device() = 0;
58
59private:
60 virtual void config_tag_changed(const char *new_tag){};
61 virtual void config_comment_changed(const fawkes::Configuration::ValueIterator *v){};
62 virtual void config_value_changed(const fawkes::Configuration::ValueIterator *v);
63 virtual void config_value_erased(const char *path);
64
65private:
66 bool pre_init_done_;
67 float cfg_time_offset_;
68
69protected:
70 std::string cfg_name_;
71 std::string cfg_prefix_;
72
73 std::string dev_model_;
74
75private:
76 unsigned int expected_num_data_;
77};
78
79#endif
Laser acqusition thread.
Laser acqusition thread for Sick TiM55x laser range finders.
SickTiM55xCommonAcquisitionThread(std::string &cfg_name, std::string &cfg_prefix)
Constructor.
void read_common_config()
Read common configuration parameters.
std::string cfg_name_
Name of the particular configuration instance.
virtual void close_device()=0
Close the device.
virtual void open_device()=0
Open the device.
void resync()
Resynchronize to laser data.
std::string cfg_prefix_
Configuration path prefix for this configuration.
virtual void flush_device()=0
Flush the device.
virtual void send_with_reply(const char *request, std::string *reply=NULL)=0
Send a request and expect a reply.
virtual ~SickTiM55xCommonAcquisitionThread()
Destructor.
std::string dev_model_
Device model type as string.
virtual void pre_init(fawkes::Configuration *config, fawkes::Logger *logger)
Pre initialization.
void parse_datagram(const unsigned char *datagram, size_t datagram_length)
Parse incoming message from device.
Configuration * config
This is the Configuration member used to access the configuration.
Definition: configurable.h:41
Interface for configuration change handling.
Iterator interface to iterate over config values.
Definition: config.h:75
Interface for configuration handling.
Definition: config.h:68
Interface for logging.
Definition: logger.h:42
Logger * logger
This is the Logger member used to access the logger.
Definition: logging.h:41
Fawkes library namespace.