Skip to content

Commit 4febbca

Browse files
authored
Merge pull request #7 from NVIDIA-ISAAC-ROS/release-dp-1.1
Isaac ROS 0.11.0 (DP1.1)
2 parents f1f5cf6 + ce0b52f commit 4febbca

File tree

17 files changed

+410
-524
lines changed

17 files changed

+410
-524
lines changed

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
## Overview
66
This repository provides NVIDIA GPU-accelerated packages for 3D object pose estimation. Using a deep learned pose estimation model and a monocular camera, the `isaac_ros_dope` and `isaac_ros_centerpose` package can estimate the 6DOF pose of a target object.
77

8-
Packages in this repository rely on accelerated DNN model inference using [Triton](https://github.com/triton-inference-server/server) or [TensorRT](https://developer.nvidia.com/tensorrt) from [Isaac ROS DNN Inference](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_common/tree/main/isaac_ros_dnn_inference).
8+
Packages in this repository rely on accelerated DNN model inference using [Triton](https://github.com/triton-inference-server/server) or [TensorRT](https://developer.nvidia.com/tensorrt) from [Isaac ROS DNN Inference](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_dnn_inference).
99

1010

1111
## Performance
@@ -49,16 +49,17 @@ The following are the benchmark performance results of the prepared pipelines in
4949
- [Updates](#updates)
5050

5151
## Latest Update
52-
Update 2022-06-30: Refactored README, updated launch file & added `nvidia` namespace, dropped Jetson support for CenterPose
53-
52+
Update 2022-08-31: Update to accelerate DOPE with [NVIDIA Isaac Transport for ROS (NITROS)](https://developer.nvidia.com/blog/improve-perception-performance-for-ros-2-applications-with-nvidia-isaac-transport-for-ros/) and to be compatible with JetPack 5.0.2
5453

5554
## Supported Platforms
5655
This package is designed and tested to be compatible with ROS2 Humble running on [Jetson](https://developer.nvidia.com/embedded-computing) or an x86_64 system with an NVIDIA GPU.
5756

57+
> **Note**: Versions of ROS2 earlier than Humble are **not** supported. This package depends on specific ROS2 implementation features that were only introduced beginning with the Humble release.
58+
5859

5960
| Platform | Hardware | Software | Notes |
6061
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
61-
| Jetson | [Jetson Orin](https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/jetson-orin/)<br/>[Jetson Xavier](https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/jetson-agx-xavier/) | [JetPack 5.0.1 DP](https://developer.nvidia.com/embedded/jetpack) | For best performance, ensure that [power settings](https://docs.nvidia.com/jetson/archives/r34.1/DeveloperGuide/text/SD/PlatformPowerAndPerformance.html) are configured appropriately. |
62+
| Jetson | [Jetson Orin](https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/jetson-orin/)<br/>[Jetson Xavier](https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/jetson-agx-xavier/) | [JetPack 5.0.2](https://developer.nvidia.com/embedded/jetpack) | For best performance, ensure that [power settings](https://docs.nvidia.com/jetson/archives/r34.1/DeveloperGuide/text/SD/PlatformPowerAndPerformance.html) are configured appropriately. |
6263
| x86_64 | NVIDIA GPU | [Ubuntu 20.04+](https://releases.ubuntu.com/20.04/) <br> [CUDA 11.6.1+](https://developer.nvidia.com/cuda-downloads) |
6364

6465

@@ -233,11 +234,10 @@ tensorrt_verbose:=<tensorrt_verbose> object_name:=<object_name>
233234
234235
#### ROS Parameters
235236
236-
| ROS Parameter | Type | Default | Description |
237-
| -------------------- | -------- | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
238-
| `queue_size` | `int` | `rmw_qos_profile_default.depth` | The length of the subscription queues |
239-
| `configuration_file` | `string` | `dope_config.yaml` | The name of the configuration file to parse. Note: The node will look for that file name under isaac_ros_dope/config |
240-
| `object_name` | `string` | `Ketchup` | The object class the DOPE network is detecting and the DOPE decoder is interpreting. This name should be listed in the configuration file along with its corresponding cuboid dimensions. |
237+
| ROS Parameter | Type | Default | Description |
238+
| -------------------- | -------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
239+
| `configuration_file` | `string` | `dope_config.yaml` | The name of the configuration file to parse. Note: The node will look for that file name under isaac_ros_dope/config |
240+
| `object_name` | `string` | `Ketchup` | The object class the DOPE network is detecting and the DOPE decoder is interpreting. This name should be listed in the configuration file along with its corresponding cuboid dimensions. |
241241
242242
#### Configuration File
243243
The DOPE configuration file, which can be found at `isaac_ros_dope/config/dope_config.yaml` may need to modified. Specifically, you will need to specify an object type in the `DopeDecoderNode` that is listed in the `dope_config.yaml` file, so the DOPE decoder node will pick the right parameters to transform the belief maps from the inference node to object poses. The `dope_config.yaml` file uses the camera intrinsics of Realsense by default - if you are using a different camera, you will need to modify the camera_matrix field with the new, scaled `(640x480)` camera intrinsics.
@@ -314,5 +314,6 @@ For solutions to problems with using DNN models, please check [here](https://git
314314
## Updates
315315
| Date | Changes |
316316
| ---------- | -------------------------------------------------------------------------------------------------------- |
317+
| 2022-06-30 | Update to use NITROS for improved performance and to be compatible with JetPack 5.0.2 |
317318
| 2022-06-30 | Refactored README, updated launch file & added `nvidia` namespace, dropped Jetson support for CenterPose |
318319
| 2021-10-20 | Initial update |

isaac_ros_centerpose/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ license agreement from NVIDIA CORPORATION is strictly prohibited.
1313
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
1414
<package format="3">
1515
<name>isaac_ros_centerpose</name>
16-
<version>0.10.0</version>
16+
<version>0.11.0</version>
1717
<description>CenterPose: Pose Estimation using Deep Learning</description>
1818

1919
<maintainer email="[email protected]">Hemal Shah</maintainer>
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
2+
#
3+
# NVIDIA CORPORATION and its licensors retain all intellectual property
4+
# and proprietary rights in and to this software, related documentation
5+
# and any modifications thereto. Any use, reproduction, disclosure or
6+
# distribution of this software and related documentation without an express
7+
# license agreement from NVIDIA CORPORATION is strictly prohibited.
8+
9+
"""
10+
Basic Proof-Of-Life test for the Isaac ROS CenterPose Node.
11+
12+
This test checks that an image can be encoder into a tensor, run through
13+
Triton using a CenterPose model, and the inference decoded into a series of poses.
14+
"""
15+
import os
16+
import pathlib
17+
import time
18+
19+
from ament_index_python.packages import get_package_share_directory
20+
from isaac_ros_test import IsaacROSBaseTest, JSONConversion
21+
from launch_ros.actions import ComposableNodeContainer, Node
22+
from launch_ros.descriptions import ComposableNode
23+
24+
import pytest
25+
import rclpy
26+
27+
from sensor_msgs.msg import Image
28+
from visualization_msgs.msg import MarkerArray
29+
30+
MODEL_GENERATION_TIMEOUT_SEC = 300
31+
INIT_WAIT_SEC = 10
32+
MODEL_PATH = '/tmp/centerpose_trt_engine.plan'
33+
34+
35+
@pytest.mark.rostest
36+
def generate_test_description():
37+
launch_dir_path = pathlib.Path(os.path.dirname(os.path.realpath(__file__)))
38+
model_dir_path = launch_dir_path / 'models'
39+
model_file_name = 'shoe_resnet_140.onnx'
40+
config = os.path.join(
41+
get_package_share_directory('isaac_ros_centerpose'),
42+
'config',
43+
'decoder_params_test.yaml'
44+
)
45+
46+
centerpose_encoder_node = ComposableNode(
47+
name='centerpose_encoder',
48+
package='isaac_ros_dnn_encoders',
49+
plugin='nvidia::isaac_ros::dnn_inference::DnnImageEncoderNode',
50+
namespace=IsaacROSCenterPosePOLTest.generate_namespace(),
51+
parameters=[{
52+
'network_image_width': 512,
53+
'network_image_height': 512,
54+
'image_mean': [0.408, 0.447, 0.47],
55+
'image_stddev': [0.289, 0.274, 0.278]
56+
}],
57+
remappings=[('encoded_tensor', 'tensor_pub')])
58+
59+
centerpose_inference_node = ComposableNode(
60+
name='centerpose_inference',
61+
package='isaac_ros_tensor_rt',
62+
plugin='nvidia::isaac_ros::dnn_inference::TensorRTNode',
63+
namespace=IsaacROSCenterPosePOLTest.generate_namespace(),
64+
parameters=[{
65+
'model_file_path': str(model_dir_path / model_file_name),
66+
'engine_file_path': MODEL_PATH,
67+
'input_tensor_names': ['input_tensor'],
68+
'input_binding_names': ['input'],
69+
'input_tensor_formats': ['nitros_tensor_list_nchw_rgb_f32'],
70+
'output_tensor_names': ['hm', 'wh', 'hps', 'reg', 'hm_hp', 'hp_offset', 'scale'],
71+
'output_binding_names': ['hm', 'wh', 'hps', 'reg', 'hm_hp', 'hp_offset', 'scale'],
72+
'output_tensor_formats': ['nitros_tensor_list_nhwc_rgb_f32'],
73+
'verbose': False,
74+
'force_engine_update': False
75+
}])
76+
77+
centerpose_decoder_node = Node(
78+
name='centerpose_decoder_node',
79+
package='isaac_ros_centerpose',
80+
namespace=IsaacROSCenterPosePOLTest.generate_namespace(),
81+
executable='CenterPoseDecoder',
82+
parameters=[config],
83+
output='screen'
84+
)
85+
86+
rclcpp_container = ComposableNodeContainer(
87+
name='rclcpp_container',
88+
namespace='',
89+
package='rclcpp_components',
90+
executable='component_container_mt',
91+
composable_node_descriptions=[
92+
centerpose_encoder_node, centerpose_inference_node],
93+
output='screen',
94+
)
95+
96+
return IsaacROSCenterPosePOLTest.generate_test_description([rclcpp_container,
97+
centerpose_decoder_node])
98+
99+
100+
class IsaacROSCenterPosePOLTest(IsaacROSBaseTest):
101+
filepath = pathlib.Path(os.path.dirname(__file__))
102+
103+
def test_pol(self):
104+
105+
self.node._logger.info(
106+
f'Generating model (timeout={MODEL_GENERATION_TIMEOUT_SEC}s)')
107+
start_time = time.time()
108+
wait_cycles = 1
109+
while not os.path.isfile(MODEL_PATH):
110+
time_diff = time.time() - start_time
111+
if time_diff > MODEL_GENERATION_TIMEOUT_SEC:
112+
self.fail('Model generation timed out')
113+
if time_diff > wait_cycles*10:
114+
self.node._logger.info(
115+
f'Waiting for model generation to finish... ({int(time_diff)}s passed)')
116+
wait_cycles += 1
117+
time.sleep(1)
118+
119+
# Wait for TensorRT engine
120+
time.sleep(INIT_WAIT_SEC)
121+
122+
self.node._logger.info(
123+
f'Model generation was finished (took {(time.time() - start_time)}s)')
124+
125+
received_messages = {}
126+
127+
self.generate_namespace_lookup(['image', 'object_poses'])
128+
129+
image_pub = self.node.create_publisher(
130+
Image, self.namespaces['image'], self.DEFAULT_QOS)
131+
132+
# The current CenterPose decoder outputs MarkerArray
133+
subs = self.create_logging_subscribers(
134+
[('object_poses', MarkerArray)], received_messages)
135+
136+
try:
137+
json_file = self.filepath / 'test_cases/gray_shoe/image.json'
138+
image = JSONConversion.load_image_from_json(json_file)
139+
140+
TIMEOUT = 60
141+
end_time = time.time() + TIMEOUT
142+
done = False
143+
144+
while time.time() < end_time:
145+
image_pub.publish(image)
146+
rclpy.spin_once(self.node, timeout_sec=(0.1))
147+
if 'object_poses' in received_messages:
148+
done = True
149+
break
150+
self.assertTrue(done, 'Timeout. Appropriate output not received')
151+
self.node._logger.info('A message was successfully received')
152+
153+
finally:
154+
self.node.destroy_subscription(subs)
155+
self.node.destroy_publisher(image_pub)

isaac_ros_dope/CMakeLists.txt

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,10 @@ execute_process(COMMAND uname -m COMMAND tr -d '\n'
2929
)
3030
message( STATUS "Architecture: ${ARCHITECTURE}" )
3131

32-
set(CUDA_MIN_VERSION "11.4")
33-
3432
find_package(ament_cmake_auto REQUIRED)
3533
ament_auto_find_build_dependencies()
3634

37-
# Eigen
38-
find_package(Eigen3 REQUIRED)
39-
35+
# Decoder node
4036
ament_auto_add_library(dope_decoder_node SHARED
4137
src/dope_decoder_node.cpp)
4238
target_compile_definitions(dope_decoder_node
@@ -46,16 +42,23 @@ rclcpp_components_register_nodes(dope_decoder_node
4642
"nvidia::isaac_ros::dope::DopeDecoderNode")
4743
set(node_plugins "${node_plugins}nvidia::isaac_ros::dope::DopeDecoderNode;$<TARGET_FILE:dope_decoder_node>\n")
4844

45+
install(DIRECTORY
46+
config
47+
DESTINATION share/${PROJECT_NAME}
48+
)
49+
4950
install(TARGETS dope_decoder_node
5051
ARCHIVE DESTINATION lib
5152
LIBRARY DESTINATION lib
5253
RUNTIME DESTINATION bin
5354
)
5455

55-
install(DIRECTORY
56-
config
57-
DESTINATION share/${PROJECT_NAME}
58-
)
56+
# Install extensions directory
57+
if( ${ARCHITECTURE} STREQUAL "x86_64" )
58+
install(DIRECTORY gxf/lib/gxf_x86_64/ DESTINATION share/${PROJECT_NAME}/gxf)
59+
elseif( ${ARCHITECTURE} STREQUAL "aarch64" )
60+
install(DIRECTORY gxf/lib/gxf_jetpack50/ DESTINATION share/${PROJECT_NAME}/gxf)
61+
endif()
5962

6063
if(BUILD_TESTING)
6164
find_package(ament_lint_auto REQUIRED)
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
%YAML 1.2
2+
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
3+
#
4+
# NVIDIA CORPORATION and its licensors retain all intellectual property
5+
# and proprietary rights in and to this software, related documentation
6+
# and any modifications thereto. Any use, reproduction, disclosure or
7+
# distribution of this software and related documentation without an express
8+
# license agreement from NVIDIA CORPORATION is strictly prohibited.
9+
---
10+
name: dope_decoder
11+
components:
12+
- name: tensorlist_in
13+
type: nvidia::gxf::DoubleBufferReceiver
14+
parameters:
15+
capacity: 12
16+
policy: 0
17+
- name: posearray_out
18+
type: nvidia::gxf::DoubleBufferTransmitter
19+
parameters:
20+
capacity: 12
21+
policy: 0
22+
- name: allocator
23+
type: nvidia::gxf::UnboundedAllocator
24+
- name: dope_decoder
25+
type: nvidia::isaac_ros::dope::DopeDecoder
26+
parameters:
27+
tensorlist_receiver: tensorlist_in
28+
posearray_transmitter: posearray_out
29+
allocator: allocator
30+
object_dimensions: []
31+
camera_matrix: []
32+
object_name: ""
33+
- type: nvidia::gxf::MessageAvailableSchedulingTerm
34+
parameters:
35+
receiver: tensorlist_in
36+
min_size: 1
37+
- type: nvidia::gxf::DownstreamReceptiveSchedulingTerm
38+
parameters:
39+
transmitter: posearray_out
40+
min_size: 1
41+
---
42+
name: vault
43+
components:
44+
- name: signal
45+
type: nvidia::gxf::DoubleBufferReceiver
46+
parameters:
47+
capacity: 1
48+
policy: 0
49+
- type: nvidia::gxf::MessageAvailableSchedulingTerm
50+
parameters:
51+
receiver: signal
52+
min_size: 1
53+
- name: vault
54+
type: nvidia::gxf::Vault
55+
parameters:
56+
source: signal
57+
max_waiting_count: 1
58+
drop_waiting: false
59+
---
60+
components:
61+
- name: edge0
62+
type: nvidia::gxf::Connection
63+
parameters:
64+
source: dope_decoder/posearray_out
65+
target: vault/signal
66+
---
67+
components:
68+
- type: nvidia::gxf::GreedyScheduler
69+
parameters:
70+
clock: clock
71+
stop_on_deadlock: false
72+
- name: clock
73+
type: nvidia::gxf::RealtimeClock
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:47f393f877c2d4c6e867251b377bd49bbda2abcb0c20048498529ac60ff0329e
3+
size 195336
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:712d6a3551852be84248b468d1087115afe3e4dfac4f85670bb08016e53941be
3+
size 1957296
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:125975bf43dfe0a0dec3e17d14be7345a3156420adeab78614d51c5e4155a668
3+
size 211312
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:8074b4b9a7f5abe66e871430fc1578e0149ce9f94c72c9d4131f6db13853545f
3+
size 2099264

0 commit comments

Comments
 (0)