Simulink fails to create ROS subscriber

조회 수: 2 (최근 30일)
Johan Fanas
Johan Fanas 2021년 1월 29일
댓글: Cam Salzberger 2021년 2월 1일
Hi,
I am trying to subscribe to a topic using the subscriber block in Simulink and I am getting the error shown in the attached image. I created the custom message and it appears in the command window when I do rosmsg list, so I don't know why it says it can't find that message in the library. Maybe there is something else I need to add so Matlab finds the generated message. I am using Matlab 2020b.
Thanks

답변 (1개)

Cam Salzberger
Cam Salzberger 2021년 1월 29일
Hello Johan,
This may be because you have conflicting libraries on your platform's library path. It may be related to this bug, or this one, that were both fixed in R2020b Update 3. Try getting the latest update and see if that resolves the issue.
Also see here for a similar issue with suggested resolutions. Though that question is regarding ROS 2, similar issues may be found in ROS 1.
-Cam
  댓글 수: 2
Johan Fanas
Johan Fanas 2021년 1월 29일
I updated my Matlab and it fixed the problem, thanks a lot. I am encountering another problem when running the subscriber and using the ROS bag block (see image attached). I don't know if this might be an issue with my custom message (which I dont think so), but any suggestion would be great. Below is the output when I do rosmessage show from the command window. Everything is correct but I keep getting this error in Simulink. When I use the rosbag block I get the same error but with the timestamp.
msgInfo = rosmsg('show','obstd_radar/ObjectInfoList')
msgInfo =
'std_msgs/Header Header
uint32 VectorLen
ObjectInfo[] ObjectList'
Cam Salzberger
Cam Salzberger 2021년 2월 1일
Hey Johan,
That issue is a little more difficult to diagnose from the error message. I'd suggest that you contact technical support with your custom message package(s) and your model. They can better dig into what's going on in the model, and diagnose the issue.
-Cam

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Network Connection and Exploration에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by