Isaac ROS AprilTag contains a ROS 2 package for detection of AprilTags, a type of fiducial marker that provides a point of reference or measure. AprilTag detections are GPU-accelerated for high performance.
A common graph of nodes connects from an input camera through rectify and resize to AprilTag. Rectify warps the input camera image into a rectified, undistorted output image; this node may not be necessary if the camera driver provides rectified camera images. Resize is often used to downscale higher resolution cameras into the desired resolution for AprilTags if needed. The input resolution to AprilTag is selected by the required detection distance for the application, as a minimum number of pixels are required to perform an AprilTag detection and classification. For example, an 8mp input image of 3840Ă—2160 may be much larger than necessary and a 4:1 downscale to 1920x1080 could make more efficienct use of compute resources and satisfy the required detection distance of the application. Each of the green nodes in the above diagram is GPU accelerated, allowing for a high-performance compute graph from Argus Camera to ApriTag. For USB and Ethernet cameras, the graph is accelerated from Rectify through AprilTag
As illustrated above, detections are provided in an output array for the number of AprilTag detections in the input image. Each entry in the array contains the ID (two-dimensional bar code) for the AprilTag, the four corners ((x0, y0), (x1, y1), (x2, y2), (x3, y3)) and center (x, y) of the input image, and the pose of the AprilTag.
Note: This package is a GPU-accelerated drop-in replacement for the CPU version of ROS Apriltag
Note: For more information, including the paper and the reference CPU implementation, refer to the AprilTag page
This package is powered by NVIDIA Isaac Transport for ROS (NITROS), which leverages type adaptation and negotiation to optimize message formats and dramatically accelerate communication between participating nodes.
The following table summarizes the per-platform performance statistics of sample graphs that use this package, with links included to the full benchmark output. These benchmark configurations are taken from the Isaac ROS Benchmark collection, based on the ros2_benchmark
framework.
Sample Graph | Input Size | AGX Orin | Orin NX | Orin Nano 8GB | x86_64 w/ RTX 4060 Ti |
---|---|---|---|---|---|
AprilTag Node | 720p | 110 fps 15 ms |
69.6 fps 18 ms |
50.1 fps 25 ms |
262 fps 9.3 ms |
AprilTag Graph | 720p | 143 fps 16 ms |
82.9 fps 22 ms |
58.0 fps 31 ms |
349 fps 11 ms |
- Isaac ROS Apriltag
Update 2023-05-25: Performance improvements.
This package is designed and tested to be compatible with ROS 2 Humble running on Jetson or an x86_64 system with an NVIDIA GPU.
Note: Versions of ROS 2 earlier than Humble are not supported. This package depends on specific ROS 2 implementation features that were only introduced beginning with the Humble release.
Platform | Hardware | Software | Notes |
---|---|---|---|
Jetson | Jetson Orin Jetson Xavier |
JetPack 5.1.1 | For best performance, ensure that power settings are configured appropriately. |
x86_64 | NVIDIA GPU | Ubuntu 20.04+ CUDA 11.8+ |
To simplify development, we strongly recommend leveraging the Isaac ROS Dev Docker images by following these steps. This will streamline your development environment setup with the correct versions of dependencies on both Jetson and x86_64 platforms.
Note: All Isaac ROS Quickstarts, tutorials, and examples have been designed with the Isaac ROS Docker images as a prerequisite.
-
Set up your development environment by following the instructions here.
-
Clone this repository and its dependencies under
~/workspaces/isaac_ros-dev/src
.cd ~/workspaces/isaac_ros-dev/src
git clone https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_common
git clone https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_nitros
git clone https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_apriltag
git clone https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_image_pipeline
-
Pull down a ROS Bag of sample data:
cd ~/workspaces/isaac_ros-dev/src/isaac_ros_apriltag && \ git lfs pull -X "" -I "resources/rosbags/quickstart.bag"
-
Launch the Docker container using the
run_dev.sh
script:cd ~/workspaces/isaac_ros-dev/src/isaac_ros_common && \ ./scripts/run_dev.sh
-
Inside the container, build and source the workspace:
cd /workspaces/isaac_ros-dev && \ colcon build --symlink-install && \ source install/setup.bash
-
(Optional) Run tests to verify complete and correct installation:
colcon test --executor sequential
-
Run the following launch files to spin up a demo of this package:
ros2 launch isaac_ros_apriltag isaac_ros_apriltag.launch.py
-
Open a second terminal inside the docker container:
cd ~/workspaces/isaac_ros-dev/src/isaac_ros_common && \ ./scripts/run_dev.sh
-
Run the rosbag file to simulate an image stream:
ros2 bag play --loop src/isaac_ros_apriltag/resources/rosbags/quickstart.bag
-
Open a third terminal inside the docker container:
cd ~/workspaces/isaac_ros-dev/src/isaac_ros_common && \ ./scripts/run_dev.sh
-
Observe the AprilTag detection output
/tag_detections
on a separate terminal with the command:source install/setup.bash && \ ros2 topic echo /tag_detections
You will need to calibrate the intrinsics of your camera if you want the node to determine 3D poses for tags instead of just detection and corners as 2D pixel coordinates. See here for more details.
To continue your exploration, check out the following suggested examples:
If you have an Argus-compatible camera, you can launch the NITROS-accelerated graph by following the tutorial.
To customize your development environment, reference this guide.
- Add a dependency on
isaac_ros_apriltag
toyour_package/package.xml
andyour_package/CMakeLists.txt
. The originalapriltag_ros
dependency may be removed entirely. - Change the package and plugin names in any
*.launch.py
launch files to useisaac_ros_apriltag
andnvidia::isaac_ros::apriltag::AprilTagNode
, respectively.
At this time, the packages under the standard apriltag_ros
have the following support:
Existing Package | Isaac ROS Alternative |
---|---|
apriltag_ros |
See isaac_ros_apriltag |
image_pipeline |
See isaac_ros_image_pipeline |
ros2 launch isaac_ros_apriltag isaac_ros_apriltag.launch.py --ros-args -p size:=<size of tag (meters)> -p max_tags:=<max tag count> -p tile_size:=<adaptive thresholding tile size(px)>
ROS Parameter | Type | Default | Description |
---|---|---|---|
size |
double |
0.22 |
The tag edge size in meters, assuming square markers. E.g. 0.22 |
max_tags |
int |
64 |
The maximum number of tags to be detected. E.g. 64 |
tile_size |
uint |
4 |
Tile/window size used for adaptive thresholding in pixels. E.g. 4 |
ROS Topic | Interface | Description |
---|---|---|
image |
sensor_msgs/Image | The input camera stream. |
camera_info |
sensor_msgs/CameraInfo | The input camera intrinsics stream. |
ROS Topic | Type | Description |
---|---|---|
tag_detections |
isaac_ros_apriltag_interfaces/AprilTagDetectionArray | The detection message array. |
tf |
tf2_msgs/TFMessage | Pose of all detected apriltags(TagFamily:ID ) wrt to the camera topic frame_id. |
For solutions to problems with Isaac ROS, please check here.
Date | Changes |
---|---|
2023-05-25 | Performance improvements |
2023-04-05 | Source available GXF extensions |
2022-10-19 | Updated OSS licensing |
2022-08-31 | Update to be compatible with JetPack 5.0.2 |
2022-06-30 | Update to use NITROS for improved performance |
2021-11-15 | Isaac Sim HIL documentation update |
2021-11-15 | Added launch file to work with Isaac Sim |
2021-10-20 | Migrated to NVIDIA-ISAAC-ROS |
2021-08-11 | Initial release to NVIDIA-AI-IOT |