Skip to content

Commit

Permalink
Merge pull request #73 from NVIDIA-ISAAC-ROS/release-dp3.1
Browse files Browse the repository at this point in the history
Isaac ROS 0.31.0 (DP3.1)
  • Loading branch information
hemalshahNV authored May 26, 2023
2 parents 88023df + 3020c40 commit b983487
Show file tree
Hide file tree
Showing 15 changed files with 110 additions and 31 deletions.
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Isaac ROS Common

## Latest Update

Update 2023-04-05: Merged 'Dockerfile.humble' and 'Dockerfile.nav2' into 'Dockerfile.ros2_humble' as image key 'ros2_humble'.

## Overview

The [Isaac ROS Common](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_common) repository contains a number of scripts and Dockerfiles to help streamline development and testing with the Isaac ROS suite.
Expand Down Expand Up @@ -37,7 +33,7 @@ If you write a file with the name `.isaac_ros_common-config` in the same directo

| Key | Type | Description | Examples |
| --------------------------- | -------------------- | ----------------------------------------------------------- | ------------------------------------- |
| `CONFIG_IMAGE_KEY` | String | Image key with period-delimited components | `ros2_humble.realsense` <br> `first.second.third` |
| `CONFIG_IMAGE_KEY` | String | Image key with period-delimited components | `ros2_humble.realsense` <br> `humble` |
| `CONFIG_DOCKER_SEARCH_DIRS` | Bash array of string | List of directories to search for Dockerfiles when matching | `($HOME/ros_ws/docker $HOME/docker)` |

For example, if you had the following directory structure:
Expand Down Expand Up @@ -92,7 +88,7 @@ This configures the image key to match with `mine` included and specifies where

## Latest Update

Update 2023-04-05: Experimental support for WSL2
Update 2023-05-25: Refreshed ROS 2 Humble.

## Supported Platforms

Expand All @@ -109,7 +105,8 @@ This package is designed and tested to be compatible with ROS 2 Humble running o

| Date | Changes |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 2023-04-05 | Experimental support for WSL2, merged image keys 'humble' and 'nav2' into 'ros2_humble' |
| 2023-05-25 | Refreshed ROS 2 Humble |
| 2023-04-05 | Experimental support for WSL2, merged image keys 'humble' and 'nav2' into 'ros2_humble' |
| 2022-10-19 | Minor updates and bugfixes |
| 2022-08-31 | Update to be compatible with JetPack 5.0.2 |
| 2022-06-30 | Support ROS 2 Humble and miscellaneous bug fixes. |
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.aarch64.ros2_humble
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.

FROM nvcr.io/nvidia/isaac/ros:aarch64-ros2_humble_c8ad2c6ecc68747eca2f1df62e25ae5e
FROM nvcr.io/nvidia/isaac/ros:aarch64-ros2_humble_33836e394da2d095a59afd2d151038f8
15 changes: 15 additions & 0 deletions docker/Dockerfile.ros2_humble
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,21 @@ RUN apt-get update && mkdir -p ${ROS_ROOT}/src && cd ${ROS_ROOT}/src \
&& source ${ROS_ROOT}/setup.bash && cd ${ROS_ROOT} \
&& rosdep install -y -r --ignore-src --from-paths src --rosdistro ${ROS_DISTRO} \
&& colcon build --merge-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo --packages-up-to image_proc \
&& echo "image_pipeline https://github.com/ros-perception/image_pipeline/pull/786" >> ${ROS_ROOT}/VERSION \
&& rm -Rf src build log \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

# Install patched rclcpp package with backported multithreadedexecutor fix
# https://github.com/ros2/rclcpp/commit/232262c02a1265830c7785b7547bd51e1124fcd8
RUN apt-get update && mkdir -p ${ROS_ROOT}/src && cd ${ROS_ROOT}/src \
&& git clone https://github.com/ros2/rclcpp.git && cd rclcpp && git checkout humble \
&& git config user.email "builder@nvidia.com" && git config user.name "NVIDIA Builder" \
&& git cherry-pick 232262c02a1265830c7785b7547bd51e1124fcd8 \
&& source ${ROS_ROOT}/setup.bash && cd ${ROS_ROOT} \
&& rosdep install -y -r --ignore-src --from-paths src --rosdistro ${ROS_DISTRO} \
&& colcon build --merge-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo --packages-up-to rclcpp \
&& echo "rclcpp https://github.com/ros2/rclcpp/commit/232262c02a1265830c7785b7547bd51e1124fcd8" >> ${ROS_ROOT}/VERSION \
&& rm -Rf src build log \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.x86_64.ros2_humble
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.

FROM nvcr.io/nvidia/isaac/ros:x86_64-ros2_humble_c59eda1b21db0e3c8f28c8d436ad1f4e
FROM nvcr.io/nvidia/isaac/ros:x86_64-ros2_humble_1930bbec7e7704243656b695b9df7844
2 changes: 1 addition & 1 deletion docker/scripts/build-librealsense.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export CUDACXX=$NVCC_PATH
export PATH=${PATH}:/usr/local/cuda/bin
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib64

/usr/bin/cmake ../ -DBUILD_EXAMPLES=true -DFORCE_RSUSB_BACKEND=false -DBUILD_WITH_CUDA="$USE_CUDA" -DCMAKE_BUILD_TYPE=release -DBUILD_PYTHON_BINDINGS=bool:true
/usr/bin/cmake ../ -DBUILD_EXAMPLES=true -DFORCE_RSUSB_BACKEND=true -DBUILD_WITH_CUDA="$USE_CUDA" -DCMAKE_BUILD_TYPE=release -DBUILD_PYTHON_BINDINGS=bool:true

# The library will be installed in /usr/local/lib, header files in /usr/local/include
# The demos, tutorials and tests will located in /usr/local/bin.
Expand Down
2 changes: 1 addition & 1 deletion isaac_ros_apriltag_interfaces/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license agreement from NVIDIA CORPORATION is strictly prohibited.
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>isaac_ros_apriltag_interfaces</name>
<version>0.30.0</version>
<version>0.31.0</version>
<description>Interfaces for performing Isaac ROS AprilTag detection</description>

<maintainer email="hemals@nvidia.com">Hemal Shah</maintainer>
Expand Down
2 changes: 1 addition & 1 deletion isaac_ros_bi3d_interfaces/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license agreement from NVIDIA CORPORATION is strictly prohibited.
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>isaac_ros_bi3d_interfaces</name>
<version>0.30.0</version>
<version>0.31.0</version>
<description>Interfaces for Isaac ROS Bi3D</description>

<maintainer email="hemals@nvidia.com">Hemal Shah</maintainer>
Expand Down
2 changes: 1 addition & 1 deletion isaac_ros_common/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ license agreement from NVIDIA CORPORATION is strictly prohibited.
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>isaac_ros_common</name>
<version>0.30.0</version>
<version>0.31.0</version>
<description>Utilities for performing common functions in Isaac ROS packages</description>

<maintainer email="hemals@nvidia.com">Hemal Shah</maintainer>
Expand Down
2 changes: 1 addition & 1 deletion isaac_ros_pointcloud_interfaces/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>isaac_ros_pointcloud_interfaces</name>
<version>0.30.0</version>
<version>0.31.0</version>
<description>Pointcloud interfaces for Isaac ROS NITROS</description>

<maintainer email="ashwinvk@nvidia.com">Ashwin Varghese Kuruttukulam</maintainer>
Expand Down
20 changes: 10 additions & 10 deletions isaac_ros_tensor_list_interfaces/msg/Tensor.msg
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ TensorShape shape

# Data type for tensor
# Use the following values to represent these data types:
# - 1: "uint8"
# - 2: "int8"
# - 3: "uint16"
# - 4: "int16"
# - 5: "uint32"
# - 6: "int32"
# - 7: "uint64"
# - 8: "int64"
# - 9: "float32"
# - 1: "int8"
# - 2: "uint8"
# - 3: "int16"
# - 4: "uint16"
# - 5: "int32"
# - 6: "uint32"
# - 7: "int64"
# - 8: "uint64"
# - 9: "float32"
# - 10: "float64"
int32 data_type

# Strides of tensor (byte size for each dimension)
uint64[] strides

# Data buffer
uint8[] data
uint8[] data
2 changes: 1 addition & 1 deletion isaac_ros_tensor_list_interfaces/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ license agreement from NVIDIA CORPORATION is strictly prohibited.
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>isaac_ros_tensor_list_interfaces</name>
<version>0.30.0</version>
<version>0.31.0</version>
<description>Interfaces for Isaac ROS tensor list</description>

<maintainer email="cyc@nvidia.com">CY Chen</maintainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ def test_messages_match(self) -> None:
while time.time() < end_time:
rclpy.spin_once(self.node, timeout_sec=0.1)

if all([
if all(
len(messages) >= MESSAGES_RECEIVED_COUNT
for messages in received_messages.values()
]):
):
done = True
break

Expand Down
72 changes: 69 additions & 3 deletions isaac_ros_test/isaac_ros_test/isaac_ros_base_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
import functools
from pathlib import Path
import time
from typing import Any, Callable, Dict, Iterable, Tuple
from typing import Any, Callable, Dict, Iterable, List, Tuple
import unittest

import cv2 # noqa: F401
from cv_bridge import CvBridge
import launch
import launch_testing.actions
from message_filters import Subscriber, TimeSynchronizer
import numpy as np
import rclpy
from rclpy.qos import QoSDurabilityPolicy, QoSProfile, QoSReliabilityPolicy
Expand Down Expand Up @@ -180,7 +181,8 @@ def assertImagesEqual(
"""
self.assertTupleEqual(actual.shape, expected.shape)
difference = np.linalg.norm(actual - expected)
# convert to int32 to prevent -ve overflow when input numpy array is of type uint8
difference = np.linalg.norm(actual.astype(np.int32) - expected.astype(np.int32))
threshold_pixels = threshold_fraction * actual.size * 255
self.assertLessEqual(
difference, threshold_pixels,
Expand Down Expand Up @@ -243,7 +245,9 @@ def callback(msg):
received_messages[topic].append(msg)
else:
self.assertTrue(topic not in received_messages,
f'Already received a message on topic {topic}!')
f'Already received a message on topic {topic}! \
To enable multiple messages on the same topic \
use the accept_multiple_messages flag')
received_messages[topic] = msg

return callback
Expand All @@ -257,6 +261,68 @@ def callback(msg):

return subscriptions

def create_exact_time_sync_logging_subscribers(
self,
subscription_requests: Iterable[Tuple[str, Any]],
received_messages: List[Any],
accept_multiple_messages: bool = False,
exact_time_sync_queue: int = 10,
add_received_message_timestamps: bool = False
) -> Iterable[Subscription]:
"""
Create subscribers that log time synced messages received to the passed-in dictionary.
Parameters
----------
subscription_requests : Iterable[Tuple[str, Any]]
List of topic names and topic types to subscribe to.
received_messages : List[Any]
Output list of synced messages
accept_multiple_messages : bool
Whether the generated subscription callbacks should accept multiple messages,
by default False
exact_time_sync_queue : int
The size of the time sync buffer queue.
add_received_message_timestamps : bool
Whether the generated subscription callbacks should add a timestamp to the messages,
by default False
Returns
-------
Iterable[Subscription]
List of subscribers, passing the unsubscribing responsibility to the caller
"""
def callback(*arg):
if accept_multiple_messages:
if add_received_message_timestamps:
received_messages.append((arg, time.time()))
else:
received_messages.append(arg)
else:
self.assertTrue(len(received_messages) == 0,
'Already received a syned message! \
To enable multiple messages on the same topic \
use the accept_multiple_messages flag')
if add_received_message_timestamps:
received_messages.append((arg, time.time()))
else:
received_messages.append(arg)

subscriptions = [Subscriber(self.node, msg_type, topic)
for topic, msg_type in subscription_requests]
ets = TimeSynchronizer(
subscriptions,
exact_time_sync_queue
)
ets.registerCallback(callback)

return subscriptions

def synchronize_timestamps(
self,
image: Image,
Expand Down
2 changes: 1 addition & 1 deletion isaac_ros_test/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ license agreement from NVIDIA CORPORATION is strictly prohibited.
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>isaac_ros_test</name>
<version>0.30.0</version>
<version>0.31.0</version>
<description>Isaac ROS testing utilities</description>

<maintainer email="hemals@nvidia.com">Hemal Shah</maintainer>
Expand Down
1 change: 1 addition & 0 deletions scripts/run_dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ DOCKER_ARGS+=("-e DISPLAY")
DOCKER_ARGS+=("-e NVIDIA_VISIBLE_DEVICES=all")
DOCKER_ARGS+=("-e NVIDIA_DRIVER_CAPABILITIES=all")
DOCKER_ARGS+=("-e FASTRTPS_DEFAULT_PROFILES_FILE=/usr/local/share/middleware_profiles/rtps_udp_profile.xml")
DOCKER_ARGS+=("-e ROS_DOMAIN_ID")

if [[ $PLATFORM == "aarch64" ]]; then
DOCKER_ARGS+=("-v /usr/bin/tegrastats:/usr/bin/tegrastats")
Expand Down

0 comments on commit b983487

Please sign in to comment.