Time synchronization issue between MATLAB/Simulink and Gazebo during simulation

4 ビュー (過去 30 日間)
Khang
Khang 2024 年 12 月 16 日
回答済み: Sreeram 2024 年 12 月 16 日
I am performing a co-simulation between Simulink and Gazebo to control the position of robotic joints. In the simulation, I am sending desired joint angles (reference signals) to Gazebo and receiving the joint angles back.
However, when I observe the signals in the Scope block, I notice that the desired joint angles and the received joint angles are similar, but the received joint angles from Gazebo are delayed by one sample time (step time).
Any suggestions on how to resolve this time delay issue would be greatly appreciated.
Thank you for your help!

採用された回答

Sreeram
Sreeram 2024 年 12 月 16 日
Hi Khang,
The documentation indicates that during co-simulation, Gazebo is stepped first, followed by Simulink.
We see here that the sensor data and actuation commands are exchanged at the correct time step, but at each time step, Gazebo is one step ahead of the simulation. This sequence might lead to the observed delay in the received joint angles. The relevant section of the documentation may be accessed using the following link:
To synchronize simulation times between Gazebo and Simulink, the “Gazebo Pacer” block may be used as suggested in the following documentation:
This example showing how to set up a synchronized simulation between Simulink and Gazebomight be helpful:
I hope this helps!

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGazebo Co-Simulation についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by