kzampog / cilantro

A lean C++ library for working with point cloud data
MIT License
1.01k stars 206 forks source link

Issues when trying to use cilantro in a different project #70

Closed jacob-02 closed 10 months ago

jacob-02 commented 11 months ago

First of all thank you for this amazing project!

But while I'm trying to use this in a different project I'm facing some errors. I'm a novice in C++ projects and CMake so it's for sure an error from my side.

I have the error below. Screenshot from 2023-08-25 14-58-04

The following is my CMakeLists.txt

cmake_minimum_required(VERSION 3.5)

project(nonros)

find_package(cilantro REQUIRED PATH /home/pseries-001/cilantro/build) find_package(Eigen3 REQUIRED NO_MODULE) find_package(OpenMP) find_package(Pangolin QUIET)

add_executable(test_serial test_serial.cc src/serialib.cpp src/frame_handle.cc src/cJSON.c) add_executable(test test.cc src/serial.cc src/frame_handle.cc src/cJSON.c) add_executable(visualizer visualizer.cpp src/serial.cc src/frame_handle.cc src/cJSON.c)

target_compile_features(test PRIVATE cxx_std_20) target_compile_features(test_serial PRIVATE cxx_std_20) target_include_directories(test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include) target_include_directories(test_serial PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include) target_link_libraries(test cilantro) target_link_libraries(visualizer cilantro eigen pangolin)

kzampog commented 11 months ago

Hmm not quite sure what's going on, but I would suspect that maybe cilantro was built without/before Pangolin. I would try clearing cilantro's build directory and building again (assuming you have already built Pangolin).

jacob-02 commented 11 months ago

Thank you! It works now. Also I was curious to know if there is a way for me to pass 3D (x,y,z) data to this directly and not through a PLY file. I am getting 3D points from a ToF camera and I want to be able to visualise this.

kzampog commented 10 months ago

Currently only PLY I/O is implemented for point clouds!

[In case it would be of interest for this case, there is some image <-> point cloud conversion functionality in the library. There is an example app for this (set up to work with OpenNI cameras using Pangolin's input abstractions).]