Skip to content

Commit

Permalink
Merge pull request #16 from NVIDIA-ISAAC-ROS/release-dp3
Browse files Browse the repository at this point in the history
Isaac ROS 0.30.0 (DP3)
  • Loading branch information
jaiveersinghNV authored Apr 6, 2023
2 parents 461ed11 + a680043 commit 7c30f52
Show file tree
Hide file tree
Showing 22 changed files with 1,293 additions and 64 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Ignore Python files in linguist
*.py linguist-detectable=false

# Images
*.gif filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
Expand All @@ -17,6 +20,7 @@
*.so.* filter=lfs diff=lfs merge=lfs -text

# ROS Bags
**/resources/**/*.zstd filter=lfs diff=lfs merge=lfs -text
**/resources/**/*.db3 filter=lfs diff=lfs merge=lfs -text
**/resources/**/*.yaml filter=lfs diff=lfs merge=lfs -text

Expand Down
64 changes: 39 additions & 25 deletions README.md

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions docs/tutorial-isaac-sim.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

## Overview

This tutorial walks you through a pipeline for [Image Segmentation](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_image_segmentation) of people using images from Isaac Sim.
This tutorial walks you through a graph for [Image Segmentation](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_image_segmentation) of people using images from Isaac Sim.

Last validated with [Isaac Sim 2022.1.0](https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/release_notes.html#id10).

## Tutorial Walkthrough

Expand All @@ -29,7 +31,7 @@ This tutorial walks you through a pipeline for [Image Segmentation](https://gith
`omniverse://localhost/NVIDIA/Assets/Isaac/2022.1/Isaac/Samples/ROS2/Scenario/carter_warehouse_apriltags_worker.usd`.

And wait for it to load completely.
> **Note:** To use a different server, replace `localhost` with `<your_nucleus_server>`
> **Note**: To use a different server, replace `localhost` with `<your_nucleus_server>`
6. Go to the stage tab and select `/World/Carter_ROS`, then in properties tab -> Transform -> Translate -> X change `-3.0` to `0.0`.
<div align="center"><img src="../resources/Isaac_sim_set_carter.png" width="400px"/></div>

Expand Down Expand Up @@ -59,4 +61,4 @@ This tutorial walks you through a pipeline for [Image Segmentation](https://gith

Then inside the `rqt_image_view` GUI, change the topic to `/unet/colored_segmentation_mask` to view a colorized segmentation mask.

**Note:** The raw segmentation is also published to `/unet/raw_segmentation_mask`. However, the raw pixels correspond to the class labels and so the output is unsuitable for human visual inspection.
**Note**: The raw segmentation is also published to `/unet/raw_segmentation_mask`. However, the raw pixels correspond to the class labels and so the output is unsuitable for human visual inspection.
41 changes: 10 additions & 31 deletions isaac_ros_unet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,52 +15,31 @@
#
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.23.2)
project(isaac_ros_unet LANGUAGES C CXX)

# 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()

# Default to Release build
if(NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
endif()
message( STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}" )

execute_process(COMMAND uname -m COMMAND tr -d '\n'
OUTPUT_VARIABLE ARCHITECTURE
)
message( STATUS "Architecture: ${ARCHITECTURE}" )

find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()

# Dependencies
enable_language(CUDA)

# Decoder node
ament_auto_add_library(unet_decoder_node SHARED src/unet_decoder_node.cpp)
target_compile_definitions(unet_decoder_node
PRIVATE "COMPOSITION_BUILDING_DLL"
)
rclcpp_components_register_nodes(unet_decoder_node "nvidia::isaac_ros::unet::UNetDecoderNode")
set(node_plugins "${node_plugins}nvidia::isaac_ros::unet::UNetDecoderNode;$<TARGET_FILE:unet_decoder_node>\n")

# Install config directory
install(
DIRECTORY config
DESTINATION share/${PROJECT_NAME}
)
### Install extensions built from source

install(TARGETS unet_decoder_node
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
# Segmentation Postprocessor
add_subdirectory(gxf/image_segmentation)
install(TARGETS gxf_segmentation_postprocessor DESTINATION share/${PROJECT_NAME}/gxf)

### End extensions

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
Expand All @@ -70,4 +49,4 @@ if(BUILD_TESTING)
add_launch_test(test/isaac_ros_unet_pol_test.py TIMEOUT "400")
endif()

ament_auto_package(INSTALL_TO_SHARE launch)
ament_auto_package(INSTALL_TO_SHARE config launch)
Empty file added isaac_ros_unet/gxf/AMENT_IGNORE
Empty file.
66 changes: 66 additions & 0 deletions isaac_ros_unet/gxf/image_segmentation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# 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.
# 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

project(gxf_segmentation_postprocessor LANGUAGES C CXX)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-fPIC -w)
endif()

# Dependencies
find_package(CUDAToolkit)
find_package(GXF ${ISAAC_ROS_GXF_VERSION} MODULE REQUIRED
COMPONENTS
core
cuda
multimedia
serialization
std
)
include(YamlCpp)

# Create extension
add_library(gxf_segmentation_postprocessor SHARED
segmentation_mask_colorizer.cpp
segmentation_mask_colorizer.hpp
segmentation_postprocessing_utils.hpp
segmentation_postprocessor_ext.cpp
segmentation_postprocessor.cpp
segmentation_postprocessor.hpp
segmentation_postprocessor.cu.cpp
segmentation_postprocessor.cu.hpp
segmentation_mask_colorizer.cu.cpp
segmentation_mask_colorizer.cu.hpp
)

# Mark as CUDA files with non-standard extensions
set_source_files_properties(
segmentation_postprocessor.cu.cpp
segmentation_postprocessor.cu.hpp
segmentation_mask_colorizer.cu.cpp
segmentation_mask_colorizer.cu.hpp
PROPERTIES LANGUAGE CUDA
)

target_link_libraries(gxf_segmentation_postprocessor
PUBLIC
CUDA::cudart
GXF::cuda
GXF::multimedia
GXF::std
yaml-cpp
)
Loading

0 comments on commit 7c30f52

Please sign in to comment.