Advantech Robotic Suite/ros1 bridge

From ESS-WIKI
(Redirected from Robotic Dev SDK/ros1 bridge)
Jump to: navigation, search

Introduction

To port ROS 1 to ROS 2, the ROS 1 Bridge tool can be used. This tool enables message communication between ROS 1 and ROS 2, allowing nodes from ROS 1 to communicate with nodes from ROS 2 and enabling the use of ROS 1 nodes in ROS 2.
Github: ros1-bridge

Prerequisite

Please make sure that ROS1 and ROS2( Advantech Robotic Suite) have been installed in your environment, for example, ROS1 (Noetic) and ROS2 (Foxy) in Ubuntu 20.04.

Installation

$ sudo apt-get install ros-foxy-ros1-bridge

How To

Step1: Confrim Converting Message Format

You can list all ros1_bridge supported data type by following command to confirm that the data format you want to convert to is supported.

$ ros2 run ros1_bridge dynamic_bridge --print-pairs

ros1-bridge-format

Step 2: Run the Dynamic_bridge

The dynamic_bridge will watch the available ROS 1 and ROS 2 topics, once a matching topic has been detected it starts to bridge the messages on this topic.

  • Bidirectional
$ ros2 run ros1_bridge dynamic_bridge --bridge-all-topics
  • Unidirectional: ROS1 to ROS2 
$ ros2 run ros1_bridge dynamic_bridge --bridge-all-1to2-topics
  • Unidirectional: ROS2 to ROS1 
$ ros2 run ros1_bridge dynamic_bridge --bridge-all-2to1-topics

Advanced

Parameter_bridge

The parameter_bridge can bridge only selected topics and services by using a YAML file.
For example, only bridge a topic called /chatter
ROS2 Suite ros1-bridge
How to use parameter_bridge can refer to parameter_bridge

Quality of Service

It also can define different Quality of Service(QoS) settings per topic, for instructions on how to do this, please refer to parametrizing-quality-of-service

Notice

   The ROS1 bridge provides a convenient way to achieve data communication between ROS1 and ROS2. However, it is NOT Recommended to use the bridge in high-frequency or large data scenarios. In such cases, it is recommended directly porting your ROS1 node to ROS2 node.

You must consider these issues when exchanging ROS1 data to ROS2 by the ros1 bridge.

  • Latency : The ROS 1 Bridge will perform message format conversion, which can result in latency
  • CPU Usage: The ROS 1 Bridge will perform message format conversion, which can result in CPU usage.
  • Data Lost: It may drops message due to the message transmission required by the ROS 1 Bridge.

Here are some experiences for your reference.

Some users have also mentioned in Github Issues that there are latency issues when using TF or large datasets (such as pointcloud and image).
During the ROSCon'22 speech, it was mentioned that using ros1-bridge can cause issues such as high latency and CPU usage. The following chart compares the differences between using and not using ros1-bridge, which clearly shows the difference. For detail please visit the website to watch the speech.
ros1-bridge-latency-cpu