IntelRealSense / librealsense

Intel® RealSense™ SDK
https://www.intelrealsense.com/
Apache License 2.0
7.63k stars 4.83k forks source link

The question about the pose-apriltag example with T265 #8322

Open SimonOuyang7386 opened 3 years ago

SimonOuyang7386 commented 3 years ago

Required Info
Camera Model T265
Firmware Version 0.2.0.951
Operating System & Version Linux (Ubuntu 18.04.5 LTS)
Kernel Version (Linux Only) 5.4.0-65
Platform PC
SDK Version 2.41.0
Language C++
Segment Robot

Issue Description

In "Installing Apriltag library in a local directory" step, I unpack the github file in "~/apriltag" and create a new folder "apriltag-3.1.1" in "~/apriltag" , then I create another folder "apriltag-build" in "~/apriltag", I done the "cmake" and "make install" in "apriltag-build", but when I move on, it tells me to run the command "cmake -DCMAKE_PREFIX_PATH=~/apriltag", I do not know the "" means, so can anyone tell me what is the "" means and I should run this command in which folder, thanks. Screenshot 2021-02-06 19_08_03

RaphyStark commented 2 years ago

When you cmake librealsense, you have to mkdir a build directory in the librealsense directory. Move in librealsense/build and : $ cmake ../ -DCMAKE_PREFIX_PATH=~/apriltag To tell cmake the path to librealsense directory.

In my case, it doesn't work. When I try : root@4f8b0335d5f8:/librealsense/examples/pose-apriltag# g++ -o rs-pose-apriltag rs-pose-apriltag.cpp It says : `rs-pose-apriltag.cpp:12:22: fatal error: apriltag.h: No such file or directory

include "apriltag.h"

                  ^

compilation terminated. `

EDIT : it is not necessary to compile it since it is already done. I use this cmake : $ cmake ../ -DCMAKE_PREFIX_PATH=~/apriltag -DCMAKE_BUILD_TYPE=release -DFORCE_RSUSB_BACKEND=true -DBUILD_EXAMPLES=true Just run the command, like : root@4f8b0335d5f8:/# rs-pose-apriltag It is working for me with all the librealsense examples.

EDIT 2 : if you want to compile your own code using librealsense, apriltag and probably other libraries, you have to use cmake.