parent
f241a679a9
commit
a10dea9c11
|
@ -141,10 +141,9 @@ void Node::HandleSubmapList(
|
||||||
// Properly dealing with a non-common stride would make this code much more
|
// Properly dealing with a non-common stride would make this code much more
|
||||||
// complicated. Let's check that it is not needed.
|
// complicated. Let's check that it is not needed.
|
||||||
const int expected_stride = 4 * submap_slice.width;
|
const int expected_stride = 4 * submap_slice.width;
|
||||||
// TODO(jihoonl): Refactor here out to remove kCairoFormat dependency
|
|
||||||
CHECK_EQ(expected_stride,
|
CHECK_EQ(expected_stride,
|
||||||
cairo_format_stride_for_width(
|
cairo_format_stride_for_width(::cartographer::io::kCairoFormat,
|
||||||
PaintSubmapSlicesResult::kCairoFormat, submap_slice.width));
|
submap_slice.width));
|
||||||
submap_slice.cairo_data.clear();
|
submap_slice.cairo_data.clear();
|
||||||
for (size_t i = 0; i < fetched_texture->intensity.size(); ++i) {
|
for (size_t i = 0; i < fetched_texture->intensity.size(); ++i) {
|
||||||
// We use the red channel to track intensity information. The green
|
// We use the red channel to track intensity information. The green
|
||||||
|
@ -159,7 +158,7 @@ void Node::HandleSubmapList(
|
||||||
submap_slice.surface = ::cartographer::io::MakeUniqueCairoSurfacePtr(
|
submap_slice.surface = ::cartographer::io::MakeUniqueCairoSurfacePtr(
|
||||||
cairo_image_surface_create_for_data(
|
cairo_image_surface_create_for_data(
|
||||||
reinterpret_cast<unsigned char*>(submap_slice.cairo_data.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));
|
submap_slice.height, expected_stride));
|
||||||
CHECK_EQ(cairo_surface_status(submap_slice.surface.get()),
|
CHECK_EQ(cairo_surface_status(submap_slice.surface.get()),
|
||||||
CAIRO_STATUS_SUCCESS)
|
CAIRO_STATUS_SUCCESS)
|
||||||
|
@ -182,7 +181,7 @@ void Node::DrawAndPublish(const ::ros::WallTimerEvent& unused_timer_event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
::cartographer::common::MutexLocker locker(&mutex_);
|
::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,
|
PublishOccupancyGrid(last_frame_id_, last_timestamp_, painted_slices.origin,
|
||||||
painted_slices.surface.get());
|
painted_slices.surface.get());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue