Skip to content
Snippets Groups Projects
Commit 82ca8495 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Windows AVX2 and pylon buffer latency

parent 2b3b4893
No related branches found
No related tags found
No related merge requests found
Pipeline #28643 passed
...@@ -371,7 +371,7 @@ include(ftl_paths) ...@@ -371,7 +371,7 @@ include(ftl_paths)
if (WIN32) # TODO(nick) Should do based upon compiler (VS) if (WIN32) # TODO(nick) Should do based upon compiler (VS)
add_definitions(-DWIN32) add_definitions(-DWIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX512 /MP4 /std:c++17 /wd4996") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX2 /MP4 /std:c++17 /wd4996")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /DFTL_DEBUG /Wall") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /DFTL_DEBUG /Wall")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O2") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O2")
set(OS_LIBS "") set(OS_LIBS "")
......
...@@ -112,6 +112,8 @@ PylonDevice::PylonDevice(nlohmann::json &config) ...@@ -112,6 +112,8 @@ PylonDevice::PylonDevice(nlohmann::json &config)
rcam_->ExposureTime.SetValue(value("exposure", 24000.0f)); // Exposure time in microseconds rcam_->ExposureTime.SetValue(value("exposure", 24000.0f)); // Exposure time in microseconds
} }
}); });
on("buffer_size", buffer_size_, 1);
} }
PylonDevice::~PylonDevice() { PylonDevice::~PylonDevice() {
...@@ -250,20 +252,20 @@ bool PylonDevice::get(ftl::rgbd::Frame &frame, cv::cuda::GpuMat &l_out, cv::cuda ...@@ -250,20 +252,20 @@ bool PylonDevice::get(ftl::rgbd::Frame &frame, cv::cuda::GpuMat &l_out, cv::cuda
rcam_->RetrieveResult(0, tmp_result, Pylon::TimeoutHandling_Return); rcam_->RetrieveResult(0, tmp_result, Pylon::TimeoutHandling_Return);
}*/ }*/
if (rcount == 0 || lcount == 0) { if (rcount < buffer_size_ || lcount < buffer_size_) {
LOG(WARNING) << "Retrieve failed for L+R"; LOG(WARNING) << "Retrieve failed for L+R";
return false; return false;
} }
if (rcount > 1 && lcount > 1) { if (rcount > buffer_size_ && lcount > buffer_size_) {
LOG(WARNING) << "Pylon buffer latency problem : " << lcount << " vs " << rcount << " frames"; LOG(WARNING) << "Pylon buffer latency problem : " << lcount << " vs " << rcount << " frames";
Pylon::CGrabResultPtr tmp_result; Pylon::CGrabResultPtr tmp_result;
//lcam_->RetrieveResult(0, tmp_result, Pylon::TimeoutHandling_Return); //lcam_->RetrieveResult(0, tmp_result, Pylon::TimeoutHandling_Return);
//rcam_->RetrieveResult(0, tmp_result, Pylon::TimeoutHandling_Return); //rcam_->RetrieveResult(0, tmp_result, Pylon::TimeoutHandling_Return);
_retrieveFrames(tmp_result, lcam_); _retrieveFrames(tmp_result, lcam_);
_retrieveFrames(tmp_result, rcam_); _retrieveFrames(tmp_result, rcam_);
} else if (rcount > 1) LOG(ERROR) << "Buffers (R) out of sync by " << rcount; } else if (rcount > buffer_size_) LOG(ERROR) << "Buffers (R) out of sync by " << rcount;
else if (lcount > 1) LOG(ERROR) << "Buffers (L) out of sync by " << lcount; else if (lcount > buffer_size_) LOG(ERROR) << "Buffers (L) out of sync by " << lcount;
} else { } else {
if (lcam_->NumReadyBuffers.GetValue() == 0) { if (lcam_->NumReadyBuffers.GetValue() == 0) {
LOG(INFO) << "Retrieve failed for L"; LOG(INFO) << "Retrieve failed for L";
......
...@@ -51,6 +51,7 @@ class PylonDevice : public ftl::rgbd::detail::Device { ...@@ -51,6 +51,7 @@ class PylonDevice : public ftl::rgbd::detail::Device {
std::string serial_; std::string serial_;
int left_fail_=0; int left_fail_=0;
int right_fail_=0; int right_fail_=0;
int buffer_size_=1;
cv::cuda::HostMem left_hm_; cv::cuda::HostMem left_hm_;
cv::cuda::HostMem right_hm_; cv::cuda::HostMem right_hm_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment