Skip to content

Commit

Permalink
Isaac ROS v0.9.1 (EA2)
Browse files Browse the repository at this point in the history
release-ea2: ae5a65e92b47b13028dbfc5a597192b35e10a124
  • Loading branch information
hguillen authored and hemalshahNV committed Oct 20, 2021
1 parent 44b163f commit 2b67ecc
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 13 deletions.
40 changes: 32 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# `isaac_ros_apriltag`
# Isaac ROS Apriltag

<div align="center"><img src="resources/isaac_ros_apriltag_sample_crop.jpg" width="400px"/></div>

## 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).

Expand All @@ -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:

Expand All @@ -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:
Expand Down Expand Up @@ -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.

Expand All @@ -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 <br> `tf`: The tag poses | `family`: The tag family for the detector (this value can only be `36h11` at this time) <br> `size`: The tag edge size in meters, assuming square markers <br> `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) |
12 changes: 7 additions & 5 deletions isaac_ros_apriltag/test/isaac_ros_apriltag_pipeline_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)

Expand All @@ -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)
Expand All @@ -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')

Expand All @@ -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']
Expand Down
3 changes: 3 additions & 0 deletions resources/isaac_ros_apriltag_sample_crop.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2b67ecc

Please sign in to comment.