diff --git a/renderer/cpp/CMakeLists.txt b/renderer/cpp/CMakeLists.txt index 31ab289cf53bc40abd2bd2e6dbe544390b72950e..d5a13f4aae227324680c84e0869f66f36b42a5b3 100644 --- a/renderer/cpp/CMakeLists.txt +++ b/renderer/cpp/CMakeLists.txt @@ -1,22 +1,14 @@ -# Need to include staged files and libs -#include_directories(${PROJECT_SOURCE_DIR}/net/cpp/include) -#include_directories(${PROJECT_BINARY_DIR}) - - add_library(ftlrender src/display.cpp ) -# target_include_directories(ftl-vision PUBLIC ${PCL_INCLUDE_DIRS}) -target_compile_definitions(ftlrender PUBLIC ${PCL_DEFINITIONS}) +target_compile_options(ftlrender PUBLIC ${PCL_DEFINITIONS}) target_include_directories(ftlrender PUBLIC -${PCL_INCLUDE_DIRS} + ${PCL_INCLUDE_DIRS} $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include> PRIVATE src) target_link_libraries(ftlrender Threads::Threads glog::glog ${OpenCV_LIBS} ${PCL_LIBRARIES}) - - #ADD_SUBDIRECTORY(test) diff --git a/renderer/cpp/src/display.cpp b/renderer/cpp/src/display.cpp index 4a57cdcecd7a901d27645980fd2d089514ce94ae..f0893447b3338d8681ba11ec5fdb6005f90d6e1d 100644 --- a/renderer/cpp/src/display.cpp +++ b/renderer/cpp/src/display.cpp @@ -24,6 +24,8 @@ Display::Display(nlohmann::json &config) : config_(config) { pclviz_ = pcl::visualization::PCLVisualizer::Ptr(new pcl::visualization::PCLVisualizer ("FTL Cloud")); pclviz_->setBackgroundColor (255, 255, 255); pclviz_->addCoordinateSystem (1.0); + pclviz_->setShowFPS(true); + pclviz_->initCameraParameters (); #endif // HAVE_PCL active_ = true; @@ -89,10 +91,9 @@ bool Display::render(const cv::Mat &rgb, const cv::Mat &depth) { pcl::visualization::PointCloudColorHandlerRGBField<pcl::PointXYZRGB> rgb(pc); if (!pclviz_->updatePointCloud<pcl::PointXYZRGB> (pc, rgb, "reconstruction")) { pclviz_->addPointCloud<pcl::PointXYZRGB> (pc, rgb, "reconstruction"); - pclviz_->initCameraParameters (); + pclviz_->setCameraPosition(-878.0, -71.0, -2315.0, -0.1, -0.99, 0.068, 0.0, -1.0, 0.0); + pclviz_->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 2, "reconstruction"); } - - pclviz_->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 3, "reconstruction"); #elif defined HAVE_VIZ //cv::Mat Q_32F; //calibrate_.getQ().convertTo(Q_32F, CV_32F);