Difference between revisions of "Advantech Robotic Suite/Time Sync Viewer"
Steven.yueh (talk | contribs) (add the web broswer address) |
Steven.yueh (talk | contribs) |
||
| Line 1: | Line 1: | ||
| + | <h1>Introduction</h1> | ||
| − | + | <p> </p> | |
| − | + | <pre class="fck_mw_nowiki"> | |
| − | <nowiki>Time Sync Viewer</nowiki> | + | <nowiki>Time Sync Viewer</nowiki></pre> |
| − | 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>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> |
| − | |||
| − | + | <pre class="fck_mw_nowiki"> | |
| + | <nowiki>Time Sync Viewer</nowiki></pre> | ||
| − | + | <p>provides synchronization detection, visual analysis, and detailed time statistics, helping developers quickly identify and resolve synchronization issues.</p> | |
| − | + | <p><b>Features and Advantages</b>:</p> | |
| − | |||
| − | |||
| − | |||
| − | < | + | <ul> |
| + | <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> |
| − | + | <h2>GUI Description</h2> | |
| − | + | <p><i>Example Using Camera, IMU, and LiDAR</i></p> | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | + | <ol> | |
| + | <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> | |
| − | |||
| − | |||
| − | is | + | <ol> |
| + | <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> | |
| − | |||
| − | |||
| − | + | <ol> | |
| + | <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> |
| − | + | <h1>How to</h1> | |
| − | + | <h2>Step</h2> | |
| − | :In terminal 1, publish camera topic | + | <ul> |
| − | <pre>cd /usr/local/Advantech/ros/humble/ros2-timesync-viewer/test/fake_sensor | + | <li>Step 1: Publish fake sensor data, including camera, IMU, and LiDAR(you can also use actual sensors)</li> |
| + | </ul> | ||
| + | |||
| + | <dl> | ||
| + | <dd>In terminal 1, publish camera topic</dd> | ||
| + | </dl> | ||
| + | |||
| + | <pre> | ||
| + | cd /usr/local/Advantech/ros/humble/ros2-timesync-viewer/test/fake_sensor | ||
python3 camera.py | python3 camera.py | ||
</pre> | </pre> | ||
| − | + | <dl> | |
| − | <pre>cd /usr/local/Advantech/ros/humble/ros2-timesync-viewer/test/fake_sensor | + | <dd>In terminal 2, publish lidar topic</dd> |
| + | </dl> | ||
| + | |||
| + | <pre> | ||
| + | cd /usr/local/Advantech/ros/humble/ros2-timesync-viewer/test/fake_sensor | ||
python3 lidar.py | python3 lidar.py | ||
</pre> | </pre> | ||
| − | + | <dl> | |
| − | <pre>cd /usr/local/Advantech/ros/humble/ros2-timesync-viewer/test/fake_sensor | + | <dd>In terminal 3, publish imu topic</dd> |
| + | </dl> | ||
| + | |||
| + | <pre> | ||
| + | cd /usr/local/Advantech/ros/humble/ros2-timesync-viewer/test/fake_sensor | ||
python3 imu.py | python3 imu.py | ||
</pre> | </pre> | ||
| − | + | <ul> | |
| + | <li>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> | ||
| + | </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> | |
| − | + | <ul> | |
| + | <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> | |
| − | + | <ul> | |
| + | <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> | |
| − | + | <ul> | |
| + | <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> | |
| − | + | <ul> | |
| + | <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> | |
| − | + | <ul> | |
| + | <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> | |
| − | + | <h2>Note</h2> | |
| − | 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 | + | <p>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.</p> | ||
| − | | + | <p> </p> |
| − | <!-- | + | <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 131: | Line 189: | ||
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:55, 14 July 2025
Introduction
Time Sync Viewer
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.
Time Sync Viewer
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
- 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)
- The image displays the timestamps of different data streams (topics), where each horizontal line represents a topic. Examples include::
- Synchronization Range
- In this example, the
sync_range
- In this example, the
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
sync_flag
- On the time axis, when a synchronization event is triggered, a
is marked.
- 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 Periodto 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 Viewerwindow
<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.