Skip to content

Commit fe1395b

Browse files
hguillenhemalshahNV
authored andcommitted
NVIDIA Isaac ROS - EA2 Release
release-ea2: bfbfeeb0670ae4c0c3e062d67ab737e4cb41a8b2
1 parent 1e5e707 commit fe1395b

File tree

62 files changed

+4889
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+4889
-1
lines changed

.gitattributes

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Images
2+
*.gif filter=lfs diff=lfs merge=lfs -text
3+
*.jpg filter=lfs diff=lfs merge=lfs -text
4+
*.png filter=lfs diff=lfs merge=lfs -text
5+
*.psd filter=lfs diff=lfs merge=lfs -text
6+
7+
# Archives
8+
*.gz filter=lfs diff=lfs merge=lfs -text
9+
*.tar filter=lfs diff=lfs merge=lfs -text
10+
*.zip filter=lfs diff=lfs merge=lfs -text
11+
# Documents
12+
*.pdf filter=lfs diff=lfs merge=lfs -text
13+
# Numpy data
14+
*.npy filter=lfs diff=lfs merge=lfs -text
15+
# Debian package
16+
*.deb filter=lfs diff=lfs merge=lfs -text
17+
18+
# Shared libraries
19+
*.so filter=lfs diff=lfs merge=lfs -text
20+
*.so.* filter=lfs diff=lfs merge=lfs -text
21+
22+
# PCD files
23+
*.pcd filter=lfs diff=lfs merge=lfs -text
24+
25+
# Model files
26+
*.onnx filter=lfs diff=lfs merge=lfs -text

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ignore all pycache files
2+
**/__pycache__/**

LICENSE

Lines changed: 130 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 548 additions & 1 deletion
Large diffs are not rendered by default.

giistr-cla.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
## Individual Contributor License Agreement (CLA)
2+
3+
**Thank you for submitting your contributions to this project.**
4+
5+
By signing this CLA, you agree that the following terms apply to all of your past, present and future contributions
6+
to the project.
7+
8+
### License.
9+
10+
You hereby represent that all present, past and future contributions are governed by the
11+
[MIT License](https://opensource.org/licenses/MIT)
12+
copyright statement.
13+
14+
This entails that to the extent possible under law, you transfer all copyright and related or neighboring rights
15+
of the code or documents you contribute to the project itself or its maintainers.
16+
Furthermore you also represent that you have the authority to perform the above waiver
17+
with respect to the entirety of you contributions.
18+
19+
### Moral Rights.
20+
21+
To the fullest extent permitted under applicable law, you hereby waive, and agree not to
22+
assert, all of your “moral rights” in or relating to your contributions for the benefit of the project.
23+
24+
### Third Party Content.
25+
26+
If your Contribution includes or is based on any source code, object code, bug fixes, configuration changes, tools,
27+
specifications, documentation, data, materials, feedback, information or other works of authorship that were not
28+
authored by you (“Third Party Content”) or if you are aware of any third party intellectual property or proprietary
29+
rights associated with your Contribution (“Third Party Rights”),
30+
then you agree to include with the submission of your Contribution full details respecting such Third Party
31+
Content and Third Party Rights, including, without limitation, identification of which aspects of your
32+
Contribution contain Third Party Content or are associated with Third Party Rights, the owner/author of the
33+
Third Party Content and Third Party Rights, where you obtained the Third Party Content, and any applicable
34+
third party license terms or restrictions respecting the Third Party Content and Third Party Rights. For greater
35+
certainty, the foregoing obligations respecting the identification of Third Party Content and Third Party Rights
36+
do not apply to any portion of a Project that is incorporated into your Contribution to that same Project.
37+
38+
### Representations.
39+
40+
You represent that, other than the Third Party Content and Third Party Rights identified by
41+
you in accordance with this Agreement, you are the sole author of your Contributions and are legally entitled
42+
to grant the foregoing licenses and waivers in respect of your Contributions. If your Contributions were
43+
created in the course of your employment with your past or present employer(s), you represent that such
44+
employer(s) has authorized you to make your Contributions on behalf of such employer(s) or such employer
45+
(s) has waived all of their right, title or interest in or to your Contributions.
46+
47+
### Disclaimer.
48+
49+
To the fullest extent permitted under applicable law, your Contributions are provided on an "as is"
50+
basis, without any warranties or conditions, express or implied, including, without limitation, any implied
51+
warranties or conditions of non-infringement, merchantability or fitness for a particular purpose. You are not
52+
required to provide support for your Contributions, except to the extent you desire to provide support.
53+
54+
### No Obligation.
55+
56+
You acknowledge that the maintainers of this project are under no obligation to use or incorporate your contributions
57+
into the project. The decision to use or incorporate your contributions into the project will be made at the
58+
sole discretion of the maintainers or their authorized delegates.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Copyright (c) 2021, 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+
cmake_minimum_required(VERSION 3.5)
10+
project(isaac_ros_dnn_encoders)
11+
12+
# Default to C++17
13+
if(NOT CMAKE_CXX_STANDARD)
14+
set(CMAKE_CXX_STANDARD 17)
15+
endif()
16+
17+
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
18+
add_compile_options(-Wall -Wextra -Wpedantic)
19+
endif()
20+
21+
find_package(ament_cmake_auto REQUIRED)
22+
ament_auto_find_build_dependencies()
23+
24+
# DNN Image Encoder Node
25+
ament_auto_add_library(dnn_image_encoder_node SHARED src/dnn_image_encoder_node.cpp)
26+
target_compile_definitions(dnn_image_encoder_node
27+
PRIVATE "COMPOSITION_BUILDING_DLL"
28+
)
29+
rclcpp_components_register_nodes(dnn_image_encoder_node "isaac_ros::dnn_inference::DnnImageEncoderNode")
30+
set(node_plugins "${node_plugins}isaac_ros::dnn_inference::DnnImageEncoderNode;$<TARGET_FILE:dnn_image_encoder_node>\n")
31+
32+
ament_auto_add_executable("dnn_image_encoder" src/dnn_image_encoder_main.cpp)
33+
34+
install(TARGETS dnn_image_encoder_node
35+
ARCHIVE DESTINATION lib
36+
LIBRARY DESTINATION lib
37+
RUNTIME DESTINATION bin
38+
)
39+
40+
if(BUILD_TESTING)
41+
find_package(ament_lint_auto REQUIRED)
42+
43+
# Ignore copyright notices since we use custom JetPack EULA
44+
set(ament_cmake_copyright_FOUND TRUE)
45+
46+
ament_lint_auto_find_test_dependencies()
47+
48+
find_package(launch_testing_ament_cmake REQUIRED)
49+
endif()
50+
51+
ament_auto_package(INSTALL_TO_SHARE)
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/**
2+
* Copyright (c) 2021, 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+
11+
#ifndef ISAAC_ROS_DNN_ENCODERS__DNN_IMAGE_ENCODER_NODE_HPP_
12+
#define ISAAC_ROS_DNN_ENCODERS__DNN_IMAGE_ENCODER_NODE_HPP_
13+
14+
#include <memory>
15+
#include <string>
16+
17+
#include "image_transport/image_transport.hpp"
18+
#include "isaac_ros_nvengine_interfaces/msg/tensor_list.hpp"
19+
#include "rclcpp/rclcpp.hpp"
20+
21+
namespace isaac_ros
22+
{
23+
namespace dnn_inference
24+
{
25+
26+
class DnnImageEncoderNode : public rclcpp::Node
27+
{
28+
public:
29+
explicit DnnImageEncoderNode(const rclcpp::NodeOptions options = rclcpp::NodeOptions());
30+
31+
~DnnImageEncoderNode();
32+
33+
private:
34+
/**
35+
* @brief Callback to preprocess an image for the DNN inference node and then publish
36+
* the processed Tensor for the DNN inference node to use
37+
*
38+
* @param image_msg The image message received
39+
*/
40+
void DnnImageEncoderCallback(
41+
const sensor_msgs::msg::Image::ConstSharedPtr image_msg);
42+
43+
// Desired properties of the image
44+
const int network_image_width_;
45+
const int network_image_height_;
46+
const std::string network_image_encoding_;
47+
48+
// Name of the published Tensor message
49+
const std::string tensor_name_;
50+
51+
// Method to normalize image. Supported types are "unit_scaling" (range is [0, 1]),
52+
// and "positive_negative" (range is [-1, 1]) and "none" for no normalization
53+
const std::string network_normalization_type_;
54+
55+
// Image subscriber
56+
rclcpp::Subscription<sensor_msgs::msg::Image>::SharedPtr image_sub_;
57+
58+
// Publisher for outputting the processed image as a TensorList (containing one Tensor)
59+
rclcpp::Publisher<isaac_ros_nvengine_interfaces::msg::TensorList>::SharedPtr tensor_pub_;
60+
61+
struct DnnImageEncoderImpl;
62+
std::unique_ptr<DnnImageEncoderImpl> impl_; // Pointer to implementation
63+
};
64+
65+
} // namespace dnn_inference
66+
} // namespace isaac_ros
67+
68+
#endif // ISAAC_ROS_DNN_ENCODERS__DNN_IMAGE_ENCODER_NODE_HPP_

isaac_ros_dnn_encoders/package.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0"?>
2+
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
3+
<package format="3">
4+
<name>isaac_ros_dnn_encoders</name>
5+
<version>0.9.0</version>
6+
<description>Encoders for preprocessing before running deep learning inference</description>
7+
<maintainer email="[email protected]">Hemal Shah</maintainer>
8+
<license>Jetpack EULA</license>
9+
<url type="website">https://developer.nvidia.com/blog/accelerating-ai-modules-for-ros-and-ros-2-on-jetson/</url>
10+
<author>Ethan Yu</author>
11+
<author>Kajanan Chinniah</author>
12+
13+
<depend>rclcpp</depend>
14+
<depend>rclcpp_components</depend>
15+
<depend>image_transport</depend>
16+
<depend>cv_bridge</depend>
17+
<depend>isaac_ros_nvengine_interfaces</depend>
18+
19+
<test_depend>ament_lint_auto</test_depend>
20+
<test_depend>ament_lint_common</test_depend>
21+
22+
<export>
23+
<build_type>ament_cmake</build_type>
24+
</export>
25+
</package>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2021, 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+
11+
#include <rclcpp/rclcpp.hpp>
12+
#include <memory>
13+
#include "isaac_ros_dnn_encoders/dnn_image_encoder_node.hpp"
14+
15+
int main(int argc, char * argv[])
16+
{
17+
rclcpp::init(argc, argv);
18+
rclcpp::NodeOptions options;
19+
rclcpp::spin(std::make_shared<isaac_ros::dnn_inference::DnnImageEncoderNode>(options));
20+
rclcpp::shutdown();
21+
return 0;
22+
}

0 commit comments

Comments
 (0)