1 #include <nodelet/nodelet.h>
2 #include <nodelet/detail/callback_queue.h>
4 #include <pluginlib/class_list_macros.hpp>
6 #include <ros/node_handle.h>
7 #include <ros/console.h>
35 message_filters::Synchronizer<RGBDApproxPolicy>*
getSync()
54 ros::NodeHandle nh = getNodeHandle();
55 ros::NodeHandle nh_private = getPrivateNodeHandle();
62 nh_private.getParam(
"rgb_storage", rgb_type_str);
63 if (rgb_type_str ==
"none")
65 else if (rgb_type_str ==
"lossless")
67 else if (rgb_type_str ==
"jpg")
71 ROS_ERROR(
"Unknown 'rgb_storage' type: should be 'none', 'lossless', or 'jpg'.");
80 nh_private.getParam(
"depth_storage", depth_type_str);
81 if (depth_type_str ==
"none")
83 else if (depth_type_str ==
"lossless")
85 else if (depth_type_str ==
"png")
89 ROS_ERROR(
"Unknown 'depth_storage' type: should be 'none', 'lossless', or 'png'.");
93 client_ = std::make_unique<rgbd::ClientRosNodelet>(nh);
94 client_->initialize(
"rgb_image",
"depth_image",
"cam_info");
96 server_ = std::make_unique<rgbd::Server>(nh);
97 server_->initialize(ros::names::resolve(
"rgbd"), rgb_type, depth_type);
104 if (!
client_->imageCallback(rgb_image_msg, depth_image_msg))
106 ROS_ERROR(
"Error during processing the image callback. See log above.");