How to correctly initialize ros service object

조회 수: 15 (최근 30일)
Mihael Simonic
Mihael Simonic 2020년 7월 21일
댓글: Jeff Dillon 2021년 5월 3일
If I run a simple ros service from terminal
roscore
rosrun rospy_tutorials add_two_ints_server
(or any other service) and connect to it in Matlab using
rosinit
cl = rossvcclient('/add_two_ints')
I get the following output in the terminal:
[ERROR] [1595324358.790565]: incoming connection failed: unable to receive data from sender, check sender's logs for details
According to https://github.com/ros-controls/ros_control/issues/256 it seems that a malformed service call is sent.
After that I can do proppers service calls normally, using
call(cl)
but this error message is annoying.
How to init rossvcclient object in such a way that it doesn't send malformed calls?

채택된 답변

Cam Salzberger
Cam Salzberger 2020년 7월 21일
Hello Mihael,
I've been able to reproduce this on my machine, testing with the Indigo VM. You are creating the service client in the right manner, and I don't believe any other manner of setting it up will avoid this error message popping up. I've checked the code flow, and determined that this error message on the external server only comes up when a temporary communication used to determine the service type is being shut down. It shouldn't have an impact on subsequent service calls, nor on the service server.
I understand the annoyance aspect of it though, so I've passed along your comments to the appropriate people.
-Cam
  댓글 수: 1
Jeff Dillon
Jeff Dillon 2021년 5월 3일
Unfortunately this is a breaking bug in the Simulink ROS Toolbox in R2021a for the Call Service block. In the Select a ROS Service dialog, /add_two_ints is grayed out and not selectable. On the remote ROS host, the error is "Incoming connection failed:..." I'm not able to call any ROS service from Simulink. This example does work, but it doesn't work if the ROS host is on a remote system (a Jetson Nano on the local area network, in this case) https://www.mathworks.com/help/ros/ug/call-and-provide-ros-services.html

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 ROS 2 Network Access in Simulink에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by