7 #include <sensor_msgs/image_encodings.hpp>
8 #include <std_msgs/msg/header.hpp>
18 using std::placeholders::_1;
19 using namespace std::chrono_literals;
22 GalaxisNode(
"VCINodeAsync"), m_sharedMemory(
"/galaxis__camera") {
30 log_warning(
"Failed to allocate shared memory. Trying again (",maxTries,
")");
31 std::this_thread::sleep_for(1000ms);
40 log_warning(
"Failed to initialize camera. Trying again (",maxTries,
")");
41 std::this_thread::sleep_for(1000ms);
58 log_warning(
"[ASYNC-VCINODE] camera_publish_loop: Image is nullptr.");
59 std::this_thread::sleep_for(1ms);
64 data.
tv_sec = msg->header.stamp.sec;
65 data.
tv_nsec = msg->header.stamp.nanosec;
66 data.
data = msg->data.data();
73 log(
"[ASYNC-VCINODE] camera_publish_loop: Image published via Shared Memory and ROS2.");
74 log_debug(
"[ASYNC-VCINODE] camera_publish_loop: Timestamp sec.nsec:", msg->header.stamp.sec,
".",msg->header.stamp.nanosec);