How to change the range of the lidar sensor in Gazebo co-simulating with Simulink?

5 ビュー (過去 30 日間)
JAEYONG HAN
JAEYONG HAN 2021 年 11 月 8 日
コメント済み: JAEYONG HAN 2022 年 1 月 11 日
Hi,
I am testing the sesor reading with the given example.
"Perform Co-Simulation between Simulink and Gazebo"
In the example, I wanted to change the range of the lidar sensor "hokuyo".
I opened "model.sdf" in the hokuyo folder, and changed some codes.
Origianal.
---------------------------------------------------
<range>
<min>0.08</min>
<max>10</max>
<resolution>0.01</resolution>
</range>
----------------------------------------------------
Changed,
---------------------------------------------------
<range>
<min>0.05</min>
<max>3</max>
<resolution>0.01</resolution>
</range>
----------------------------------------------------
Then, If I run the simulink, it shows me error below,
---------------------------------------------------------
Limits must be a 2-element vector of increasing numeric values.
Error in ylim.m (line 31)
varargout = matlab.graphics.internal.ruler.rulerFunctions(mfilename, nargout, varargin);
Error in plotScan.m (line 30)
Error in lidarScan.plot.m (line 197)
------------------------------------------
it turns out that, if the lidar sensor doesnt detect anything in the gazebo,
this error shows up.
Anyone can help with it?
Thanks.
Jaeyong Han

回答 (1 件)

Gaurav Bhosale
Gaurav Bhosale 2022 年 1 月 5 日
Hi Jaeyong,
I tried same but didn't encountered the issue you mentioned above. The Simulink was completed without any issue.
Which MATLAB version are you using?
Can you debug the plotLidar code as shown below and see the angleMin, angleStep and angleMax values?
Also, try to re-do changes freshly and see you face same issue or not.
Thanks
  1 件のコメント
JAEYONG HAN
JAEYONG HAN 2022 年 1 月 11 日
HI, I am using 2021a version,
after debugging
and It works fine~ now
Thanks

サインインしてコメントする。

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by