Skip to content

Commit 331ee88

Browse files
updates from ros2 port for melodic (#149)
1 parent 42e2e62 commit 331ee88

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

src/spatio_temporal_voxel_grid.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ SpatioTemporalVoxelGrid::~SpatioTemporalVoxelGrid(void)
6565
{
6666
delete _cost_map;
6767
}
68+
69+
if (_grid_points)
70+
{
71+
delete _grid_points;
72+
}
6873
}
6974

7075
/*****************************************************************************/

src/spatio_temporal_voxel_layer.cpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)