@@ -266,22 +266,23 @@ void SpatioTemporalVoxelLayer::onInitialize(void)
266266 boost::bind (&SpatioTemporalVoxelLayer::PointCloud2Callback, this , _1, \
267267 _observation_buffers.back ()));
268268
269- ros::ServiceServer server;
270- boost::function < bool (std_srvs::SetBool::Request&, \
271- std_srvs::SetBool::Response&) > serv_callback;
272-
273- serv_callback = boost::bind (&SpatioTemporalVoxelLayer::BufferEnablerCallback, \
274- this , _1, _2, _observation_buffers.back (), \
275- _observation_subscribers.back ());
276-
277- std::string topic = source + " /toggle_enabled" ;
278- server = nh.advertiseService (topic, serv_callback);
279-
280- _buffer_enabler_servers.push_back (server);
281269 _observation_subscribers.push_back (sub);
282270 _observation_notifiers.push_back (filter);
283271 }
284272
273+ ros::ServiceServer server;
274+ boost::function < bool (std_srvs::SetBool::Request&, \
275+ std_srvs::SetBool::Response&) > serv_callback;
276+
277+ serv_callback = boost::bind (&SpatioTemporalVoxelLayer::BufferEnablerCallback, \
278+ this , _1, _2, _observation_buffers.back (), \
279+ _observation_subscribers.back ());
280+
281+ std::string topic = source + " /toggle_enabled" ;
282+ server = nh.advertiseService (topic, serv_callback);
283+
284+ _buffer_enabler_servers.push_back (server);
285+
285286 if (sensor_frame != " " )
286287 {
287288 std::vector<std::string> target_frames;
0 commit comments