Co-simulation Simulink and Gazebo: Gazebo custom support block makes simulation very slow
1 次查看(过去 30 天)
显示 更早的评论
Hi, all.
I have an issue related to the too slow simulation speed due to the Gazebo Custom Support block in Simulink for Co-simulation Simuink and Gazebo. (I used MATLAB and Gazebo on the same mashine, Ubuntu)
I imagined that the contact message has too many fields, so it makes the speed slow.
But, even I selected /gazebo/default/joint in the Gazebo Custom Support block, it makes the speed very slow.
Once I remove the block, the speed is normal.
Is this a known issue?
If it is, please let me know when it would be solved. This is very critical issue for my project, since I am using reinforcement learning. For instance, a policy is trained with a normal simulation speed. And if i try to train it further only adding the Gazebo Custom Support block to the Simulink model, the performance is changed greatly due to the slow speed. it may be not related to this issue, but it is still critical.
Thanks.
In addition, I attached the comparison between a inverse kinematics result vs. a inverse kinematics result with the Gazebo Custom Support block. (a dffierence is this block)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/873945/image.jpeg)
Even they have the same target joint angles, just adding the Gazebo Custom Support block makes the changes in the results.
Some joints' responses without the block are fast while other joints' responses without the block are slow.
Are they some kinds of bugs?
0 个评论
采纳的回答
Gaurav Bhosale
2022-2-1
Hi Yunsik,
Which MATLAB version you are using?
Further, I didn't get the comparision part. Which two results you are comapring?
Are you comparing Gazebo MATLAB API vs Gazebo Simulink Subscribe block ?
Can you please add more details about experiment.
Thanks
5 个评论
Gaurav Bhosale
2022-2-4
Hi Yunsik,
One more thing you can fix for older MATLAB version.
1] You need to open Gazebo library \toolbox\robotics\robotsimulink\robotslgazebo\robotgazebolib.slx
2] Unlock library
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/884270/image.jpeg)
3] Click on down arrow
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/884275/image.jpeg)
4] Check the sample time value. If it is 0.001 then change to 'sampleTime'. Compare all parameters shown below.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/884280/image.jpeg)
After this, save the robotgazebolib.slx and relaunch MATLAB.
Further, try to keep higher sample time for subscribe block, which can imporove performance.
Thanks.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Gazebo Co-Simulation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!