23 #include "pantilt_plugin.h"
24 #include "robotis/rx28_thread.h"
25 #include "sony/evid100p_thread.h"
26 #include "dirperc/dp_thread.h"
27 #include "sensor_thread.h"
31 using namespace fawkes;
45 std::set<std::string> ptus;
46 std::set<std::string> ignored_ptus;
48 std::string prefix =
"/hardware/pantilt/";
49 std::string ptus_prefix = prefix +
"ptus/";
55 std::string ptu = std::string(i->
path()).substr(ptus_prefix.length());
56 ptu = ptu.substr(0, ptu.find(
"/"));
58 if ( (ptus.find(ptu) == ptus.end()) &&
59 (ignored_ptus.find(ptu) == ignored_ptus.end()) ) {
61 std::string ptu_prefix = ptus_prefix + ptu +
"/";
65 active = config->
get_bool((ptu_prefix +
"active").c_str());
70 std::string type = config->
get_string((ptu_prefix +
"type").c_str());
75 }
else if (type ==
"EviD100P") {
77 }
else if (type ==
"DirPercASCII") {
80 throw Exception(
"Unknown PTU type %s", type.c_str());
88 ignored_ptus.insert(ptu);
95 throw Exception(
"No synchronization peers configured, aborting");
102 PLUGIN_DESCRIPTION(
"Use pan/tilt units with Fawkes.")