Difference between revisions of "Advantech Robotic Suite/Time Sync Viewer"
Steven.yueh (talk | contribs) (add the web broswer address) |
|||
| Line 1: | Line 1: | ||
| + | |||
= Introduction = | = 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''': | '''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. | + | *Multi-Sensor Timestamps Visualization: Visually displays the timestamps of multiple sensors to help users check data alignment. |
| − | <!--* Statistical Analysis: Calculates synchronization frequency, average time intervals, standard deviation, and other metrics to quantify performance.--> | + | *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. | + | *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. | + | *Improved Sensor Fusion: Enhances data consistency and stability for applications such as SLAM, robotic arms, drones, and AMRs. |
| + | |||
<font color="red">Note: Time Sync Viewer is only supported on Ubuntu 22.04</font> | <font color="red">Note: Time Sync Viewer is only supported on Ubuntu 22.04</font> | ||
== GUI Description == | == GUI Description == | ||
| + | |||
''Example Using Camera, IMU, and LiDAR'' | ''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:: | + | #Time Axis Display |
| − | #** camera (camera image) | + | #*The image displays the timestamps of different data streams (topics), where each horizontal line represents a topic. Examples include:: |
| − | #** imu (IMU data) | + | #**camera (camera image) |
| − | #** lidar (LiDAR scan) | + | #**imu (IMU data) |
| − | #** z_sync_flag (sync flag) | + | #**lidar (LiDAR scan) |
| − | # Synchronization Range | + | #**z_sync_flag (sync flag) |
| − | #* In this example, the | + | #Synchronization Range |
| − | #* On the time axis, when a synchronization event is triggered, a | + | #*In this example, the <nowiki>sync_range</nowiki> |
| − | # 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. | + | is configured with 2ms, meaning that data points arriving within this 2-millisecond window are considered synchronized. |
| − | [[File: | + | |
| + | # | ||
| + | #*On the time axis, when a synchronization event is triggered, a <nowiki>sync_flag</nowiki> | ||
| + | |||
| + | |||
| + | 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. | ||
| + | |||
| + | [[File:ROS2 time sync viewer 3.png|1000px|ROS2_time_sync_viewer]] | ||
= How to = | = How to = | ||
| + | |||
== Step == | == Step == | ||
| − | * Step 1: Publish fake sensor data, including camera, IMU, and LiDAR(you can also use actual sensors) | + | |
| − | : In terminal 1, publish camera topic | + | *Step 1: Publish fake sensor data, including camera, IMU, and LiDAR(you can also use actual sensors) |
| − | <pre> | + | |
| − | cd /usr/local/Advantech/ros/humble/ros2-timesync-viewer/test/fake_sensor | + | :In terminal 1, publish camera topic |
| + | <pre>cd /usr/local/Advantech/ros/humble/ros2-timesync-viewer/test/fake_sensor | ||
python3 camera.py | python3 camera.py | ||
</pre> | </pre> | ||
| − | : In terminal 2, publish lidar topic | + | |
| − | <pre> | + | :In terminal 2, publish lidar 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 lidar.py | python3 lidar.py | ||
</pre> | </pre> | ||
| − | : In terminal 3, publish imu topic | + | |
| − | <pre> | + | :In terminal 3, publish imu 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 imu.py | python3 imu.py | ||
</pre> | </pre> | ||
| − | * Step 2: | + | |
| − | [[File:Robotic-suite-quickstart- | + | *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 |
| − | * Step 3: Set <code>Sync Period</code> to a value between 1ms and 2000ms (default: 100ms) | + | |
| − | [[File:Robotic-suite-quickstart- | + | [[File:Robotic-suite-quickstart-tutorials2 01.png|none|1000px|Robotic-suite-quickstart-tutorials2_01.png]] |
| − | * Step 4: Click launch button, then will open <code>Time Sync Viewer</code> window | + | |
| − | [[File:Robotic-suite-quickstart- | + | *Step 3: Set <code>Sync Period</code> to a value between 1ms and 2000ms (default: 100ms) |
| − | * Step 5: Click start button | + | |
| − | [[File:Robotic-suite-quickstart- | + | [[File:Robotic-suite-quickstart-tutorials2 07.png|none|1000px|Robotic-suite-quickstart-tutorials2_07.png]] |
| − | * Step 6: Select the topics that you want to view, then click OK | + | |
| + | *Step 4: Click launch button, then will open <code>Time Sync Viewer</code> window | ||
| + | |||
| + | [[File:Robotic-suite-quickstart-tutorials2 02.png|none|1000px|Robotic-suite-quickstart-tutorials2_02.png]] | ||
| + | |||
| + | *Step 5: Click start button | ||
| + | |||
| + | [[File:Robotic-suite-quickstart-tutorials2 03.png|none|Robotic-suite-quickstart-tutorials2_03.png]] | ||
| + | |||
| + | *Step 6: Select the topics that you want to view, then click OK | ||
| + | |||
[[File:ROS2 time sync viewer 2.png|none|Robotic-suite-quickstart-tutorials2_04.png]] | [[File:ROS2 time sync viewer 2.png|none|Robotic-suite-quickstart-tutorials2_04.png]] | ||
| − | * Result: | + | |
| − | [[File:Robotic-suite-quickstart- | + | *Result: |
| + | |||
| + | [[File:Robotic-suite-quickstart-tutorials2 05.png|none|Robotic-suite-quickstart-tutorials2_05.png]] | ||
== Note == | == Note == | ||
| − | |||
| − | |||
| − | |||
| − | |||
| + | 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. | ||
| + | | ||
<!-- | <!-- | ||
| Line 84: | Line 117: | ||
Monitoring results will be shown in the terminal | Monitoring results will be shown in the terminal | ||
[[File:ROS2_time_sync_check_node_setting_2.png|none|ROS2_time_sync_check_node_setting_2]] | [[File:ROS2_time_sync_check_node_setting_2.png|none|ROS2_time_sync_check_node_setting_2]] | ||
| − | --> | + | --><!-- |
| − | |||
| − | <!-- | ||
== Config == | == Config == | ||
| − | Set <code><nowiki>sync_range</ | + | Set <code><span _fck_mw_customtag="true" _fck_mw_tagname="nowiki" _fck_mw_tagtype="t" class="fck_mw_nowiki">sync_range</span></code> in config.yaml, the unit is seconds |
| − | <pre> | + | <span _fck_mw_customtag="true" _fck_mw_tagname="pre" _fck_mw_tagtype="t" class="fck_mw_special">fckLRcd /usr/local/Advantech/ros/humble/ros2-timesync-viewer/configfckLRvim sync_range.yamlfckLR</span> |
| − | |||
| − | |||
| − | </ | ||
[[File:ROS2_time_sync_check_node_setting.png|none|ROS2_time_sync_check_node_setting]] | [[File:ROS2_time_sync_check_node_setting.png|none|ROS2_time_sync_check_node_setting]] | ||
== Run == | == Run == | ||
Step 1: Start Time Sync Viewer | Step 1: Start Time Sync Viewer | ||
| − | <pre> | + | <span _fck_mw_customtag="true" _fck_mw_tagname="pre" _fck_mw_tagtype="t" class="fck_mw_special">fckLRcd /usr/local/Advantech/ros/humble/ros2-timesync-viewerfckLR./run.shfckLR</span> |
| − | + | Step 2: Click start button<br/> | |
| − | ./run. | + | [[File:ROS2_time_sync_viewer_1.png|1000px|ROS2_time_sync_viewer]]<br/> |
| − | </ | + | Step 3: Select the topics that you want to view, then click OK<br/> |
| − | Step 2: Click start button<br> | + | [[File:ROS2_time_sync_viewer_2.png|400px|ROS2_time_sync_viewer]]<br/> |
| − | [[File:ROS2_time_sync_viewer_1.png|1000px|ROS2_time_sync_viewer]]<br> | + | Step 4: Result<br/> |
| − | Step 3: Select the topics that you want to view, then click OK<br> | ||
| − | [[File:ROS2_time_sync_viewer_2.png|400px|ROS2_time_sync_viewer]]<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]] | ||
--> | --> | ||
Revision as of 06:54, 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
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
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.
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
- Step 3: Set
Sync Periodto a value between 1ms and 2000ms (default: 100ms)
- Step 4: Click launch button, then will open
Time Sync Viewerwindow
- Step 5: Click start button
- Step 6: Select the topics that you want to view, then click OK
- Result:
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.


