-
The error occured when publishing images in the type of 'uint8_t [rows][cols]' in a topic. (Sometimes it might succeed while the warning information still existed but mostly it failed.)
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
@GeYapeng There seems to be two problems, the roudi is running out of chunks since there are too many samples in use and the publisher does not handle the case when roudi is unable to provide samples. When roudi is running out of chunks
publisher.loan()
.and_then([&](auto& pub_data) {
extern cv::Mat img; // This is the img to publish.
if (!img.empty()) {
for (int i = 0; i < ROWS; i++) {
for (int j = 0; j < COLS; j++) {
pub_data->pub_img[i][j] = img.at<uint8_t>(i, j);
}
}
}
})
.or_else([](auto) {
std::cout << "Mempool is running out of chunks" << std::endl;
}); Here you can find further use cases on how to publish samples: https://github.com/eclipse-iceoryx/iceoryx/blob/master/iceoryx_examples/icedelivery/iox_publisher.cpp If you prefer the classical
I think you can reuse the existing mempool configuration and just increase the number of chunks for the sample size 524328 to 100. This is what in the end the error message states right before the application crashed with a segmentation fault:
Here is our default mempool config with the adjusted sample size, just follow the configuration guide and use it.
|
Beta Was this translation helpful? Give feedback.
@GeYapeng There seems to be two problems, the roudi is running out of chunks since there are too many samples in use and the publisher does not handle the case when roudi is unable to provide samples. When roudi is running out of chunks
publisher.loan()
will return an invalid sample since there aren't any left and this case seems to be not covered.