Skip to content

Commit

Permalink
NVIDIA Isaac ROS - EA2 Release
Browse files Browse the repository at this point in the history
release-ea2: bfbfeeb0670ae4c0c3e062d67ab737e4cb41a8b2
  • Loading branch information
hguillen authored and hemalshahNV committed Oct 20, 2021
1 parent 1e5e707 commit fe1395b
Show file tree
Hide file tree
Showing 62 changed files with 4,889 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Images
*.gif filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.psd filter=lfs diff=lfs merge=lfs -text

# Archives
*.gz filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
# Documents
*.pdf filter=lfs diff=lfs merge=lfs -text
# Numpy data
*.npy filter=lfs diff=lfs merge=lfs -text
# Debian package
*.deb filter=lfs diff=lfs merge=lfs -text

# Shared libraries
*.so filter=lfs diff=lfs merge=lfs -text
*.so.* filter=lfs diff=lfs merge=lfs -text

# PCD files
*.pcd filter=lfs diff=lfs merge=lfs -text

# Model files
*.onnx filter=lfs diff=lfs merge=lfs -text
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ignore all pycache files
**/__pycache__/**
130 changes: 130 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

549 changes: 548 additions & 1 deletion README.md

Large diffs are not rendered by default.

58 changes: 58 additions & 0 deletions giistr-cla.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
## Individual Contributor License Agreement (CLA)

**Thank you for submitting your contributions to this project.**

By signing this CLA, you agree that the following terms apply to all of your past, present and future contributions
to the project.

### License.

You hereby represent that all present, past and future contributions are governed by the
[MIT License](https://opensource.org/licenses/MIT)
copyright statement.

This entails that to the extent possible under law, you transfer all copyright and related or neighboring rights
of the code or documents you contribute to the project itself or its maintainers.
Furthermore you also represent that you have the authority to perform the above waiver
with respect to the entirety of you contributions.

### Moral Rights.

To the fullest extent permitted under applicable law, you hereby waive, and agree not to
assert, all of your “moral rights” in or relating to your contributions for the benefit of the project.

### Third Party Content.

If your Contribution includes or is based on any source code, object code, bug fixes, configuration changes, tools,
specifications, documentation, data, materials, feedback, information or other works of authorship that were not
authored by you (“Third Party Content”) or if you are aware of any third party intellectual property or proprietary
rights associated with your Contribution (“Third Party Rights”),
then you agree to include with the submission of your Contribution full details respecting such Third Party
Content and Third Party Rights, including, without limitation, identification of which aspects of your
Contribution contain Third Party Content or are associated with Third Party Rights, the owner/author of the
Third Party Content and Third Party Rights, where you obtained the Third Party Content, and any applicable
third party license terms or restrictions respecting the Third Party Content and Third Party Rights. For greater
certainty, the foregoing obligations respecting the identification of Third Party Content and Third Party Rights
do not apply to any portion of a Project that is incorporated into your Contribution to that same Project.

### Representations.

You represent that, other than the Third Party Content and Third Party Rights identified by
you in accordance with this Agreement, you are the sole author of your Contributions and are legally entitled
to grant the foregoing licenses and waivers in respect of your Contributions. If your Contributions were
created in the course of your employment with your past or present employer(s), you represent that such
employer(s) has authorized you to make your Contributions on behalf of such employer(s) or such employer
(s) has waived all of their right, title or interest in or to your Contributions.

### Disclaimer.

To the fullest extent permitted under applicable law, your Contributions are provided on an "as is"
basis, without any warranties or conditions, express or implied, including, without limitation, any implied
warranties or conditions of non-infringement, merchantability or fitness for a particular purpose. You are not
required to provide support for your Contributions, except to the extent you desire to provide support.

### No Obligation.

You acknowledge that the maintainers of this project are under no obligation to use or incorporate your contributions
into the project. The decision to use or incorporate your contributions into the project will be made at the
sole discretion of the maintainers or their authorized delegates.
51 changes: 51 additions & 0 deletions isaac_ros_dnn_encoders/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.

cmake_minimum_required(VERSION 3.5)
project(isaac_ros_dnn_encoders)

# Default to C++17
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()

# DNN Image Encoder Node
ament_auto_add_library(dnn_image_encoder_node SHARED src/dnn_image_encoder_node.cpp)
target_compile_definitions(dnn_image_encoder_node
PRIVATE "COMPOSITION_BUILDING_DLL"
)
rclcpp_components_register_nodes(dnn_image_encoder_node "isaac_ros::dnn_inference::DnnImageEncoderNode")
set(node_plugins "${node_plugins}isaac_ros::dnn_inference::DnnImageEncoderNode;$<TARGET_FILE:dnn_image_encoder_node>\n")

ament_auto_add_executable("dnn_image_encoder" src/dnn_image_encoder_main.cpp)

install(TARGETS dnn_image_encoder_node
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)

# Ignore copyright notices since we use custom JetPack EULA
set(ament_cmake_copyright_FOUND TRUE)

ament_lint_auto_find_test_dependencies()

find_package(launch_testing_ament_cmake REQUIRED)
endif()

ament_auto_package(INSTALL_TO_SHARE)
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/**
* Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
*
* NVIDIA CORPORATION and its licensors retain all intellectual property
* and proprietary rights in and to this software, related documentation
* and any modifications thereto. Any use, reproduction, disclosure or
* distribution of this software and related documentation without an express
* license agreement from NVIDIA CORPORATION is strictly prohibited.
*/

#ifndef ISAAC_ROS_DNN_ENCODERS__DNN_IMAGE_ENCODER_NODE_HPP_
#define ISAAC_ROS_DNN_ENCODERS__DNN_IMAGE_ENCODER_NODE_HPP_

#include <memory>
#include <string>

#include "image_transport/image_transport.hpp"
#include "isaac_ros_nvengine_interfaces/msg/tensor_list.hpp"
#include "rclcpp/rclcpp.hpp"

namespace isaac_ros
{
namespace dnn_inference
{

class DnnImageEncoderNode : public rclcpp::Node
{
public:
explicit DnnImageEncoderNode(const rclcpp::NodeOptions options = rclcpp::NodeOptions());

~DnnImageEncoderNode();

private:
/**
* @brief Callback to preprocess an image for the DNN inference node and then publish
* the processed Tensor for the DNN inference node to use
*
* @param image_msg The image message received
*/
void DnnImageEncoderCallback(
const sensor_msgs::msg::Image::ConstSharedPtr image_msg);

// Desired properties of the image
const int network_image_width_;
const int network_image_height_;
const std::string network_image_encoding_;

// Name of the published Tensor message
const std::string tensor_name_;

// Method to normalize image. Supported types are "unit_scaling" (range is [0, 1]),
// and "positive_negative" (range is [-1, 1]) and "none" for no normalization
const std::string network_normalization_type_;

// Image subscriber
rclcpp::Subscription<sensor_msgs::msg::Image>::SharedPtr image_sub_;

// Publisher for outputting the processed image as a TensorList (containing one Tensor)
rclcpp::Publisher<isaac_ros_nvengine_interfaces::msg::TensorList>::SharedPtr tensor_pub_;

struct DnnImageEncoderImpl;
std::unique_ptr<DnnImageEncoderImpl> impl_; // Pointer to implementation
};

} // namespace dnn_inference
} // namespace isaac_ros

#endif // ISAAC_ROS_DNN_ENCODERS__DNN_IMAGE_ENCODER_NODE_HPP_
25 changes: 25 additions & 0 deletions isaac_ros_dnn_encoders/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.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_dnn_encoders</name>
<version>0.9.0</version>
<description>Encoders for preprocessing before running deep learning inference</description>
<maintainer email="hemals@nvidia.com">Hemal Shah</maintainer>
<license>Jetpack EULA</license>
<url type="website">https://developer.nvidia.com/blog/accelerating-ai-modules-for-ros-and-ros-2-on-jetson/</url>
<author>Ethan Yu</author>
<author>Kajanan Chinniah</author>

<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
<depend>image_transport</depend>
<depend>cv_bridge</depend>
<depend>isaac_ros_nvengine_interfaces</depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
22 changes: 22 additions & 0 deletions isaac_ros_dnn_encoders/src/dnn_image_encoder_main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
*
* NVIDIA CORPORATION and its licensors retain all intellectual property
* and proprietary rights in and to this software, related documentation
* and any modifications thereto. Any use, reproduction, disclosure or
* distribution of this software and related documentation without an express
* license agreement from NVIDIA CORPORATION is strictly prohibited.
*/

#include <rclcpp/rclcpp.hpp>
#include <memory>
#include "isaac_ros_dnn_encoders/dnn_image_encoder_node.hpp"

int main(int argc, char * argv[])
{
rclcpp::init(argc, argv);
rclcpp::NodeOptions options;
rclcpp::spin(std::make_shared<isaac_ros::dnn_inference::DnnImageEncoderNode>(options));
rclcpp::shutdown();
return 0;
}
Loading

0 comments on commit fe1395b

Please sign in to comment.