Skip to content
Snippets Groups Projects
Commit 11dff783 authored by Sebastian Hahta's avatar Sebastian Hahta
Browse files

Merge branch 'master' of gitlab.utu.fi:nicolas.pope/ftl

parents dd452096 3a41e3d7
No related branches found
No related tags found
No related merge requests found
Pipeline #28645 failed
......@@ -371,7 +371,7 @@ include(ftl_paths)
if (WIN32) # TODO(nick) Should do based upon compiler (VS)
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_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O2")
set(OS_LIBS "")
......
......@@ -38,6 +38,8 @@ bool OpenCVEncoder::encode(const cv::cuda::GpuMat &in, ftl::codecs::Packet &pkt)
return false;
}
LOG(WARNING) << "Using Software Encoder!";
in.download(tmp_);
if (!is_colour && in.type() == CV_32F) {
......
......@@ -112,6 +112,8 @@ PylonDevice::PylonDevice(nlohmann::json &config)
rcam_->ExposureTime.SetValue(value("exposure", 24000.0f)); // Exposure time in microseconds
}
});
on("buffer_size", buffer_size_, 1);
}
PylonDevice::~PylonDevice() {
......@@ -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);
}*/
if (rcount == 0 || lcount == 0) {
if (rcount < buffer_size_ || lcount < buffer_size_) {
LOG(WARNING) << "Retrieve failed for L+R";
return false;
}
if (rcount > 1 && lcount > 1) {
if (rcount > buffer_size_ && lcount > buffer_size_) {
LOG(WARNING) << "Pylon buffer latency problem : " << lcount << " vs " << rcount << " frames";
Pylon::CGrabResultPtr tmp_result;
//lcam_->RetrieveResult(0, tmp_result, Pylon::TimeoutHandling_Return);
//rcam_->RetrieveResult(0, tmp_result, Pylon::TimeoutHandling_Return);
_retrieveFrames(tmp_result, lcam_);
_retrieveFrames(tmp_result, rcam_);
} else if (rcount > 1) LOG(ERROR) << "Buffers (R) out of sync by " << rcount;
else if (lcount > 1) LOG(ERROR) << "Buffers (L) out of sync by " << lcount;
} else if (rcount > buffer_size_) LOG(ERROR) << "Buffers (R) out of sync by " << rcount;
else if (lcount > buffer_size_) LOG(ERROR) << "Buffers (L) out of sync by " << lcount;
} else {
if (lcam_->NumReadyBuffers.GetValue() == 0) {
LOG(INFO) << "Retrieve failed for L";
......
......@@ -51,6 +51,7 @@ class PylonDevice : public ftl::rgbd::detail::Device {
std::string serial_;
int left_fail_=0;
int right_fail_=0;
int buffer_size_=1;
cv::cuda::HostMem left_hm_;
cv::cuda::HostMem right_hm_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment