@@ -130,6 +130,39 @@ void FeatureSubscriber::fillInput(const MsgType& msg, ImageInputPacket& packet)
130130 }
131131}
132132
133+ void declare_config (NoSemanticImageReceiver::Config& config) {
134+ using namespace config ;
135+ name (" NoSemanticImageReceiver::Config" );
136+ base<RosDataReceiver::Config>(config);
137+ }
138+
139+ NoSemanticImageReceiver::NoSemanticImageReceiver (const Config& config,
140+ const std::string& sensor_name)
141+ : RosDataReceiver(config, sensor_name) {}
142+
143+ bool NoSemanticImageReceiver::initImpl () {
144+ color_sub_ = ColorSubscriber (ianvs::NodeHandle::this_node (ns_));
145+ depth_sub_ = DepthSubscriber (ianvs::NodeHandle::this_node (ns_));
146+ sync_.reset (new Synchronizer (
147+ Policy (config.queue_size ), color_sub_.getFilter (), depth_sub_.getFilter ()));
148+ sync_->registerCallback (&NoSemanticImageReceiver::callback, this );
149+ return true ;
150+ }
151+
152+ void NoSemanticImageReceiver::callback (
153+ const sensor_msgs::msg::Image::ConstSharedPtr& color,
154+ const sensor_msgs::msg::Image::ConstSharedPtr& depth) {
155+ const auto timestamp_ns = rclcpp::Time (color->header .stamp ).nanoseconds ();
156+ if (!checkInputTimestamp (timestamp_ns)) {
157+ return ;
158+ }
159+
160+ auto packet = std::make_shared<ImageInputPacket>(timestamp_ns, sensor_name_);
161+ color_sub_.fillInput (*color, *packet);
162+ depth_sub_.fillInput (*depth, *packet);
163+ queue.push (packet);
164+ }
165+
133166void declare_config (ClosedSetImageReceiver::Config& config) {
134167 using namespace config ;
135168 name (" ClosedSetImageReceiver::Config" );
@@ -152,6 +185,12 @@ OpenSetImageReceiver::OpenSetImageReceiver(const Config& config,
152185
153186namespace {
154187
188+ static const auto no_semantic_registration =
189+ config::RegistrationWithConfig<DataReceiver,
190+ NoSemanticImageReceiver,
191+ NoSemanticImageReceiver::Config,
192+ std::string>(" NoSemanticImageReceiver" );
193+
155194static const auto closed_registration =
156195 config::RegistrationWithConfig<DataReceiver,
157196 ClosedSetImageReceiver,
0 commit comments