23 #include <plugins/laser/laser_plugin.h> 25 #include "sensor_thread.h" 27 # include "lase_edl_aqt.h" 33 # include "urg_gbx_aqt.h" 36 # include "sick_tim55x_usb_aqt.h" 38 #ifdef HAVE_SICK55X_BOOST 39 # include "sick_tim55x_ethernet_aqt.h" 60 std::set<std::string> configs;
61 std::set<std::string> ignored_configs;
63 std::string prefix =
"/hardware/laser/";
65 #if __cplusplus >= 201103L 66 std::unique_ptr<Configuration::ValueIterator> i(config->
search(prefix.c_str()));
68 std::auto_ptr<Configuration::ValueIterator> i(config->
search(prefix.c_str()));
71 std::string cfg_name = std::string(i->
path()).substr(prefix.length());
72 cfg_name = cfg_name.substr(0, cfg_name.find(
"/"));
74 if ( (configs.find(cfg_name) == configs.end()) &&
75 (ignored_configs.find(cfg_name) == ignored_configs.end()) ) {
77 std::string cfg_prefix = prefix + cfg_name +
"/";
81 active = config->
get_bool((cfg_prefix +
"active").c_str());
87 std::string type = config->
get_string((cfg_prefix +
"type").c_str());
92 if ( type ==
"urg" ) {
98 if ( type ==
"lase_edl" ) {
104 if ( type ==
"urg_gbx" ) {
110 if ( type ==
"TiM55x-USB" ) {
115 #ifdef HAVE_SICK55X_BOOST 116 if ( type ==
"TiM55x-Ethernet" ) {
122 throw Exception(
"Unknown lasertype '%s' for config %s",
123 type.c_str(), cfg_name.c_str());
129 configs.insert(cfg_name);
132 ignored_configs.insert(cfg_name);
145 throw Exception(
"No laser devices configured, aborting");
151 PLUGIN_DESCRIPTION(
"Hardware driver for laser range finders")
Laser acqusition thread for Lase EDL L A laser scanner.
LaserPlugin(fawkes::Configuration *config)
Constructor.
Fawkes library namespace.
virtual bool get_bool(const char *path)=0
Get value from configuration which is of type bool.
virtual ValueIterator * search(const char *path)=0
Iterator with search results.
virtual bool next()=0
Check if there is another element and advance to this if possible.
Laser acqusition thread for Hokuyo URG laser range finders.
Base class for exceptions in Fawkes.
Laser acqusition thread for Sick TiM55x laser range finders.
ThreadList thread_list
Thread list member.
virtual const char * path() const =0
Path of value.
void push_back(Thread *thread)
Add thread to the end.
Laser acqusition thread for Hokuyo URG laser range finders.
Laser acqusition thread for Sick TiM55x laser range finders.
Interface for configuration handling.
virtual std::string get_string(const char *path)=0
Get value from configuration which is of type string.