Skip to content

Commit

Permalink
Merge pull request #5 from NVIDIA-ISAAC-ROS/release-dp-1.1
Browse files Browse the repository at this point in the history
Isaac ROS 0.11.0 (DP1.1)
  • Loading branch information
hemalshahNV authored Sep 2, 2022
2 parents d51b520 + e6cd71b commit 2678112
Show file tree
Hide file tree
Showing 115 changed files with 4,803 additions and 424 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,18 @@ The NVIDIA implementation of type adaption and negotiation are called NITROS (NV


## Latest Update
Update 2022-06-30: Initial release
Update 2022-08-31: Update to be compatible with JetPack 5.0.2


## Supported Platforms
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.

> **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.

| Platform | Hardware | Software | Notes |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 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. |
| 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. |
| x86_64 | NVIDIA GPU | [Ubuntu 20.04+](https://releases.ubuntu.com/20.04/) <br> [CUDA 11.6.1+](https://developer.nvidia.com/cuda-downloads) |


Expand Down Expand Up @@ -183,6 +185,7 @@ Please visit the link below for an example graph that consists of NITROS-acceler

## Updates

| Date | Changes |
| ---------- | --------------- |
| 2022-06-30 | Initial release |
| Date | Changes |
| ---------- | ------------------------------------------ |
| 2022-08-31 | Update to be compatible with JetPack 5.0.2 |
| 2022-06-30 | Initial release |
33 changes: 10 additions & 23 deletions isaac_ros_nitros/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,66 +32,59 @@ message( STATUS "Architecture: ${ARCHITECTURE}" )
find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()


# Eigen3
find_package(Eigen3 3.3 REQUIRED NO_MODULE)


# GXF
include_directories(gxf/include)
include_directories(gxf/include/extensions/fiducials)
include_directories(gxf/include/third_party)
add_library(gxf SHARED IMPORTED)
add_library(gxf_std SHARED IMPORTED)
add_library(gxf_multimedia SHARED IMPORTED) # for NitrosImage
add_library(optimizer SHARED IMPORTED)
add_library(fiducials SHARED IMPORTED)
if( ${ARCHITECTURE} STREQUAL "x86_64" )
set_property(TARGET gxf PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/gxf/lib/gxf_x86_64/core/libgxf_core.so)
set_property(TARGET gxf_std PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/gxf/lib/gxf_x86_64/std/libgxf_std.so)
set_property(
TARGET gxf_multimedia PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/gxf/lib/gxf_x86_64/multimedia/libgxf_multimedia.so)
set_property(TARGET optimizer PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/gxf/lib/gxf_x86_64/libgxf_optimizer.so)
set_property(TARGET fiducials PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/gxf/lib/gxf_x86_64/libgxf_fiducials.so)
elseif( ${ARCHITECTURE} STREQUAL "aarch64" )
set_property(TARGET gxf PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/gxf/lib/gxf_jetpack50/core/libgxf_core.so)
set_property(TARGET gxf_std PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/gxf/lib/gxf_jetpack50/std/libgxf_std.so)
set_property(
TARGET gxf_multimedia PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/gxf/lib/gxf_jetpack50/multimedia/libgxf_multimedia.so)
set_property(TARGET optimizer PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/gxf/lib/gxf_jetpack50/libgxf_optimizer.so)
set_property(TARGET fiducials PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/gxf/lib/gxf_jetpack50/libgxf_fiducials.so)
endif()


# for #include <cuda_runtime.h>
find_package(CUDA REQUIRED)
include_directories("${CUDA_INCLUDE_DIRS}")

option(USE_NVTX "Enable NVTX markers for improved profiling (if available)" OFF)
option(USE_NVTX "Enable NVTX markers for improved profiling (if available)" ON)
if(USE_NVTX)
add_definitions(-DUSE_NVTX)
link_directories("${CUDA_TOOLKIT_ROOT_DIR}/lib64")
link_libraries("nvToolsExt")
endif()


# NitrosNode
ament_auto_add_library(isaac_ros_nitros SHARED
src/nitros_node.cpp
src/nitros_context.cpp
src/types/type_adapter_nitros_context.cpp
src/types/type_utility.cpp
src/types/nitros_type_base.cpp
src/types/nitros_camera_info.cpp
src/types/nitros_image.cpp
src/types/nitros_disparity_image.cpp
src/types/nitros_int64.cpp
src/types/nitros_tensor_list.cpp
src/types/nitros_point_cloud.cpp
src/types/nitros_april_tag_detection_array.cpp
src/nitros_publisher.cpp
src/nitros_subscriber.cpp
src/nitros_publisher_subscriber_group.cpp)
target_compile_definitions(isaac_ros_nitros
PRIVATE "COMPOSITION_BUILDING_DLL"
)
target_link_libraries(isaac_ros_nitros gxf gxf_std gxf_multimedia optimizer fiducials Eigen3::Eigen)
target_link_libraries(isaac_ros_nitros gxf gxf_multimedia optimizer Eigen3::Eigen)
# For the NitrosNode test node
rclcpp_components_register_node(isaac_ros_nitros
PLUGIN "nvidia::isaac_ros::nitros::NitrosNode"
Expand All @@ -107,14 +100,14 @@ install(
DIRECTORY gxf/include/
DESTINATION include/
)
# Fiducials headers
# GXF third party headers
install(
DIRECTORY gxf/include/extensions/fiducials/
DIRECTORY gxf/include/third_party/
DESTINATION include/
)
# GXF third party headers
# Isaac headers
install(
DIRECTORY gxf/include/third_party/
DIRECTORY gxf/include/extensions/isaac/
DESTINATION include/
)
ament_export_include_directories("include")
Expand Down Expand Up @@ -152,12 +145,6 @@ if(BUILD_TESTING)

find_package(launch_testing_ament_cmake REQUIRED)
add_launch_test(test/isaac_ros_nitros_test_pol.py TIMEOUT "15")
add_launch_test(test/isaac_ros_nitros_tensor_list_test_pol.py TIMEOUT "15")
add_launch_test(test/isaac_ros_nitros_image_test_pol.py TIMEOUT "15")
add_launch_test(test/isaac_ros_nitros_camera_info_test_pol.py TIMEOUT "15")
add_launch_test(test/isaac_ros_nitros_disparity_image_test_pol.py TIMEOUT "15")
add_launch_test(test/isaac_ros_nitros_point_cloud_test_pol.py TIMEOUT "15")
add_launch_test(test/isaac_ros_nitros_april_tag_detection_array_test_pol.py TIMEOUT "15")
endif()

ament_auto_package()
3 changes: 3 additions & 0 deletions isaac_ros_nitros/gxf/lib/gxf_jetpack50/libgxf_image_flip.so
Git LFS file not shown
4 changes: 2 additions & 2 deletions isaac_ros_nitros/gxf/lib/gxf_jetpack50/libgxf_optimizer.so
Git LFS file not shown

This file was deleted.

3 changes: 3 additions & 0 deletions isaac_ros_nitros/gxf/lib/gxf_x86_64/libgxf_image_flip.so
Git LFS file not shown
4 changes: 2 additions & 2 deletions isaac_ros_nitros/gxf/lib/gxf_x86_64/libgxf_optimizer.so
Git LFS file not shown
3 changes: 0 additions & 3 deletions isaac_ros_nitros/gxf/lib/gxf_x86_64/libgxf_test_fiducials.so

This file was deleted.

10 changes: 10 additions & 0 deletions isaac_ros_nitros/include/isaac_ros_nitros/nitros_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ class NitrosNode : public rclcpp::Node
// Set the graph YAML file to be loaded
void setAppYamlFilename(std::string package_relative_filepath);

// Register a supported type
template<typename T>
void registerSupportedType()
{
nitros_type_manager_->registerSupportedType<T>();
}

// A list of I/O port groups
GraphIOGroupSupportedDataTypesInfoList gxf_io_group_info_list_;

Expand Down Expand Up @@ -205,6 +212,9 @@ class NitrosNode : public rclcpp::Node

// Map for frame_id passthrough
std::shared_ptr<std::map<ComponentKey, std::string>> frame_id_map_ptr_;

// Nitros type manager
std::shared_ptr<NitrosTypeManager> nitros_type_manager_;
};

} // namespace nitros
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class NitrosPublisher : public NitrosPublisherSubscriberBase
// Constructor
NitrosPublisher(
rclcpp::Node & node,
std::shared_ptr<NitrosTypeManager> nitros_type_manager,
const gxf::optimizer::ComponentInfo & gxf_component_info,
const std::vector<std::string> & supported_data_formats,
const NitrosPublisherSubscriberConfig & config,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "extensions/gxf_optimizer/exporter/graph_types.hpp"
#include "gxf/core/gxf.h"
#include "isaac_ros_nitros/types/nitros_type_base.hpp"
#include "isaac_ros_nitros/types/nitros_type_manager.hpp"

#include "rclcpp/rclcpp.hpp"

Expand Down Expand Up @@ -76,10 +77,12 @@ class NitrosPublisherSubscriberBase
// Constructor
NitrosPublisherSubscriberBase(
rclcpp::Node & node,
std::shared_ptr<NitrosTypeManager> nitros_type_manager,
const gxf::optimizer::ComponentInfo & gxf_component_info,
const std::vector<std::string> & supported_data_formats,
const NitrosPublisherSubscriberConfig & config)
: node_(node),
nitros_type_manager_(nitros_type_manager),
gxf_component_info_(gxf_component_info),
supported_data_formats_(supported_data_formats),
config_(config) {}
Expand Down Expand Up @@ -149,6 +152,9 @@ class NitrosPublisherSubscriberBase
// The parent GXF context
gxf_context_t context_;

// Nitros type manager
std::shared_ptr<NitrosTypeManager> nitros_type_manager_;

// The info of the GXF component that's associated to this Nitros publisher/subscriber
gxf::optimizer::ComponentInfo gxf_component_info_;

Expand All @@ -161,6 +167,7 @@ class NitrosPublisherSubscriberBase
// Negotiated data format
std::string negotiated_data_format_;

// Frame ID map
std::shared_ptr<std::map<gxf::optimizer::ComponentKey, std::string>> frame_id_map_ptr_;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class NitrosPublisherSubscriberGroup
// Constructor
NitrosPublisherSubscriberGroup(
rclcpp::Node & node,
std::shared_ptr<NitrosTypeManager> nitros_type_manager,
const gxf::optimizer::GraphIOGroupSupportedDataTypesInfo & gxf_io_supported_data_formats_info,
const NitrosPublisherSubscriberConfigMap & nitros_pub_sub_configs,
const std::shared_ptr<std::map<ComponentKey, std::string>> frame_id_map_ptr);
Expand Down Expand Up @@ -126,6 +127,9 @@ class NitrosPublisherSubscriberGroup
// Get all publisher/subscriber component infos
std::vector<gxf::optimizer::ComponentInfo> getAllComponentInfos() const;

// Expand "any" format in gxf_io_supported_data_formats_info_ with registered formats
void expandAnyDataFormats();

// For each component that has .use_compatible_format_only as true, remove all supported
// formats except for the compatible format
bool applyUseCompatibleFormatOnly();
Expand Down Expand Up @@ -153,6 +157,9 @@ class NitrosPublisherSubscriberGroup
// The ROS node that holds this group
rclcpp::Node & node_;

// Nitros type manager
std::shared_ptr<NitrosTypeManager> nitros_type_manager_;

// GXF graph information
gxf::optimizer::GraphIOGroupSupportedDataTypesInfo gxf_io_supported_data_formats_info_;

Expand All @@ -163,6 +170,7 @@ class NitrosPublisherSubscriberGroup
std::vector<std::shared_ptr<NitrosPublisher>> nitros_pubs_;
std::vector<std::shared_ptr<NitrosSubscriber>> nitros_subs_;

// Frame ID map
std::shared_ptr<std::map<ComponentKey, std::string>> frame_id_map_ptr_;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class NitrosSubscriber : public NitrosPublisherSubscriberBase
// Constructor
NitrosSubscriber(
rclcpp::Node & node,
std::shared_ptr<NitrosTypeManager> nitros_type_manager,
const gxf::optimizer::ComponentInfo & gxf_component_info,
const std::vector<std::string> & supported_data_formats,
const NitrosPublisherSubscriberConfig & config);
Expand Down Expand Up @@ -68,9 +69,8 @@ class NitrosSubscriber : public NitrosPublisherSubscriberBase
bool pushEntity(const int64_t eid);

// The subscriber callback
template<typename T>
void subscriberCallback(
const std::shared_ptr<T> msg,
NitrosTypeBase & msg_base,
const std::string data_format_name);

private:
Expand Down
Loading

0 comments on commit 2678112

Please sign in to comment.