From 2b67ecc75f547d4e9f61c5b347d4c7f16757b417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Her=C3=B3n=20Ord=C3=B3=C3=B1ez=20Guill=C3=A9n?= Date: Mon, 18 Oct 2021 15:08:17 -0700 Subject: [PATCH] Isaac ROS v0.9.1 (EA2) release-ea2: ae5a65e92b47b13028dbfc5a597192b35e10a124 --- README.md | 40 +++++++++++++++---- .../test/isaac_ros_apriltag_pipeline_test.py | 12 +++--- resources/isaac_ros_apriltag_sample_crop.jpg | 3 ++ 3 files changed, 42 insertions(+), 13 deletions(-) create mode 100644 resources/isaac_ros_apriltag_sample_crop.jpg diff --git a/README.md b/README.md index 8507648..04ae9be 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ -# `isaac_ros_apriltag` +# Isaac ROS Apriltag +
+ ## Overview This ROS2 node uses the NVIDIA GPU-accelerated AprilTags library to detect AprilTags in images and publishes their poses, IDs, and additional metadata. This has been tested on ROS2 (Foxy) and should build and run on x86_64 and aarch64 (Jetson). It is modeled after and comparable to the ROS2 node for [CPU AprilTags detection](https://github.com/christianrauch/apriltag_ros.git). @@ -18,8 +20,24 @@ This Isaac ROS package is designed and tested to be compatible with ROS2 Foxy on - VPI 1.1.11 - Ubuntu 18.04+ +**Note:** For best performance on Jetson, ensure that power settings are configured appropriately ([Power Management for Jetson](https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/power_management_jetson_xavier.html#wwpID0EUHA)). + ### Docker -Precompiled ROS2 Foxy packages are not available for JetPack 4.6 (based on Ubuntu 18.04 Bionic). You can either manually compile ROS2 Foxy and required dependent packages from source or use the Isaac ROS development Docker image from [Isaac ROS Common](https://github.com/NVIDIA-AI-IOT/isaac_ros_common) based on images from [jetson-containers](https://github.com/dusty-nv/jetson-containers). +Precompiled ROS2 Foxy packages are not available for JetPack 4.6 (based on Ubuntu 18.04 Bionic). You can either manually compile ROS2 Foxy and required dependent packages from source or use the Isaac ROS development Docker image from [Isaac ROS Common](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_common). + +You must first install the [Nvidia Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html) to make use of the Docker container development/runtime environment. + +Configure `nvidia-container-runtime` as the default runtime for Docker by editing `/etc/docker/daemon.json` to include the following: +``` + "runtimes": { + "nvidia": { + "path": "nvidia-container-runtime", + "runtimeArgs": [] + } + }, + "default-runtime": "nvidia" +``` +and then restarting Docker: `sudo systemctl daemon-reload && sudo systemctl restart docker` Run the following script in `isaac_ros_common` to build the image and launch the container: @@ -28,20 +46,21 @@ Run the following script in `isaac_ros_common` to build the image and launch the You can either provide an optional path to mirror in your host ROS workspace with Isaac ROS packages, which will be made available in the container as `/workspaces/isaac_ros-dev`, or you can setup a new workspace in the container. ### Package Dependencies -- [isaac_ros_common](https://github.com/NVIDIA-AI-IOT/isaac_ros_common) -- [isaac_ros_image_pipeline](https://github.com/NVIDIA-AI-IOT/isaac_ros_image_pipeline) +- [isaac_ros_common](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_common) +- [isaac_ros_image_pipeline](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_image_pipeline) - [image_common](https://github.com/ros-perception/image_common.git) - [vision_cv](https://github.com/ros-perception/vision_opencv.git) - [OpenCV 4.5+](https://opencv.org/) -**Note:** `isaac_ros_common' is used for running tests and/or creating a development container. It also contains VPI Debian packages that can be installed natively on a development machine without the container. +**Note:** `isaac_ros_common` is used for running tests and/or creating a development container. It also contains VPI Debian packages that can be installed natively on a development machine without the container. ## Quickstart 1. Create a ROS2 workspace if one is not already prepared: `mkdir -p your_ws/src` **Note:** The workspace can have any name; the quickstart assumes you name it `your_ws`. 2. Clone this package repository to `your_ws/src/isaac_ros_apriltag`. Check that you have [Git LFS](https://git-lfs.github.com/) installed before cloning to pull down all large files. -`cd your_ws/src && git clone https://github.com/NVIDIA-AI-IOT/isaac_ros_apriltag` +`sudo apt-get install git-lfs` +`cd your_ws/src && git clone https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_apriltag` 3. Build and source the workspace: `cd your_ws && colcon build --symlink-install && source install/setup.bash` 4. (Optional) Run tests to verify complete and correct installation: @@ -79,8 +98,6 @@ This tutorial will help you quickly run and experiment with the full Isaac ROS A Detections will show up at `/tag_detections`. -**Note** For best performance on Jetson, ensure that power settings are configured appropriately ([Power Management for Jetson](https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/power_management_jetson_xavier.html#wwpID0EUHA)). - ## Next Steps Now that you have successfully launched the full Isaac ROS Apriltag pipeline, you can easily adapt the provided launchfile to integrate with your existing ROS2 environment. @@ -94,3 +111,10 @@ The `isaac_ros_apriltag` package offers functionality for detecting poses from A | Component | Topics Subscribed | Topics Published | Parameters | | -------------- | ------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `AprilTagNode` | `camera/image_rect`, `camera/camera_info`: The input camera stream | `tag_detections`: The detection message array
`tf`: The tag poses | `family`: The tag family for the detector (this value can only be `36h11` at this time)
`size`: The tag edge size in meters, assuming square markers
`max_tags`: The maximum number of tags to be detected, which is 20 by default | + +# Updates + +| Date | Changes | +| -----| ------- | +| 2021-10-20 | Migrated to [NVIDIA-ISAAC-ROS](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_apriltag) | +| 2021-08-11 | Initial release to [NVIDIA-AI-IOT](https://github.com/NVIDIA-AI-IOT/isaac_ros_apriltag) | diff --git a/isaac_ros_apriltag/test/isaac_ros_apriltag_pipeline_test.py b/isaac_ros_apriltag/test/isaac_ros_apriltag_pipeline_test.py index eef31ed..b134271 100644 --- a/isaac_ros_apriltag/test/isaac_ros_apriltag_pipeline_test.py +++ b/isaac_ros_apriltag/test/isaac_ros_apriltag_pipeline_test.py @@ -40,7 +40,6 @@ def generate_test_description(): apriltag_exe = launch_ros.actions.Node( package='isaac_ros_apriltag', executable='isaac_ros_apriltag', - name='apriltag_exe', namespace=IsaacROSAprilTagPipelineTest.generate_namespace(), ) @@ -58,7 +57,8 @@ class IsaacROSAprilTagPipelineTest(IsaacROSBaseTest): @IsaacROSBaseTest.for_each_test_case() def test_apriltag_pipeline(self, test_folder) -> None: """Expect the pipeline to produce apriltag detections from images.""" - self.generate_namespace_lookup(['image', 'camera_info', 'tag_detections']) + self.generate_namespace_lookup( + ['image', 'camera_info', 'tag_detections']) image_pub = self.node.create_publisher( Image, self.namespaces['image'], self.DEFAULT_QOS) @@ -70,7 +70,8 @@ def test_apriltag_pipeline(self, test_folder) -> None: [('tag_detections', AprilTagDetectionArray)], received_messages) try: - image = JSONConversion.load_image_from_json(test_folder / 'image.json') + image = JSONConversion.load_image_from_json( + test_folder / 'image.json') camera_info = JSONConversion.load_camera_info_from_json( test_folder / 'camera_info.json') @@ -84,14 +85,15 @@ def test_apriltag_pipeline(self, test_folder) -> None: done = False while time.time() < end_time: - rclpy.spin_once(self.node, timeout_sec=TIMEOUT) + rclpy.spin_once(self.node, timeout_sec=0.1) # If we have received exactly one message on the output topic, break if 'tag_detections' in received_messages: done = True break - self.assertTrue(done, "Didn't receive output on tag_detections topic!") + self.assertTrue( + done, "Didn't receive output on tag_detections topic!") # Collect received detections tag_detections_actual = received_messages['tag_detections'] diff --git a/resources/isaac_ros_apriltag_sample_crop.jpg b/resources/isaac_ros_apriltag_sample_crop.jpg new file mode 100644 index 0000000..d1f6822 --- /dev/null +++ b/resources/isaac_ros_apriltag_sample_crop.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b07b8d207d305b2e2799be0e2662e1172cf68cc223c685945847068274f21b5 +size 137430