Fawkes API  Fawkes Development Version
sick_tim55x_usb_aqt.h
1 
2 /***************************************************************************
3  * sick_tim55x_aqt.h - Thread to retrieve laser data from Sick TiM 55x
4  *
5  * Created: Tue Jun 10 16:47:50 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_USB_AQT_H_
24 #define _PLUGINS_LASER_SICK_TIM55X_USB_AQT_H_
25 
26 #include "sick_tim55x_common_aqt.h"
27 
28 #include <libusb.h>
29 #include <string>
30 
31 namespace fawkes {
32 class Mutex;
33 }
34 
36 {
37 public:
38  SickTiM55xUSBAcquisitionThread(std::string &cfg_name, std::string &cfg_prefix);
39 
40  virtual void init();
41  virtual void finalize();
42  virtual void loop();
43 
44 private:
45  void open_device();
46  void close_device();
47  void flush_device();
48  void send_with_reply(const char *request, std::string *reply = NULL);
49 
50 private:
51  std::string cfg_serial_;
52 
53  libusb_context * usb_ctx_;
54  libusb_device_handle *usb_device_handle_;
55  fawkes::Mutex * usb_mutex_;
56 };
57 
58 #endif
Laser acqusition thread for Sick TiM55x laser range finders.
Laser acqusition thread for Sick TiM55x laser range finders.
virtual void loop()
Code to execute in the thread.
virtual void finalize()
Finalize the thread.
SickTiM55xUSBAcquisitionThread(std::string &cfg_name, std::string &cfg_prefix)
Constructor.
virtual void init()
Initialize the thread.
Mutex mutual exclusion lock.
Definition: mutex.h:33
Fawkes library namespace.