- Have you tried this example before? Are you able to see the same output as shown on the example?
- What is the ErrorCode it returned from the block output port?
- If you create and start a ros2svcserver in MATLAB, are you able to get the result in Simulink?
- Does the domain id matches with the domain id the service server in? You can check the ROS 2 Domain ID for your model under SIMULATION->PREPARE->ROS Network.
Questions about ros2 call service blocks in simulink
1 view (last 30 days)
I'm using a ros2 call service block to call a service named "load_track". While debugging I can't receive anything from the server.
But if I use matlab function(.m file) and follow the instructions in the https://www.mathworks.com/help/ros/ref/ros2serviceserver.html, the server can normally receive the srvice request.
Could you please have a look, and see where could be the problem?
Thanks a lot!
The simulink screenshot is in the appendix.
Josh Chen on 28 Apr 2022
It is difficult to figure out the culprit from the screenshot of the model. However, I do have some troubleshooting suggestions that you may want to give it a try:
If the above ideas still can't resolve this issue, I would recommend you to reach out to MathWorks Technical Support and share a sample model/workflow for a closer look.
Hope this helps,