Skip to content

Commit

Permalink
Merge pull request #27 from NVIDIA-ISAAC-ROS/release-2.0.0
Browse files Browse the repository at this point in the history
Isaac ROS 2.0.0
  • Loading branch information
jaiveersinghNV authored Oct 19, 2023
2 parents 040c1e8 + 6084afe commit 610c548
Show file tree
Hide file tree
Showing 37 changed files with 946 additions and 391 deletions.
313 changes: 72 additions & 241 deletions README.md

Large diffs are not rendered by default.

39 changes: 0 additions & 39 deletions docs/tutorial-custom-model.md

This file was deleted.

53 changes: 0 additions & 53 deletions docs/tutorial-isaac-sim.md

This file was deleted.

10 changes: 8 additions & 2 deletions isaac_ros_detectnet/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
#
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.23.2)
cmake_minimum_required(VERSION 3.22.1)
project(isaac_ros_detectnet LANGUAGES C CXX)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
Expand Down Expand Up @@ -43,6 +43,12 @@ if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()


# The FindPythonInterp and FindPythonLibs modules are removed
if(POLICY CMP0148)
cmake_policy(SET CMP0148 OLD)
endif()

find_package(launch_testing_ament_cmake REQUIRED)
add_launch_test(test/isaac_ros_detectnet_pol_test.py TIMEOUT "600")
endif()
Expand Down
2 changes: 1 addition & 1 deletion isaac_ros_detectnet/gxf/detectnet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ find_package(GXF ${ISAAC_ROS_GXF_VERSION} MODULE REQUIRED
std
)
find_package(isaac_ros_nitros_detection2_d_array_type REQUIRED)
include(YamlCpp)
find_package(yaml-cpp)

# DetectNet extension
add_library(gxf_detectnet SHARED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,14 @@ typedef enum
/**
* Holds full dimensions (including batch size) for a layer.
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
typedef struct
{
int batchSize = 0;
NvDsInferDims dims = {0};
} NvDsInferBatchDims;
#pragma GCC diagnostic pop

/**
* Extended structure for bound layer information which additionally includes
Expand Down
12 changes: 6 additions & 6 deletions isaac_ros_detectnet/gxf/detectnet/detectnet_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,18 +263,18 @@ gxf_result_t DetectnetDecoder::tick() noexcept

// TODO(ashwinvk): Do not copy data to host and perform decoding using cuda
// copy memory to host
float cov_tensor_arr[cov_tensor->size() / sizeof(float)]; // since data in tensor is kFloat32
std::unique_ptr<float[]> cov_tensor_arr(new float[cov_tensor->element_count()]);
const cudaError_t cuda_error_cov_tensor = cudaMemcpy(
&cov_tensor_arr, cov_tensor->pointer(),
cov_tensor_arr.get(), cov_tensor->pointer(),
cov_tensor->size(), cudaMemcpyDeviceToHost);
if (cuda_error_cov_tensor != cudaSuccess) {
GXF_LOG_ERROR("Error while copying kernel: %s", cudaGetErrorString(cuda_error_cov_tensor));
return GXF_FAILURE;
}

float bbox_tensor_arr[bbox_tensor->size() / sizeof(float)]; // since data in tensor is kFloat32
std::unique_ptr<float[]> bbox_tensor_arr(new float[bbox_tensor->element_count()]);
const cudaError_t cuda_error_bbox_tensor = cudaMemcpy(
&bbox_tensor_arr, bbox_tensor->pointer(),
bbox_tensor_arr.get(), bbox_tensor->pointer(),
bbox_tensor->size(), cudaMemcpyDeviceToHost);
if (cuda_error_bbox_tensor != cudaSuccess) {
GXF_LOG_ERROR("Error while copying kernel: %s", cudaGetErrorString(cuda_error_bbox_tensor));
Expand Down Expand Up @@ -342,7 +342,7 @@ gxf_result_t DetectnetDecoder::tick() noexcept
// check if object_class is out of range for label_list_
if (static_cast<size_t>(object_class) >= label_list_.get().size()) {
GXF_LOG_ERROR(
"[DetectNet Decoder] object_class %i is out of range for provided label_list_ of size %i", object_class,
"[DetectNet Decoder] object_class %i is out of range for provided label_list_ of size %lu", object_class,
label_list_.get().size());
return GXF_FAILURE;
}
Expand All @@ -369,7 +369,7 @@ gxf_result_t DetectnetDecoder::tick() noexcept
} else {
GXF_LOG_ERROR(
"Invalid value for dbscan_clustering_algorithm: %i",
dbscan_clustering_algorithm_);
dbscan_clustering_algorithm_.get());
return GXF_FAILURE;
}
NvDsInferDBScanDestroy(dbscan_hdl);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
// Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
16 changes: 16 additions & 0 deletions isaac_ros_detectnet/isaac_ros_detectnet/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
11 changes: 8 additions & 3 deletions isaac_ros_detectnet/launch/isaac_ros_detectnet.launch.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -35,11 +35,16 @@ def generate_launch_description():

encoder_node = ComposableNode(
name='dnn_image_encoder',
package='isaac_ros_dnn_encoders',
package='isaac_ros_dnn_image_encoder',
plugin='nvidia::isaac_ros::dnn_inference::DnnImageEncoderNode',
parameters=[{
'input_image_width': 1200,
'input_image_height': 632,
'network_image_width': 1200,
'network_image_height': 632
'network_image_height': 632,
'image_mean': [0.0, 0.0, 0.0],
'image_stddev': [1.0, 1.0, 1.0],
'enable_padding': False
}],
remappings=[('encoded_tensor', 'tensor_pub')]
)
Expand Down
33 changes: 27 additions & 6 deletions isaac_ros_detectnet/launch/isaac_ros_detectnet_isaac_sim.launch.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -33,16 +33,37 @@ def generate_launch_description():
with open(labels_file_path, 'r') as fd:
label_list = fd.read().strip().splitlines()

image_resize_node_left = ComposableNode(
package='isaac_ros_image_proc',
plugin='nvidia::isaac_ros::image_proc::ResizeNode',
name='image_resize_node_left',
parameters=[{
'output_width': 1280,
'output_height': 720,
'encoding_desired': 'rgb8',
}],
remappings=[
('camera_info', 'front_stereo_camera/left_rgb/camerainfo'),
('image', 'front_stereo_camera/left_rgb/image_raw'),
('resize/camera_info', 'front_stereo_camera/left_rgb/camerainfo_resize'),
('resize/image', 'front_stereo_camera/left_rgb/image_resize')]
)

encoder_node = ComposableNode(
name='dnn_image_encoder',
package='isaac_ros_dnn_encoders',
package='isaac_ros_dnn_image_encoder',
plugin='nvidia::isaac_ros::dnn_inference::DnnImageEncoderNode',
parameters=[{
'input_image_width': 1280,
'input_image_height': 720,
'network_image_width': 1280,
'network_image_height': 720
'network_image_height': 720,
'image_mean': [0.0, 0.0, 0.0],
'image_stddev': [1.0, 1.0, 1.0],
'enable_padding': False
}],
remappings=[('encoded_tensor', 'tensor_pub'),
('image', 'rgb_left')]
('image', 'front_stereo_camera/left_rgb/image_resize')]
)

triton_node = ComposableNode(
Expand Down Expand Up @@ -77,15 +98,15 @@ def generate_launch_description():
package='rclcpp_components',
executable='component_container_mt',
composable_node_descriptions=[
encoder_node, triton_node, detectnet_decoder_node],
image_resize_node_left, encoder_node, triton_node, detectnet_decoder_node],
output='screen'
)

detectnet_visualizer_node = Node(
package='isaac_ros_detectnet',
executable='isaac_ros_detectnet_visualizer.py',
name='detectnet_visualizer',
remappings=[('image', 'rgb_left')]
remappings=[('image', 'front_stereo_camera/left_rgb/image_resize')]

)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions isaac_ros_detectnet/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SPDX-License-Identifier: Apache-2.0
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>isaac_ros_detectnet</name>
<version>0.31.0</version>
<version>2.0.0</version>
<description>DetectNet model processing</description>

<maintainer email="[email protected]">Ashwin Varghese Kuruttukulam</maintainer>
Expand All @@ -44,7 +44,7 @@ SPDX-License-Identifier: Apache-2.0
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<test_depend>isaac_ros_test</test_depend>
<test_depend>isaac_ros_dnn_encoders</test_depend>
<test_depend>isaac_ros_dnn_image_encoder</test_depend>
<test_depend>isaac_ros_triton</test_depend>

<export>
Expand Down
29 changes: 29 additions & 0 deletions isaac_ros_detectnet/resources/peoplenet_config.pbtxt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "peoplenet"
platform: "tensorrt_plan"
max_batch_size: 16
input [
{
name: "input_1"
data_type: TYPE_FP32
format: FORMAT_NCHW
dims: [ 3, 544, 960 ]
}
]
output [
{
name: "output_bbox/BiasAdd"
data_type: TYPE_FP32
dims: [ 12, 34, 60 ]
},
{
name: "output_cov/Sigmoid"
data_type: TYPE_FP32
dims: [ 3, 34, 60 ]
}
]
dynamic_batching { }
version_policy: {
specific {
versions: [ 1 ]
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3

# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit 610c548

Please sign in to comment.