Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake cannot find Pangolin_Viewer_LIB #13

Closed
sumitsarkar1 opened this issue May 17, 2021 · 14 comments
Closed

CMake cannot find Pangolin_Viewer_LIB #13

sumitsarkar1 opened this issue May 17, 2021 · 14 comments

Comments

@sumitsarkar1
Copy link

I get a CMAKE error on catkin_make -DUSE_PANGOLIN_VIEWER=ON -DUSE_SOCKET_PUBLISHER=OFF

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Pangolin_Viewer_LIB
    linked by target "run_slam" in directory /home/vision/catkin_ws/src/openvslam_ros/src
    linked by target "run_localization" in directory /home/vision/catkin_ws/src/openvslam_ros/src

OpenVSLAM standalone is working fine and can find Pangolin easily

@ymd-stella
Copy link
Contributor

Try enabling INSTALL_PANGOLIN_VIEWER when you build OpenVSLAM.

@aravindSolteq
Copy link

Hi .. Tried installing openVSLAM with -DINSTALL_PANGOLIN_VIEWER=ON. But still I get this error.

@sumitsarkar1
Copy link
Author

@aravindSolteq check in /usr/local/lib folder if there is a library of name libpangolin_viewer.so beside libpangolin.so

@aravindSolteq
Copy link

No .. There isnt any pangolin_viewer in /usr/local/lib.

But in that case shoud I give make install after the build process of openvslam. Because i see that pangolin_viewer is part of openvslam build

@sumitsarkar1
Copy link
Author

sumitsarkar1 commented May 20, 2021

I set the -DINSTALL_PANGOLIN_VIEWER=ON with cmake-gui...and did a sudo make install....btw if you are interested in T265 and openvslam in stereo mode let me know (without ros...using images from two folders cam0 and cam1 !!)

@aravindSolteq
Copy link

Yes I would be defenitely interested with t265.

@sumitsarkar1
Copy link
Author

sumitsarkar1 commented May 20, 2021

Its a bit lengthy.....as of now I could not make an efficient way out
1.) Recorded rosbag with T265 using realsense-viewer
2.) Extract images from left and right camera topic
3.) Create a file format like Euroc dataset...

mav0 -------
       cam0 ------
                data------
                data.csv
       cam1 ------
                data------
                data.csv

4.) run ./run_euroc_slam with modification in euroc_util.cc for .jpg images (euroc data sets have png images)

5.) Use the following yaml

# TUM VI stereo rectify model
# https://vision.in.tum.de/data/datasets/visual-inertial-dataset#geometric_calibration
# pinhole (512x512)

#==============#
# Camera Model #
#==============#

Camera:
  name: "TUM VI stereo"
  setup: "stereo"
  model: "perspective"

# new "rectified" matrices is the first three cols of the projection matrix which is calculated with cv::stereoRectify()
# e.g. fx = P1[0][0] or P2[0][0], cx = P1[0][2] or P2[0][2]
#      fy = P1[1][1] or P2[1][1], cy = P1[1][2] or P2[1][2]

  fx: 286.0313273403452
  fy: 286.0313273403452
  cx: 433.5101337432861
  cy: 359.1919784545898

# there is no distortion after stereo rectification

  k1: 0.0
  k2: 0.0
  p1: 0.0
  p2: 0.0
  k3: 0.0

# focal_x_baseline is -P2[0][3] which is calculated with cv::stereoRectify()

  fps: 20
  cols: 848
  rows: 800
  focal_x_baseline: 18.29462953834637

  color_order: "Gray"

#======================#
# Stereo Rectification #
#======================#

# original intrinsic parameters (K, D) and stereo-recitification parameters (R)
# matrices (K, R) are written in row-major order
# StereoRectifier.model is camera model before rectification

StereoRectifier:
  model: "fisheye"
  K_left: [287.2718464782283, 0, 421.6802061361495, 0, 286.7349708003613, 408.4072733533536, 0.0, 0.0, 1.0]
  D_left: [-0.0004225526507139034, 0.02353197313352769, -0.01465424361409354, -0.004361146759936632]
  R_left: [0.999989551609278, -0.002302327711301451, -0.003949171987218714, 0.002297204477402205, 0.9999965146780877, -0.001301339028186153, 0.003952154331989441,0.001292253375716456,0.9999913552413087]
  K_right: [286.0117667306085, 0, 426.9038082772292, 0, 285.3276838803292, 408.0355817749921, 0.0, 0.0, 1.0]
  D_right: [-0.00473629777058725, 0.04889465070319617, -0.0569985387827912, 0.01902634580085258]
  R_right: [0.9999974577371068, -0.001982852800506004, 0.001073691806333321, 0.0019814587692537, 0.9999971946809583, 0.001297864152900881,-0.001076262267855508,-0.001295733377343868,0.9999985813662665]


#================#
# ORB Parameters #
#================#

Feature:
  max_num_keypoints: 1000
  ini_max_num_keypoints: 2000
  scale_factor: 1.2
  num_levels: 8
  ini_fast_threshold: 20
  min_fast_threshold: 7

#====================#
# Mapping Parameters #
#====================#

Mapping:
  baseline_dist_thr: 0.10108726432

#========================#
# Initializer Parameters #
#========================#

Initializer:
  num_min_triangulated_pts: 100

PangolinViewer:
  keyframe_size: 0.07
  keyframe_line_width: 1
  graph_line_width: 1
  point_size: 2
  camera_size: 0.08
  camera_line_width: 3
  viewpoint_x: 0
  viewpoint_y: -0.65
  viewpoint_z: -1.9
  viewpoint_f: 400

@aravindSolteq
Copy link

@sumitsarkar1 : But I have a confusion with this file. Please can you clarify.
In the camera model its given as "perspective" (which i persume is pinhole model). But in stereo rectification, its given as "fisheye".

I calibrated the camera with rtabmap and got three files for t265 fisheye calibration and the model that is given there is "equidistant"

@aravindSolteq
Copy link

Also a build error

 error: no matching function for call to ‘pangolin_viewer::viewer::viewer(const std::shared_ptr<openvslam::config>&, openvslam::system*, const std::shared_ptr<openvslam::publish::frame_publisher>, const std::shared_ptr<openvslam::publish::map_publisher>)’
     pangolin_viewer::viewer viewer(cfg, &SLAM, SLAM.get_frame_publisher(), SLAM.get_map_publisher());

I checked the pangolin_viewer.h file it has only three parameters.. But here it is created an object with 4 parameters.

@sumitsarkar1
Copy link
Author

@sumitsarkar1 : But I have a confusion with this file. Please can you clarify.
In the camera model its given as "perspective" (which i persume is pinhole model). But in stereo rectification, its given as "fisheye".

I calibrated the camera with rtabmap and got three files for t265 fisheye calibration and the model that is given there is "equidistant"

its a perspective or pinhole camera AFTER stereo rectify......Under stereo rectifier goes in the actual model of each camera i.e. fisheye. You can use K_left , D_left and K_right and D_right (I have also used these 4) from RTabmap

@aravindSolteq
Copy link

@sumitsarkar1 : But I have a confusion with this file. Please can you clarify.
In the camera model its given as "perspective" (which i persume is pinhole model). But in stereo rectification, its given as "fisheye".
I calibrated the camera with rtabmap and got three files for t265 fisheye calibration and the model that is given there is "equidistant"

its a perspective or pinhole camera AFTER stereo rectify......Under stereo rectifier goes in the actual model of each camera i.e. fisheye. You can use K_left , D_left and K_right and D_right (I have also used these 4) from RTabmap

Ok .. Thank you for the reply.. I havent used opencv much. So can you help me with where can I find examples of StereoRectify() which I can use directly.
And also how do you compute R_Right and R_Left in stereo rectifier

@sumitsarkar1
Copy link
Author

@mirellameelo
Copy link
Contributor

I checked the pangolin_viewer.h file it has only three parameters.. But here it is created an object with 4 parameters.

@aravindSolteq make sure you're using the proper/suggested Pangolin version. Please, take a look at the installation guide.


5.) Use the following yaml

From this, it is important to mention two things: it is not because the cameras are the same, that the parameters will be equal too. Every camera must be calibrated, or you will have compromised results. Second, if you're using the newest Openvslam version, notice that the accepted .yalm format has changed. (By the way, this is totally out of this topic, maybe you could open a new topic in the "discussion".)

@aravindSolteq
Copy link

@mirellameelo : Thanks for the reply. I raised another issue for the build error and @ymd-stella had fixed that issue and updated the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants