-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
example: T265 apriltag detection on host #4340
example: T265 apriltag detection on host #4340
Conversation
cb2714f
to
438bedd
Compare
add apriltag lib dependency notice.
if(frame_number % 4 == 0) | ||
{ | ||
fisheye_frame.keep(); | ||
std::async(std::launch::async, [img=fisheye_frame,fn=frame_number,pose=camera_pose,&tag_manager](){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initialization in lambda captures is a C++14 feature. You may need to stick to C++11 unless it is ok for libRealSense to change the standard in a single sample.
If the latter, set_target_properties(rs-pose-apriltag PROPERTIES CXX_STANDARD 14)
has to be added to cmake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated to use std::bind()
} | ||
A[col*9 + 8] = (A[col*9 + 8] - sum)/A[col*9 + col]; | ||
} | ||
return matd_create_data(3, 3, (double[]) { A[8], A[17], A[26], A[35], A[44], A[53], A[62], A[71], 1 }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
g++ complains here about taking the address of a temporary array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated to direct memory assignement
find_path(APRILTAG_INC NAMES apriltag.h PATH_SUFFIXES apriltag) | ||
find_library(APRILTAG_LIB apriltag) | ||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(apriltag DEFAULT_MSG APRILTAG_INC APRILTAG_LIB) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my setup, I installed the apriltag
library in a custom directory. The only way of making it work was to set APRILTAG_INC=mypath/install/include/apriltag
and APRILTAG_LIB=mypath/install/lib/libapriltag.so
in cmake. Note that I had to specify the inner subdirectory in include/apriltag
and the library file libapriltag.so
. Setting CMAKE_PREFIX_PATH
didn't help, or I didn't do it correctly.
Is this behavior expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dorian3d, CMAKE_PREFIX_PATH
should work. Make sure to kill your build directory if you forgot to set CMAKE_PREFIX_PATH
the first time, or run cmake -UAPRILTAG_INC -UAPRILTAG_LIB .
to force the auto-detection to happen again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Starting from scratch helped and CMAKE_PREFIX_PATH
works 👍
…itialization as C++14 functionality.
rs-pose-apriltag specifies Apriltag library version used
95a1272
to
3e36c94
Compare
Readme.md adds link to tag image pdf and the original tag images directory.
sample tag size in the pdf is 0.144m
add comment about homography in undistorted image coordinate handling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add it to the demos list here
|
||
## Dependency | ||
|
||
This sample requires the [Apriltag library 3.1.1](https://github.com/AprilRobotics/apriltag/tree/3.1.1) installed in the default location suggested by the library or a path specified in cmake variable `CMAKE_PREFIX_PATH`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order for the demo to be built into distribution images (both Win and Linux) all the dependencies should be embedded into the project's Cmake ( see Libusb dependency, for instance).
So for now it will be available via the manual build only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ev-mp I think we are okay via manual build at this moment.
rs-pose-apriltag: add item in the readme index page of examples
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@honpong, thanks for the demo!
where this update went? |
@mickeyouyou it has been merged into the development branch. |
yeah thank you so much for your contribution. |
So I guess we use this one ? |
@patrickpoirier51 correct, this example uses https://github.com/AprilRobotics/apriltag. Check the example readme at https://github.com/IntelRealSense/librealsense/tree/master/examples/pose-apriltag for instructions including how to install the Apriltag library locally and get CMake to find it. |
@honpong Thanks for this neat contribution. Do you know a way in order to make this detection available for a python script? |
@neilyoung, is this https://github.com/AprilRobotics/apriltag/wiki/AprilTag-User-Guide#python something you may consider? |
@honpong Great reference. Many thanks. May I ask you two easy questions regarding your sample? |
@neilyoung, yes |
@neilyoung, please see my new comment #5184. |
@honpong Yepp, added yet another comment :) |
@dorodnic I wrote a simple example of t265 apriltag detection running on host. Here we assume the apriltag detection library has been installed in the default path, e.g
/usr/local/lib
, and cmake find library from there. If no apriltag library found, this sample will simply not be added to the solution.If this is not the expected way of cmake configuration, please suggest how to properly link a thirdparty library (Apriltag detection) in a librealsense example, the best if you can provide us a blank cmake template.
cc @dorian3d @bfulkers-i @harville