How to correctly initialize ros service object

5 次查看(过去 30 天)
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 Network Access in MATLAB 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by