Comments (12)
Thanks for the example!
from apriltag.
Note: The change in 35f4ef2 adds a namespace to the exported target:
Lines 54 to 62 in 35f4ef2
which breaks projects that import that target via
target_link_libraries(${PROJECT_NAME} apriltag)
.
To include that namespace, this has to be changed to target_link_libraries(${PROJECT_NAME} apriltag::apriltag)
.
from apriltag.
@christianrauch how to install apriltags so that ROS2 wrapper finds it?
--- stderr: apriltag_ros
CMake Error at CMakeLists.txt:24 (add_library):
Target "AprilTagNode" links to target "apriltag::apriltag" but the target
was not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
---
Failed <<< apriltag_ros [1.67s, exited with code 1]
from apriltag.
I believe target apriltag::apriltag
does currently not exist. Can you try linking to apriltag
? We may need to create an ALIAS.
from apriltag.
@AndreV84 What did you try so far?
Ideally, rosdep
resolves all the binary dependencies: rosdep install --from-paths src -i
.
But I think since the namespace was added, there was no new binary release. So you have to clone https://github.com/AprilRobotics/apriltag manually into your workspace and build everything from source.
from apriltag.
@christianrauch Thank you for your response!
So far I tried:
- cloning both https://github.com/AprilRobotics/apriltag https://github.com/AprilRobotics/apriltag-ros to catkin_ws/src
:~/catkin_ws_dashing$ cd apriltag/
@linux:~/catkin_ws_dashing/apriltag$ mkdir build
@linux:~/catkin_ws_dashing/apriltag$ cd build
@linux:~/catkin_ws_dashing/apriltag/build$ cmake ..
@linux:~/catkin_ws_dashing/apriltag/build$ make -j8
@linux:~/catkin_ws_dashing/apriltag/build$ sudo make install
...
-- Installing: /usr/local/include/apriltag/tagStandard41h12.h
-- Installing: /usr/local/include/apriltag/tagStandard52h13.h
-- Installing: /usr/local/lib/libapriltag.so.3.1.0
-- Up-to-date: /usr/local/lib/libapriltag.so.3
-- Up-to-date: /usr/local/lib/libapriltag.so
then I would try to build the dashing workspace that has apriltag_msgs apriltag_ros cloned from https://github.com/christianrauch/apriltag_ros
colcon build
Starting >>> apriltag
Starting >>> apriltag_msgs
--- stderr: apriltag
CMake Error: The source directory "/home/agx002/catkin_ws_dashing/src/apriltag" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
make: *** [cmake_check_build_system] Error 1
---
Failed <<< apriltag [0.47s, exited with code 2]
Aborted <<< realsense2_camera_msgs [0.71s]
Aborted <<< apriltag_msgs [0.69s]
Summary: 0 packages finished [1.22s]
1 package failed: apriltag
1 package had stderr output: apriltag
3 packages not processed
as apriltags_msgs requires the apriltag folder in the src I moved it to there
but now apriltag_ros won't find
Starting >>> apriltag_ros
--- stderr: apriltag_ros
CMake Error at CMakeLists.txt:24 (add_library):
Target "AprilTagNode" links to target "apriltag::apriltag" but the target
was not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
---
Failed <<< apriltag_ros [1.59s, exited with code 1]
Summary: 5 packages finished [12.9s]
1 package failed: apriltag_ros
1 package had stderr output: apriltag_ros
from apriltag.
another error that comes out if to delete all other packages from src but apriltag_ros/ apriltag
- stderr: apriltag_ros
In file included from /home/agx002/catkin_ws_dashing/src/apriltag_ros/src/AprilTagNode.cpp:1:0:
/home/agx002/catkin_ws_dashing/src/apriltag_ros/include/AprilTagNode.hpp:11:10: fatal error: image_transport/camera_subscriber.hpp: No such file or directory
#include <image_transport/camera_subscriber.hpp>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
locate camera_subscriber
/opt/ros/dashing/include/image_transport/camera_subscriber.h
/opt/ros/melodic/include/image_transport/camera_subscriber.h
there seem no hpp file
from apriltag.
It looks like you mixed up your workspace with different ROS distributions (melodic
is ROS1, dashing
is ROS2).
There is an independent library called apriltag
at https://github.com/AprilRobotics/apriltag, which works without ROS. The ROS1 node is at https://github.com/AprilRobotics/apriltag_ros, and the ROS2 node is at https://github.com/christianrauch/apriltag_ros. Both ROS nodes are called apriltag_ros
as they live in different groups and are supposed to be used in separate workspaces, e.g. one for ROS1 and one for ROS2. You should not mix both nodes in the same workspace.
If you want to build the ROS2 workspace, you need the library from https://github.com/AprilRobotics/apriltag, the message definitions from https://github.com/christianrauch/apriltag_msgs and the ROS2 node from https://github.com/christianrauch/apriltag_ros.
from apriltag.
@christianrauch
Thank you for following up!
Exactly!
ROS1 works fine with default apriltag_ros from https://github.com/AprilRobotics/apriltag_ros also with https://github.com/AprilRobotics/apriltag
But ROS2 Dashing seems have some issues.
Look:
linux:~$ mkdir ws_dashing
@linux:~$ cd ws_dashing
@linux:~/ws_dashing$ mkdir src
@linux:~/ws_dashing$ cd src
@linux:~/ws_dashing/src$
@linux:~/ws_dashing/src$ git clone https://github.com/christianrauch/apriltag_ros
@linux:~/ws_dashing/src$ git clone https://github.com/christianrauch/apriltag_msgs
Unpacking objects: 100% (35/35), done.
@linux:~/ws_dashing/src$ cd ..
@linux:~/ws_dashing$ git clone https://github.com/AprilRobotics/apriltag
Cloning into 'apriltag'...
@linux:~/ws_dashing$ cd apriltag/
@linux:~/ws_dashing/apriltag$ mkdir build
@linux:~/ws_dashing/apriltag$ cd build
@linux:~/ws_dashing/apriltag/build$ cmake ..
-- The C compiler identification is GNU 7.5.0-- Generating done
-- Build files have been written to: /home/void/ws_dashing/apriltag/build
@linux:~/ws_dashing/apriltag/build$ sudo make install
at this point it should work as the mixing of ROS yet did not occur, right? but the output is as follows:
~/ws_dashing$ colcon build
Starting >>> apriltag
Starting >>> apriltag_msgs
Finished <<< apriltag [14.5s]
Finished <<< apriltag_msgs [18.0s]
Starting >>> apriltag_ros
--- stderr: apriltag_ros
In file included from /home/ws_dashing/src/apriltag_ros/src/AprilTagNode.cpp:1:0:
/home/ws_dashing/src/apriltag_ros/include/AprilTagNode.hpp:11:10: fatal error: image_transport/camera_subscriber.hpp: No such file or directory
#include <image_transport/camera_subscriber.hpp>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/AprilTagNode.dir/src/AprilTagNode.cpp.o] Error 1
make[1]: *** [CMakeFiles/AprilTagNode.dir/all] Error 2
make: *** [all] Error 2
---
Failed <<< apriltag_ros [4.89s, exited with code 2]
Summary: 2 packages finished [23.3s]
1 package failed: apriltag_ros
1 package had stderr output: apriltag_ros
I tried to look for that specific file but only found
/opt/ros/dashing/include/image_transport/camera_subscriber.h
from apriltag.
@christianrauch
resolved with
sudo bash -c 'echo "#include \"image_transport.h\"" > /opt/ros/dashing/include/image_transport/image_transport.hpp'
sudo bash -c 'echo "#include \"camera_subscriber.h\"" > /opt/ros/dashing/include/image_transport/camera_subscriber.hpp'
suggested patch from NVIDIA-AI-IOT/isaac_ros_apriltag#7 (comment)
from apriltag.
@AndreV84 I would recommend that you clone and build all packages as part of your ROS2 workspace via colcon. You manually installed the apriltag
via make install
, which works because it's a generic CMake package. But if you build and install it this way system-wide, it does not have to be part of your workspace.
The issue with the headers that you are facing is resulting from an API change in between ROS2 distributions (dashing
and foxy
) See the change at christianrauch/apriltag_ros@d8d5334. On master
branch is usually compatible with the latest ROS2 release (foxy
at the moment). If you have to use an older release (e.g. dashing
), you have to use a different branch, e.g. https://github.com/christianrauch/apriltag_ros/tree/dashing.
from apriltag.
Thank you very much!
from apriltag.
Related Issues (20)
- Improve documentation concerning estimated pose HOT 5
- What do the tag-specific hex codes in the c files represent?
- How to deal with tag36h9? HOT 1
- install problem HOT 5
- Clarify licensing HOT 1
- Geometric interpretation of estimation error HOT 2
- Help with thresholding parameters HOT 1
- How to run pose estimation in python ? HOT 3
- compatibility with WIN32_LEAN_AND_MEAN HOT 8
- Anyone implmented c# wrapper for this? HOT 1
- error when i run make in ubuntu 22.04 HOT 1
- Has anyone confirmed that this library can work on ESP32S3? HOT 3
- How to use intrinsics in Scaramuzza format to estimate the apriltag pose? HOT 3
- Suggestions on improving detections in low light conditions HOT 4
- Python bindings for apriltag_detect throws error when no detection is found HOT 5
- What's the meaning of 'apriltag.c:448: homography_compute2: Assertion `max_val_idx >= 0' failed.'? HOT 5
- Planned Python Package Index (PyPI) package? HOT 4
- Build fail on Ubuntu Noble in g2d.c: `last_quadrant` is used unitialized; treat-all-warnings-as-errors HOT 4
- How to detect AprilGrid? HOT 5
- (Python) 'Nthreads' is an invalid keyword argument for this function HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apriltag.