Flatsim - local view to png

Hi,

I have been working on flatsim and I am trying to get the updated local map saved as png file periodically.

The channel is “flatsim/navigation.local_map.local_map/isaac.navigation.LocalMap/local_map”

For camera input I can use opencv to save image:

ISAAC_PROTO_RX(ColorCameraProto, input_image);

auto input = rx_input_image().getProto();
ImageConstView3ub input_image;
bool ok = FromProto(input.getImage(), rx_input_image().buffers(), input_image);
ASSERT(ok, “Failed to deserialize the input image”);

const size_t rows = input_image.rows();
const size_t cols = input_image.cols();
Image1ub output_image(rows, cols);
cv::Mat image =
cv::Mat(rows, cols, CV_8UC3,
const_cast<void*>(static_cast<const void*>(input_image.data().pointer())));

I’m stuck with local_map message to image.
appreciate any help !