28 std::cout <<
"[thread_reader ID:" << std::this_thread::get_id()
29 <<
"] Started." << std::endl;
37 cout <<
"RX: " << buf << endl;
45 var.match([](
auto& pose) { cout <<
"RX pose: " << pose << endl; });
47 var.match([](
auto& pose) { cout <<
"RX pose: " << pose << endl; });
49 printf(
"[thread_reader] Finished.\n");
51 catch (std::exception& e)
53 cerr << e.what() << endl;
61 std::cout <<
"[thread_writer ID:" << std::this_thread::get_id()
62 <<
"] Started." << std::endl;
65 const char* str =
"Hello world!";
66 size_t len = strlen(str);
73 std::variant<mrpt::poses::CPose3D, mrpt::poses::CPose2D> var1(
75 std::variant<mrpt::poses::CPose3D, mrpt::poses::CPose2D> var2(
78 arch.WriteVariant(var1);
79 arch.WriteVariant(var2);
81 printf(
"[thread_writer] Finished.\n");
83 catch (std::exception& e)
85 cerr << e.what() << endl;
95 std::unique_ptr<CPipeReadEndPoint> read_pipe;
96 std::unique_ptr<CPipeWriteEndPoint> write_pipe;
98 CPipe::createPipe(read_pipe, write_pipe);
104 std::this_thread::sleep_for(std::chrono::milliseconds(10));
124 catch (std::exception& e)
126 std::cout <<
"MRPT exception caught: " << e.what() << std::endl;
131 printf(
"Untyped exception!!");