Skip to content

Commit

Permalink
Merge pull request #2 from NVIDIA-ISAAC-ROS/release-2.1
Browse files Browse the repository at this point in the history
Isaac ROS 2.1.0
  • Loading branch information
hemalshahNV authored Nov 17, 2023
2 parents 161b58d + a65c299 commit bb1ec5c
Show file tree
Hide file tree
Showing 8 changed files with 181 additions and 3 deletions.
9 changes: 9 additions & 0 deletions config/nitros_bridge_no_namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
topics:
-
topic: /ros1_input_bridge_image # Topic name for ros1 bridge
type: isaac_ros_nitros_bridge_interfaces/msg/NitrosBridgeImage # Type type for ros1 bridge
queue_size: 10
-
topic: /ros1_output_bridge_image # Topic name for ros1 bridge
type: isaac_ros_nitros_bridge_interfaces/msg/NitrosBridgeImage # Type type for ros1 bridge
queue_size: 10
1 change: 1 addition & 0 deletions isaac_ros_nitros_bridge_ros1/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ install(TARGETS isaac_ros_nitros_bridge_ros1

install(FILES
launch/r2b_converter.launch
launch/isaac_ros_image_converter.launch
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0"?>

<!--
SPDX-FileCopyrightText: Copyright (c) 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
-->

<launch>
<node pkg="nodelet"
type="nodelet"
name="standalone_nodelet"
args="manager"
output="screen"/>
<remap from="/ImageConverterNode/ros1_input_image" to="/image"/>
<remap from="/ImageConverterNode/ros1_output_image" to="/ros1_output_image"/>
<remap from="/ImageConverterNode/ros1_input_bridge_image" to="/ros1_input_bridge_image"/>
<remap from="/ImageConverterNode/ros1_output_bridge_image" to="/ros1_output_bridge_image"/>
<node pkg="nodelet"
type="nodelet"
name="ImageConverterNode"
args="load isaac_ros_nitros_bridge_ros1/ImageConverterNode standalone_nodelet"
output="screen"/>
</launch>
2 changes: 1 addition & 1 deletion isaac_ros_nitros_bridge_ros1/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<package format="2">
<name>isaac_ros_nitros_bridge_ros1</name>
<version>2.0.0</version>
<version>2.1.0</version>
<description>Converter between NITROS bridge messages and ROS1 messages</description>
<maintainer email="[email protected]">Yuankun Zhu</maintainer>
<license>Apache-2.0</license>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 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

import os
import subprocess
import time

import launch

from launch.actions import DeclareLaunchArgument, OpaqueFunction
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import ComposableNodeContainer
from launch_ros.descriptions import ComposableNode
import launch_testing.actions

ROS1_INSTALL_PATH = 'install_isolated/setup.bash'
BRIDGE_CONFIG_PATH = 'src/isaac_ros_nitros_bridge/config/nitros_bridge_no_namespace.yaml'


def launch_setup(context):
ros1_ws_path = LaunchConfiguration('ros1_ws_path').perform(context)
pub_image_name = LaunchConfiguration('pub_image_name').perform(context)
sub_image_name = LaunchConfiguration('sub_image_name').perform(context)

roscore_cmd = 'source /opt/ros/noetic/setup.bash && roscore'
subprocess.Popen(
roscore_cmd,
env=os.environ,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=True,
executable='/bin/bash'
)
# Wait one second to ensure roscore is fully launched
time.sleep(1)

ros1_setup_path = os.path.join(ros1_ws_path, ROS1_INSTALL_PATH)
stop_ros_nodes_cmd = f'source {ros1_setup_path} && rosnode kill -a'
subprocess.run(
stop_ros_nodes_cmd,
env=os.environ,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=True,
executable='/bin/bash'
)

bridge_config_absolute_path = os.path.join(ros1_ws_path, BRIDGE_CONFIG_PATH)
ros1_converter_cmd = f'source {ros1_setup_path} \
&& rosparam load {bridge_config_absolute_path} \
&& roslaunch isaac_ros_nitros_bridge_ros1 isaac_ros_image_converter.launch'
subprocess.Popen(
ros1_converter_cmd,
env=os.environ,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=True,
executable='/bin/bash'
)

ros1_bridge_cmd = 'ros2 run ros1_bridge parameter_bridge'
subprocess.Popen(
ros1_bridge_cmd,
env=os.environ,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=True
)

ros2_converter = ComposableNode(
name='ros2_converter',
namespace='',
package='isaac_ros_nitros_bridge_ros2',
plugin='nvidia::isaac_ros::nitros_bridge::ImageConverterNode',
remappings=[
('ros2_output_bridge_image', 'ros1_input_bridge_image'),
('ros2_output_image', pub_image_name),
('ros2_input_bridge_image', 'ros1_output_bridge_image'),
('ros2_input_image', sub_image_name),
])

container = ComposableNodeContainer(
name='ros2_converter_container',
namespace='',
package='rclcpp_components',
executable='component_container_mt',
composable_node_descriptions=[ros2_converter],
output='screen',
arguments=['--ros-args', '--log-level', 'info']
)
return [container]


def generate_launch_description():
launch_args = [
DeclareLaunchArgument(
'ros1_ws_path',
description='Path of the ros1 workspace'),
DeclareLaunchArgument(
'pub_image_name',
description='Path of the ros1 workspace'),
DeclareLaunchArgument(
'sub_image_name',
description='Path of the ros1 workspace'),
]

nodes = launch_args + [OpaqueFunction(function=launch_setup)]
return launch.LaunchDescription(
nodes + [
# Start tests after a fixed delay for node startup
launch.actions.TimerAction(
period=30.0,
actions=[launch_testing.actions.ReadyToTest()])
]
)
2 changes: 1 addition & 1 deletion isaac_ros_nitros_bridge_ros2/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,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_nitros_bridge_ros2</name>
<version>2.0.0</version>
<version>2.1.0</version>
<description>Converter between NITROS bridge messages and ROS 2 messages</description>

<maintainer email="[email protected]">Yuankun Zhu</maintainer>
Expand Down
3 changes: 3 additions & 0 deletions resources/unet_sample_data_ros1.bag
Git LFS file not shown
2 changes: 1 addition & 1 deletion utils/isaac_ros_ros1_forward/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<package format="2">
<name>isaac_ros_ros1_forward</name>
<version>2.0.0</version>
<version>2.1.0</version>
<description>Forward ROS1 Messages</description>
<maintainer email="[email protected]">Yuankun Zhu</maintainer>
<license>Apache-2.0</license>
Expand Down

0 comments on commit bb1ec5c

Please sign in to comment.