Call Service block in simulink error "input must be a structure"

조회 수: 2 (최근 30일)
jio
jio 2022년 11월 1일
답변: Sugandhi 2023년 10월 19일
Hi, everyone
I have a Matlab R2021b and Ros melodic , I'm using call service to request message from Ros melodic, but when I change service type,(click "select" button), it returns error, as show in the picture, and the communication between ros and simulink is right.
Is there somebody know how to solve this problem, thank you.

답변 (1개)

Sugandhi
Sugandhi 2023년 10월 19일
Hi,
I understand that you are getting errros on using call service to request message from Ros melodic, and change service type.
The error message you encountered indicates that the input to the ROS Call Service block's mask parameter callback should be a structure, but it received something else. This error commonly occurs when there is an issue with the ROS service definition or the configuration of the block itself.
To resolve this issue, you can try below few workarounds:
  1. Ensure that the ROS service message definition is correctly defined and available in your ROS environment. Make sure you have sourced the appropriate ROS setup file.
  2. Double-check the configuration of the ROS Call Service block. Verify that the service name and message type are correctly specified.
  3. If you recently changed the service type, try restarting MATLAB to ensure that any cached information is cleared.
  4. If the issue persists, consider reinstalling or updating the ROS toolbox in MATLAB to ensure compatibility between MATLAB R2021b and ROS Melodic.

카테고리

Help CenterFile Exchange에서 Specialized Messages에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by