23 #include "yaml-cpp/yaml.h"
25 int main(
int argc,
char** argv)
31 if (hand_serial_to_port_map.empty())
33 std::cout <<
"No hand detected on any of the ports!" << std::endl;
36 YAML::Node hand_serial_to_port_map_yaml;
37 for (
auto const& serial_to_port : hand_serial_to_port_map)
39 std::cout <<
"Detected hand on port: " << serial_to_port.second << std::endl;
40 std::cout <<
"Hand's serial number: " << serial_to_port.first << std::endl;
41 hand_serial_to_port_map_yaml[serial_to_port.first] = serial_to_port.second;
44 std::ofstream fout(
"/tmp/sr_hand_detector.yaml");
45 fout << hand_serial_to_port_map_yaml;