parent
f241a679a9
commit
a10dea9c11
|
@ -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<unsigned char*>(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());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue