30 #include <boost/regex.hpp>
39 std::vector<std::string> devices = getDevices();
41 for (std::vector<std::string>::iterator it = devices.begin(); it != devices.end(); ++it)
45 this->sensors.push_back(sensor);
48 std::cout <<
"Connect Interfaces" << std::endl;
50 for (std::vector<std::shared_ptr<WeissHapticSensor>>::iterator it = sensors.begin();
58 std::vector<std::string>
59 WeissHapticUnit::getDevices()
61 const std::string target_path(
"/dev/");
62 const boost::regex my_filter(
"ttyACM[0-9]+");
64 std::vector<std::string>
files;
66 std::filesystem::directory_iterator end_itr;
68 for (std::filesystem::directory_iterator i(target_path); i != end_itr; ++i)
76 if (!boost::regex_match(i->path().filename().string(), what, my_filter))
83 files.push_back(
"/dev/" + i->path().filename().string());
88 if (
files.size() == 0)
96 for (std::string file :
files)
107 const std::string& tag,
112 if (sensor->getDeviceName() == deviceName)
114 ARMARX_IMPORTANT <<
"scheduling to set new device tag for " << deviceName <<
": "
116 sensor->scheduleSetDeviceTag(
tag);
140 for (std::vector<std::shared_ptr<WeissHapticSensor>>::iterator it = sensors.begin();
145 (*it)->startSampling();
152 for (std::vector<std::shared_ptr<WeissHapticSensor>>::iterator it = sensors.begin();