Difference between revisions of "Advantech Robotic Suite/ros1 bridge"
Eric.liang (talk | contribs) (→Notice) |
|||
(7 intermediate revisions by 3 users not shown) | |||
Line 6: | Line 6: | ||
= Prerequisite = | = Prerequisite = | ||
− | Please make sure that ROS1 and ROS2( [https://www.advantech.com/en/form/11905901-d135-4dc1-a72d-0450b233d62e?callback=2af806b3-06a3-4f48-9edb-555899ff4da6 | + | Please make sure that ROS1 and ROS2( [https://www.advantech.com/en/form/11905901-d135-4dc1-a72d-0450b233d62e?callback=2af806b3-06a3-4f48-9edb-555899ff4da6 Advantech Robotic Suite]) have been installed in your environment, for example, ROS1 (Noetic) and ROS2 (Foxy) in Ubuntu 20.04. |
= Installation= | = Installation= | ||
<syntaxhighlight lang="bash">$ sudo apt-get install ros-foxy-ros1-bridge</syntaxhighlight> | <syntaxhighlight lang="bash">$ sudo apt-get install ros-foxy-ros1-bridge</syntaxhighlight> | ||
Line 24: | Line 24: | ||
*<span style="font-size:larger;">'''Bidirectional'''</span> | *<span style="font-size:larger;">'''Bidirectional'''</span> | ||
− | |||
− | |||
<syntaxhighlight lang="bash">$ ros2 run ros1_bridge dynamic_bridge --bridge-all-topics</syntaxhighlight> | <syntaxhighlight lang="bash">$ ros2 run ros1_bridge dynamic_bridge --bridge-all-topics</syntaxhighlight> | ||
*'''<span style="font-size:larger;">Unidirectional:</span>''' '''<span style="font-size:large;">ROS1 to ROS2 </span>''' | *'''<span style="font-size:larger;">Unidirectional:</span>''' '''<span style="font-size:large;">ROS1 to ROS2 </span>''' | ||
− | |||
− | |||
<syntaxhighlight lang="bash">$ ros2 run ros1_bridge dynamic_bridge --bridge-all-1to2-topics</syntaxhighlight> | <syntaxhighlight lang="bash">$ ros2 run ros1_bridge dynamic_bridge --bridge-all-1to2-topics</syntaxhighlight> | ||
*'''<span style="font-size:larger;">Unidirectional: ROS2 to ROS1 </span>''' | *'''<span style="font-size:larger;">Unidirectional: ROS2 to ROS1 </span>''' | ||
− | |||
− | |||
<syntaxhighlight lang="bash">$ ros2 run ros1_bridge dynamic_bridge --bridge-all-2to1-topics</syntaxhighlight> | <syntaxhighlight lang="bash">$ ros2 run ros1_bridge dynamic_bridge --bridge-all-2to1-topics</syntaxhighlight> | ||
Line 42: | Line 36: | ||
The <code>parameter_bridge</code> can bridge only selected topics and services by using a YAML file.<br/> For example, only bridge a topic called /chatter [[File:ROS2 Suite ros1-bridge.png|center|900x600px|ROS2 Suite ros1-bridge]] How to use <code>parameter_bridge</code> can refer to [https://github.com/ros2/ros1_bridge#example-4-bridge-only-selected-topics-and-services parameter_bridge] | The <code>parameter_bridge</code> can bridge only selected topics and services by using a YAML file.<br/> For example, only bridge a topic called /chatter [[File:ROS2 Suite ros1-bridge.png|center|900x600px|ROS2 Suite ros1-bridge]] How to use <code>parameter_bridge</code> can refer to [https://github.com/ros2/ros1_bridge#example-4-bridge-only-selected-topics-and-services 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 [https://github.com/ros2/ros1_bridge#parametrizing-quality-of-service parametrizing-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 [https://github.com/ros2/ros1_bridge#parametrizing-quality-of-service parametrizing-quality-of-service] | ||
− | |||
= Notice = | = Notice = |
Latest revision as of 04:08, 5 March 2024
Contents
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
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
Theparameter_bridge
can bridge only selected topics and services by using a YAML file.For example, only bridge a topic called /chatter 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).
- Latency and CPU usage: ROSCon'22 - Migrating from ROS1 to ROS2(4:28)
- 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.