![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1215238/image.jpeg)
Error in Using ROS Topic
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi,
I am trying to deploy my simulink model in Gazebo(in VMware). I am using ROS topic '/gazebo/model_states' as the subscriber, but I am getting an error. Kindly help me please.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1214483/image.png)
댓글 수: 0
답변 (1개)
Josh Chen
2022년 12월 1일
Hi Shivam,
The topic "/gazebo/ModelState" contains only one "Pose" field, while the topic "/gazebo/ModelStates" that you are using contains more than one "Pose" field. When you see fields end with "_SL_Info", that means the corresponding field contians more than one element. As shown on the screenshot below, there is a "Pose_SL_Info", which means Pose is a variable-size field.
As the error message mentioned, you would need to use a "Selector" block to pick one "Pose" field from the variable Pose arrary before you tried to extract "Position.X", this is equivalent to specify the index of the Pose array.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1215238/image.jpeg)
Hope this helps,
Josh
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!