From a10dea9c11da3afbb4b00cad1b72f5261580d90b Mon Sep 17 00:00:00 2001 From: Holger Rapp Date: Thu, 16 Nov 2017 16:47:21 +0100 Subject: [PATCH] Follow cartographer. (#600) Follow googlecartographer/cartographer#684. --- .../cartographer_ros/occupancy_grid_node_main.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cartographer_ros/cartographer_ros/occupancy_grid_node_main.cc b/cartographer_ros/cartographer_ros/occupancy_grid_node_main.cc index c589c94..c8eef6a 100644 --- a/cartographer_ros/cartographer_ros/occupancy_grid_node_main.cc +++ b/cartographer_ros/cartographer_ros/occupancy_grid_node_main.cc @@ -141,10 +141,9 @@ void Node::HandleSubmapList( // Properly dealing with a non-common stride would make this code much more // complicated. Let's check that it is not needed. const int expected_stride = 4 * submap_slice.width; - // TODO(jihoonl): Refactor here out to remove kCairoFormat dependency CHECK_EQ(expected_stride, - cairo_format_stride_for_width( - PaintSubmapSlicesResult::kCairoFormat, submap_slice.width)); + cairo_format_stride_for_width(::cartographer::io::kCairoFormat, + submap_slice.width)); submap_slice.cairo_data.clear(); for (size_t i = 0; i < fetched_texture->intensity.size(); ++i) { // We use the red channel to track intensity information. The green @@ -159,7 +158,7 @@ void Node::HandleSubmapList( submap_slice.surface = ::cartographer::io::MakeUniqueCairoSurfacePtr( cairo_image_surface_create_for_data( reinterpret_cast(submap_slice.cairo_data.data()), - PaintSubmapSlicesResult::kCairoFormat, submap_slice.width, + ::cartographer::io::kCairoFormat, submap_slice.width, submap_slice.height, expected_stride)); CHECK_EQ(cairo_surface_status(submap_slice.surface.get()), CAIRO_STATUS_SUCCESS) @@ -182,7 +181,7 @@ void Node::DrawAndPublish(const ::ros::WallTimerEvent& unused_timer_event) { } ::cartographer::common::MutexLocker locker(&mutex_); - auto painted_slices = PaintSubmapSlices(&submap_slices_, resolution_); + auto painted_slices = PaintSubmapSlices(submap_slices_, resolution_); PublishOccupancyGrid(last_frame_id_, last_timestamp_, painted_slices.origin, painted_slices.surface.get()); }