Difference between revisions of "Advantech Robotic Suite/Time Sync Viewer"

From ESS-WIKI
Jump to: navigation, search
(remove .)
Line 1: Line 1:
<h1>Introduction</h1>
 
  
<p>&nbsp;</p>
+
= Introduction =
  
<pre class="fck_mw_nowiki">
+
&nbsp;
<nowiki>Time Sync Viewer</nowiki></pre>
+
<nowiki><nowiki>Time Sync Viewer</nowiki>
  
<p>is a time synchronization detection tool specifically designed for ROS2, provided as an rqt plugin. It is used to monitor and analyze the synchronization status of multi-sensor data in real time. In robotics applications, ensuring accurate time synchronization is crucial, as it directly affects the performance and stability of technologies such as SLAM, deep learning, and sensor fusion.</p>
+
</nowiki>
  
<pre class="fck_mw_nowiki">
+
is a time synchronization detection tool specifically designed for ROS2, provided as an rqt plugin. It is used to monitor and analyze the synchronization status of multi-sensor data in real time. In robotics applications, ensuring accurate time synchronization is crucial, as it directly affects the performance and stability of technologies such as SLAM, deep learning, and sensor fusion.
<nowiki>Time Sync Viewer</nowiki></pre>
+
<nowiki><nowiki>Time Sync Viewer</nowiki>
  
<p>provides synchronization detection, visual analysis, and detailed time statistics, helping developers quickly identify and resolve synchronization issues.</p>
+
</nowiki>
  
<p><b>Features and Advantages</b>:</p>
+
provides synchronization detection, visual analysis, and detailed time statistics, helping developers quickly identify and resolve synchronization issues.
  
<ul>
+
'''Features and Advantages''':
<li>Multi-Sensor Timestamps Visualization: Visually displays the timestamps of multiple sensors to help users check data alignment.</li>
 
<li>Time Synchronization Flag (sync_flag): Automatically triggers a flag when synchronization conditions are met, providing instant confirmation. <!--* Statistical Analysis: Calculates synchronization frequency, average time intervals, standard deviation, and other metrics to quantify performance.--></li>
 
<li>Sensor Check: Assists users in identifying hardware delays, network jitter, and data loss that may result in incomplete data.</li>
 
<li>Improved Sensor Fusion: Enhances data consistency and stability for applications such as SLAM, robotic arms, drones, and AMRs.</li>
 
</ul>
 
  
<p><font color="red">Note: Time Sync Viewer is only supported on Ubuntu 22.04</font></p>
+
*Multi-Sensor Timestamps Visualization: Visually displays the timestamps of multiple sensors to help users check data alignment.
 +
*Time Synchronization Flag (sync_flag): Automatically triggers a flag when synchronization conditions are met, providing instant confirmation. <!--* Statistical Analysis: Calculates synchronization frequency, average time intervals, standard deviation, and other metrics to quantify performance.-->  
 +
*Sensor Check: Assists users in identifying hardware delays, network jitter, and data loss that may result in incomplete data.
 +
*Improved Sensor Fusion: Enhances data consistency and stability for applications such as SLAM, robotic arms, drones, and AMRs.
  
<h2>GUI Description</h2>
+
<font color="red">Note: Time Sync Viewer is only supported on Ubuntu 22.04</font>
  
<p><i>Example Using Camera, IMU, and LiDAR</i></p>
+
== GUI Description ==
  
<ol>
+
''Example Using Camera, IMU, and LiDAR''
<li>Time Axis Display
 
<ul>
 
<li>The image displays the timestamps of different data streams (topics), where each horizontal line represents a topic. Examples include::
 
<ul>
 
<li>camera (camera image)</li>
 
<li>imu (IMU data)</li>
 
<li>lidar (LiDAR scan)</li>
 
<li>z_sync_flag (sync flag)</li>
 
</ul>
 
</li>
 
</ul>
 
</li>
 
<li>Synchronization Range
 
<ul>
 
<li>In this example, the
 
<pre class="fck_mw_nowiki">
 
<nowiki>sync_range</nowiki></pre>
 
</li>
 
</ul>
 
</li>
 
</ol>
 
  
<p>is configured with 2ms, meaning that data points arriving within this 2-millisecond window are considered synchronized.</p>
+
#Time Axis Display
 +
#*The image displays the timestamps of different data streams (topics), where each horizontal line represents a topic. Examples include::
 +
#**camera (camera image)
 +
#**imu (IMU data)
 +
#**lidar (LiDAR scan)
 +
#**z_sync_flag (sync flag)   
 +
#Synchronization Range
 +
#*In this example, the <nowiki><nowiki>sync_range</nowiki>
 +
</nowiki>  
  
<ol>
+
is configured with 2ms, meaning that data points arriving within this 2-millisecond window are considered synchronized.
<li>
 
<ul>
 
<li>On the time axis, when a synchronization event is triggered, a
 
<pre class="fck_mw_nowiki">
 
<nowiki>sync_flag</nowiki></pre>
 
</li>
 
</ul>
 
</li>
 
</ol>
 
  
<p>is marked.</p>
+
#
 +
#*On the time axis, when a synchronization event is triggered, a <nowiki><nowiki>sync_flag</nowiki>
 +
</nowiki>  
  
<ol>
+
is marked.
<li>Synchronization Analysis
 
<ul>
 
<li>When all sensor data points fall within the 2ms range, they are considered synchronized (sync).</li>
 
<li>The image displays multiple sync points, indicating that at those moments, the sensor data is properly synchronized.</li>
 
</ul>
 
</li>
 
</ol>
 
  
<p><img _fck_mw_filename="ROS2 time sync viewer 3.png" _fck_mw_origimgheight="209" _fck_mw_origimgwidth="1190" alt="ROS2_time_sync_viewer" src="/wiki/images/c/cd/ROS2_time_sync_viewer_3.png" style="vertical-align:middle;" title="ROS2_time_sync_viewer" width="1000" /></p>
+
#Synchronization Analysis
 +
#*When all sensor data points fall within the 2ms range, they are considered synchronized (sync).  
 +
#*The image displays multiple sync points, indicating that at those moments, the sensor data is properly synchronized.  
  
<h1>How to</h1>
+
<img _fck_mw_filename="ROS2 time sync viewer 3.png" _fck_mw_origimgheight="209" _fck_mw_origimgwidth="1190" alt="ROS2_time_sync_viewer" src="/wiki/images/c/cd/ROS2_time_sync_viewer_3.png" style="vertical-align:middle;" title="ROS2_time_sync_viewer" width="1000" />
  
<h2>Step</h2>
+
= How to =
  
<ul>
+
== Step ==
<li>Step 1: Publish fake sensor data, including camera, IMU, and LiDAR(you can also use actual sensors)</li>
 
</ul>
 
  
<dl>
+
*Step 1: Publish fake sensor data, including camera, IMU, and LiDAR(you can also use actual sensors)
<dd>In terminal 1, publish camera topic</dd>
 
</dl>
 
  
<pre>
+
:In terminal 1, publish camera topic
cd /usr/local/Advantech/ros/humble/ros2-timesync-viewer/test/fake_sensor
+
<pre>cd /usr/local/Advantech/ros/humble/ros2-timesync-viewer/test/fake_sensor
 
python3 camera.py
 
python3 camera.py
 
</pre>
 
</pre>
  
<dl>
+
:In terminal 2, publish lidar topic  
<dd>In terminal 2, publish lidar topic</dd>
+
<pre>cd /usr/local/Advantech/ros/humble/ros2-timesync-viewer/test/fake_sensor
</dl>
 
 
 
<pre>
 
cd /usr/local/Advantech/ros/humble/ros2-timesync-viewer/test/fake_sensor
 
 
python3 lidar.py
 
python3 lidar.py
 
</pre>
 
</pre>
  
<dl>
+
:In terminal 3, publish imu topic  
<dd>In terminal 3, publish imu topic</dd>
+
<pre>cd /usr/local/Advantech/ros/humble/ros2-timesync-viewer/test/fake_sensor
</dl>
 
 
 
<pre>
 
cd /usr/local/Advantech/ros/humble/ros2-timesync-viewer/test/fake_sensor
 
 
python3 imu.py
 
python3 imu.py
 
</pre>
 
</pre>
  
<ul>
+
*Step 2: Enter 127.0.0.1:8081 in the web browser, run Time Sync Viewer in Web UI, select "Utility" from the list on the left  
<li>Step 2: Enter 127.0.0.1:8081 in the web browser, run Time Sync Viewer in Web UI, select &quot;Utility&quot; from the list on the left.</li>
 
</ul>
 
  
<p><img _fck_mw_filename="Robotic-suite-quickstart-tutorials2 01.png" _fck_mw_location="none" _fck_mw_origimgheight="835" _fck_mw_origimgwidth="1780" alt="Robotic-suite-quickstart-tutorials2_01.png" class="fck_mw_none" src="/wiki/images/b/be/Robotic-suite-quickstart-tutorials2_01.png" style="vertical-align:middle;" title="Robotic-suite-quickstart-tutorials2_01.png" width="1000" /></p>
+
<img _fck_mw_filename="Robotic-suite-quickstart-tutorials2 01.png" _fck_mw_location="none" _fck_mw_origimgheight="835" _fck_mw_origimgwidth="1780" alt="Robotic-suite-quickstart-tutorials2_01.png" class="fck_mw_none" src="/wiki/images/b/be/Robotic-suite-quickstart-tutorials2_01.png" style="vertical-align:middle;" title="Robotic-suite-quickstart-tutorials2_01.png" width="1000" />
  
<ul>
+
*Step 3: Set <code>Sync Period</code> to a value between 1ms and 2000ms (default: 100ms)  
<li>Step 3: Set <code>Sync Period</code> to a value between 1ms and 2000ms (default: 100ms)</li>
 
</ul>
 
  
<p><img _fck_mw_filename="Robotic-suite-quickstart-tutorials2 07.png" _fck_mw_location="none" _fck_mw_origimgheight="864" _fck_mw_origimgwidth="1217" alt="Robotic-suite-quickstart-tutorials2_07.png" class="fck_mw_none" src="/wiki/images/7/71/Robotic-suite-quickstart-tutorials2_07.png" style="vertical-align:middle;" title="Robotic-suite-quickstart-tutorials2_07.png" width="1000" /></p>
+
<img _fck_mw_filename="Robotic-suite-quickstart-tutorials2 07.png" _fck_mw_location="none" _fck_mw_origimgheight="864" _fck_mw_origimgwidth="1217" alt="Robotic-suite-quickstart-tutorials2_07.png" class="fck_mw_none" src="/wiki/images/7/71/Robotic-suite-quickstart-tutorials2_07.png" style="vertical-align:middle;" title="Robotic-suite-quickstart-tutorials2_07.png" width="1000" />
  
<ul>
+
*Step 4: Click launch button, then will open <code>Time Sync Viewer</code> window  
<li>Step 4: Click launch button, then will open <code>Time Sync Viewer</code> window</li>
 
</ul>
 
  
<p><img _fck_mw_filename="Robotic-suite-quickstart-tutorials2 02.png" _fck_mw_location="none" _fck_mw_origimgheight="835" _fck_mw_origimgwidth="1780" alt="Robotic-suite-quickstart-tutorials2_02.png" class="fck_mw_none" src="/wiki/images/5/57/Robotic-suite-quickstart-tutorials2_02.png" style="vertical-align:middle;" title="Robotic-suite-quickstart-tutorials2_02.png" width="1000" /></p>
+
<img _fck_mw_filename="Robotic-suite-quickstart-tutorials2 02.png" _fck_mw_location="none" _fck_mw_origimgheight="835" _fck_mw_origimgwidth="1780" alt="Robotic-suite-quickstart-tutorials2_02.png" class="fck_mw_none" src="/wiki/images/5/57/Robotic-suite-quickstart-tutorials2_02.png" style="vertical-align:middle;" title="Robotic-suite-quickstart-tutorials2_02.png" width="1000" />
  
<ul>
+
*Step 5: Click start button  
<li>Step 5: Click start button</li>
 
</ul>
 
  
<p><img _fck_mw_filename="Robotic-suite-quickstart-tutorials2 03.png" _fck_mw_location="none" _fck_mw_origimgheight="267" _fck_mw_origimgwidth="1000" alt="Robotic-suite-quickstart-tutorials2_03.png" class="fck_mw_none" src="/wiki/images/6/6f/Robotic-suite-quickstart-tutorials2_03.png" style="vertical-align:middle;" title="Robotic-suite-quickstart-tutorials2_03.png" /></p>
+
<img _fck_mw_filename="Robotic-suite-quickstart-tutorials2 03.png" _fck_mw_location="none" _fck_mw_origimgheight="267" _fck_mw_origimgwidth="1000" alt="Robotic-suite-quickstart-tutorials2_03.png" class="fck_mw_none" src="/wiki/images/6/6f/Robotic-suite-quickstart-tutorials2_03.png" style="vertical-align:middle;" title="Robotic-suite-quickstart-tutorials2_03.png" />
  
<ul>
+
*Step 6: Select the topics that you want to view, then click OK  
<li>Step 6: Select the topics that you want to view, then click OK</li>
 
</ul>
 
  
<p><img _fck_mw_filename="ROS2 time sync viewer 2.png" _fck_mw_location="none" _fck_mw_origimgheight="689" _fck_mw_origimgwidth="477" alt="Robotic-suite-quickstart-tutorials2_04.png" class="fck_mw_none" src="/wiki/images/d/d9/ROS2_time_sync_viewer_2.png" style="vertical-align:middle;" title="Robotic-suite-quickstart-tutorials2_04.png" /></p>
+
<img _fck_mw_filename="ROS2 time sync viewer 2.png" _fck_mw_location="none" _fck_mw_origimgheight="689" _fck_mw_origimgwidth="477" alt="Robotic-suite-quickstart-tutorials2_04.png" class="fck_mw_none" src="/wiki/images/d/d9/ROS2_time_sync_viewer_2.png" style="vertical-align:middle;" title="Robotic-suite-quickstart-tutorials2_04.png" />
  
<ul>
+
*Result:  
<li>Result:</li>
 
</ul>
 
  
<p><img _fck_mw_filename="Robotic-suite-quickstart-tutorials2 05.png" _fck_mw_location="none" _fck_mw_origimgheight="333" _fck_mw_origimgwidth="1246" alt="Robotic-suite-quickstart-tutorials2_05.png" class="fck_mw_none" src="/wiki/images/b/b1/Robotic-suite-quickstart-tutorials2_05.png" style="vertical-align:middle;" title="Robotic-suite-quickstart-tutorials2_05.png" /></p>
+
<img _fck_mw_filename="Robotic-suite-quickstart-tutorials2 05.png" _fck_mw_location="none" _fck_mw_origimgheight="333" _fck_mw_origimgwidth="1246" alt="Robotic-suite-quickstart-tutorials2_05.png" class="fck_mw_none" src="/wiki/images/b/b1/Robotic-suite-quickstart-tutorials2_05.png" style="vertical-align:middle;" title="Robotic-suite-quickstart-tutorials2_05.png" />
  
<h2>Note</h2>
+
== Note ==
  
<p>1. Recommended to reopen the UI after using it for more than 5 hours to avoid lag.<br />
+
1. Recommended to reopen the UI after using it for more than 5 hours to avoid lag.<br/> 2. To verify a custom or specialized topic, you must first add a source command for the corresponding environment to the <code>.bashrc</code> file. This is a mechanism in ROS2 to ensure that the system loads the correct development environment and package paths, allowing the topic to function properly.<br/> 3. If the Time Sync Viewer UI fails to display, first check whether the current environment's <code>DISPLAY</code> parameter is set to <code>:0</code>, if not, update the <code>DISPLAY</code> variable in <code>/usr/local/Advantech/E2I/robotic-node-client/run.sh</code>, save the file, and then rerun the app.
2. To verify a custom or specialized topic, you must first add a source command for the corresponding environment to the <code>.bashrc</code> file. This is a mechanism in ROS2 to ensure that the system loads the correct development environment and package paths, allowing the topic to function properly.<br />
 
3. If the Time Sync Viewer UI fails to display, first check whether the current environment&#39;s <code>DISPLAY</code> parameter is set to <code>:0</code>, if not, update the <code>DISPLAY</code> variable in <code>/usr/local/Advantech/E2I/robotic-node-client/run.sh</code>, save the file, and then rerun the app.</p>
 
  
<p>&nbsp;</p>
+
&nbsp;
  
<p><!--
+
<!--
 
== Synchronization Statistics ==
 
== Synchronization Statistics ==
 
It provides detailed time synchronization statistics, including the Monitoring Metrics Description:
 
It provides detailed time synchronization statistics, including the Monitoring Metrics Description:
Line 189: Line 135:
 
Step 4: Result<br/>
 
Step 4: Result<br/>
 
[[File:ROS2_time_sync_viewer.png|none|ROS2_time_sync_viewer]]
 
[[File:ROS2_time_sync_viewer.png|none|ROS2_time_sync_viewer]]
--></p>
+
-->

Revision as of 06:57, 14 July 2025

Introduction

  <nowiki>Time Sync Viewer

</nowiki>

is a time synchronization detection tool specifically designed for ROS2, provided as an rqt plugin. It is used to monitor and analyze the synchronization status of multi-sensor data in real time. In robotics applications, ensuring accurate time synchronization is crucial, as it directly affects the performance and stability of technologies such as SLAM, deep learning, and sensor fusion. <nowiki>Time Sync Viewer

</nowiki>

provides synchronization detection, visual analysis, and detailed time statistics, helping developers quickly identify and resolve synchronization issues.

Features and Advantages:

  • Multi-Sensor Timestamps Visualization: Visually displays the timestamps of multiple sensors to help users check data alignment.
  • Time Synchronization Flag (sync_flag): Automatically triggers a flag when synchronization conditions are met, providing instant confirmation.
  • Sensor Check: Assists users in identifying hardware delays, network jitter, and data loss that may result in incomplete data.
  • Improved Sensor Fusion: Enhances data consistency and stability for applications such as SLAM, robotic arms, drones, and AMRs.

Note: Time Sync Viewer is only supported on Ubuntu 22.04

GUI Description

Example Using Camera, IMU, and LiDAR

  1. Time Axis Display
    • The image displays the timestamps of different data streams (topics), where each horizontal line represents a topic. Examples include::
      • camera (camera image)
      • imu (IMU data)
      • lidar (LiDAR scan)
      • z_sync_flag (sync flag)
  2. Synchronization Range
    • In this example, the <nowiki>sync_range

</nowiki>

is configured with 2ms, meaning that data points arriving within this 2-millisecond window are considered synchronized.

    • On the time axis, when a synchronization event is triggered, a <nowiki>sync_flag

</nowiki>

is marked.

  1. Synchronization Analysis
    • When all sensor data points fall within the 2ms range, they are considered synchronized (sync).
    • The image displays multiple sync points, indicating that at those moments, the sensor data is properly synchronized.

<img _fck_mw_filename="ROS2 time sync viewer 3.png" _fck_mw_origimgheight="209" _fck_mw_origimgwidth="1190" alt="ROS2_time_sync_viewer" src="/wiki/images/c/cd/ROS2_time_sync_viewer_3.png" style="vertical-align:middle;" title="ROS2_time_sync_viewer" width="1000" />

How to

Step

  • Step 1: Publish fake sensor data, including camera, IMU, and LiDAR(you can also use actual sensors)
In terminal 1, publish camera topic
cd /usr/local/Advantech/ros/humble/ros2-timesync-viewer/test/fake_sensor
python3 camera.py
In terminal 2, publish lidar topic
cd /usr/local/Advantech/ros/humble/ros2-timesync-viewer/test/fake_sensor
python3 lidar.py
In terminal 3, publish imu topic
cd /usr/local/Advantech/ros/humble/ros2-timesync-viewer/test/fake_sensor
python3 imu.py
  • Step 2: Enter 127.0.0.1:8081 in the web browser, run Time Sync Viewer in Web UI, select "Utility" from the list on the left

<img _fck_mw_filename="Robotic-suite-quickstart-tutorials2 01.png" _fck_mw_location="none" _fck_mw_origimgheight="835" _fck_mw_origimgwidth="1780" alt="Robotic-suite-quickstart-tutorials2_01.png" class="fck_mw_none" src="/wiki/images/b/be/Robotic-suite-quickstart-tutorials2_01.png" style="vertical-align:middle;" title="Robotic-suite-quickstart-tutorials2_01.png" width="1000" />

  • Step 3: Set Sync Period to a value between 1ms and 2000ms (default: 100ms)

<img _fck_mw_filename="Robotic-suite-quickstart-tutorials2 07.png" _fck_mw_location="none" _fck_mw_origimgheight="864" _fck_mw_origimgwidth="1217" alt="Robotic-suite-quickstart-tutorials2_07.png" class="fck_mw_none" src="/wiki/images/7/71/Robotic-suite-quickstart-tutorials2_07.png" style="vertical-align:middle;" title="Robotic-suite-quickstart-tutorials2_07.png" width="1000" />

  • Step 4: Click launch button, then will open Time Sync Viewer window

<img _fck_mw_filename="Robotic-suite-quickstart-tutorials2 02.png" _fck_mw_location="none" _fck_mw_origimgheight="835" _fck_mw_origimgwidth="1780" alt="Robotic-suite-quickstart-tutorials2_02.png" class="fck_mw_none" src="/wiki/images/5/57/Robotic-suite-quickstart-tutorials2_02.png" style="vertical-align:middle;" title="Robotic-suite-quickstart-tutorials2_02.png" width="1000" />

  • Step 5: Click start button

<img _fck_mw_filename="Robotic-suite-quickstart-tutorials2 03.png" _fck_mw_location="none" _fck_mw_origimgheight="267" _fck_mw_origimgwidth="1000" alt="Robotic-suite-quickstart-tutorials2_03.png" class="fck_mw_none" src="/wiki/images/6/6f/Robotic-suite-quickstart-tutorials2_03.png" style="vertical-align:middle;" title="Robotic-suite-quickstart-tutorials2_03.png" />

  • Step 6: Select the topics that you want to view, then click OK

<img _fck_mw_filename="ROS2 time sync viewer 2.png" _fck_mw_location="none" _fck_mw_origimgheight="689" _fck_mw_origimgwidth="477" alt="Robotic-suite-quickstart-tutorials2_04.png" class="fck_mw_none" src="/wiki/images/d/d9/ROS2_time_sync_viewer_2.png" style="vertical-align:middle;" title="Robotic-suite-quickstart-tutorials2_04.png" />

  • Result:

<img _fck_mw_filename="Robotic-suite-quickstart-tutorials2 05.png" _fck_mw_location="none" _fck_mw_origimgheight="333" _fck_mw_origimgwidth="1246" alt="Robotic-suite-quickstart-tutorials2_05.png" class="fck_mw_none" src="/wiki/images/b/b1/Robotic-suite-quickstart-tutorials2_05.png" style="vertical-align:middle;" title="Robotic-suite-quickstart-tutorials2_05.png" />

Note

1. Recommended to reopen the UI after using it for more than 5 hours to avoid lag.
2. To verify a custom or specialized topic, you must first add a source command for the corresponding environment to the .bashrc file. This is a mechanism in ROS2 to ensure that the system loads the correct development environment and package paths, allowing the topic to function properly.
3. If the Time Sync Viewer UI fails to display, first check whether the current environment's DISPLAY parameter is set to :0, if not, update the DISPLAY variable in /usr/local/Advantech/E2I/robotic-node-client/run.sh, save the file, and then rerun the app.