Closed wataru-okumura closed 4 months ago
After a little investigation, it seems that color_framequeue.push is not being executed due to color_frame=0 on one of the cameras. Could you please investigate why this is happening?
void OBCameraNode::onNewFrameSetCallback(std::shared_ptr<ob::FrameSet> frame_set) {
if (!is_running_.load()) {
return;
}
if (!is_camera_node_initialized_.load()) {
return;
}
if (frame_set == nullptr) {
return;
}
try {
if (!tf_published_) {
publishStaticTransforms();
tf_published_ = true;
}
depth_frame_ = frame_set->getFrame(OB_FRAME_DEPTH);
auto device_info = device_->getDeviceInfo();
CHECK_NOTNULL(device_info.get());
auto pid = device_info->pid();
auto color_frame = frame_set->getFrame(OB_FRAME_COLOR); // Sometimes color_frame =0
if (isGemini335PID(pid)) {
depth_frame_ = processDepthFrameFilter(depth_frame_);
if (depth_registration_ && align_filter_ && depth_frame_ && color_frame) {
auto new_frame = align_filter_->process(frame_set);
if (new_frame) {
auto new_frame_set = new_frame->as<ob::FrameSet>();
CHECK_NOTNULL(new_frame_set.get());
depth_frame_ = new_frame_set->getFrame(OB_FRAME_DEPTH);
} else {
RCLCPP_ERROR(logger_, "Failed to align depth frame to color frame");
}
} else {
RCLCPP_DEBUG(logger_,
"Depth registration is disabled or align filter is null or depth frame is "
"null or color frame is null");
}
}
if (enable_stream_[COLOR] && color_frame) { // sometimes it does not fall into this condition.
std::unique_lock<std::mutex> lock(color_frame_queue_lock_);
color_frame_queue_.push(frame_set);
color_frame_queue_cv_.notify_all();
} else {
publishPointCloud(frame_set);
}
I suspect that the default usbfs_memory_mb
is too small for multiple cameras. You can try changing it from 16 to 128 by running the following command:
sudo vim /sys/module/usbcore/parameters/usbfs_memory_mb
Then, change the value from 16 to 128 and try again.
I appreciate your comments. I just changed that from 16 to 128 to start, the phenomenon no longer occurs. (0/20 times). Thank you very much for your precise suggestions for improvement.
Thanks again. I have a question about using multiple cameras at the same time.
As per readme.md When I run multi_camera.launch.py, I get the following log To confirm that each node is working properly ros topic echo, it is not possible to receive the topic of one of the cameras. This happens about 50% of the time.
Two cameras: femto bolt. sdk version: v1.5.8
teriminal1
terminal2 unable to receive topic
Note that color/camera_info and color/image_raw fail to echo, and topics such as depth and ir can be obtained.
multi_camera.launch.py
The following is the log of terminal1 during the run.