Ask Your Question

When I try to do a client of a service of ROS, Matlab and ROS give me an error!

asked 2016-05-03 04:17:35 -0600

viola gravatar image

updated 2016-05-03 07:03:29 -0600

gvdhoorn gravatar image

Hello! I'm trying to interface Matlab and ROS. I've a service in ROS and I want to do a client of this service in Matlab but when I do:

rosinit ('http://....:11311')
client = rossvcclient('/launch_by_service')

Matlab and ROS make me an error as this:

Failed to create a /launch_by_service service client.
[ERROR] ServiceClientHandshakeHandler - Service client handshake failed: client wants service /launch_by_service to have md5sum e1d8c050aed05957d504a68117eb0528, but it has 546971982e3fbbd5a41e60fb6432e357. Dropping connection.

When I do rosservice list from Matlab I see the service and the type. Can somebody help me? Thanks!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2016-05-03 07:10:21 -0600

mgruhler gravatar image

updated 2016-05-03 07:10:34 -0600

There is a difference in the service specification of the different nodes. Is this on one or on two PCs? Custom service?

You should check the md5 sums of the services on the respective machines with rossrv md5 PACKAGE/SRV and if they are not the same, you need to figure out which one to update.

edit flag offensive delete link more


They are on a different computer. Matlab in on Mac and ROS on Ubuntu

viola gravatar image viola  ( 2016-05-04 05:58:48 -0600 )edit

How do you update the md5sum? I am having the same problem.

s1839705 gravatar image s1839705  ( 2016-10-18 08:14:30 -0600 )edit

The service files need to be exactly the same. I.e. including comments (and probably whitespace).

This error means you are having a different version somewhere.

mgruhler gravatar image mgruhler  ( 2016-10-18 10:13:28 -0600 )edit

After changing, still does not work. I am not interfacing MATLAB and ROS, I am using ROS across two different machines. It's weird, because if I run the command rossrv md5 <my.srv>, the output is exactly the same in both the computers. But when I try to use the server, the error still appears

s1839705 gravatar image s1839705  ( 2016-10-18 10:34:52 -0600 )edit

I recompiled using make. Thanks a lot :)

s1839705 gravatar image s1839705  ( 2016-11-19 08:59:33 -0600 )edit

Hi, I have the same problem. Can you explain me how to update the MD5 (I am new in ROS). I have Matlab with Robotic toolbox (ROS also) and ROS installed on the same PC with Ubuntu. Note, I have installed MOVEit as well. I recompile the catkin but still different MD5. Any idea how to solve this?

ccopot gravatar image ccopot  ( 2016-12-15 02:35:21 -0600 )edit

as stated above. make sure the *.msg, *.srv file on the different machines is exactly the same. Then recompile. The md5 is deduced from the file itself.

mgruhler gravatar image mgruhler  ( 2016-12-15 02:38:30 -0600 )edit

I understood that. I found the *.msg files on ROS (/opt/ros/jade/share/control_msgs) but NOT on Matlab folder (there are only .m files). The robotics toolbox come with this message type but they are outdated. Do I have to downgrade my control_msgs? or to create other Matlab files using rosgenmsg?

ccopot gravatar image ccopot  ( 2016-12-15 07:03:32 -0600 )edit

answered 2016-10-19 01:25:03 -0600

mgruhler gravatar image

Did you recompile? When you change the service definition, you need to recompile to create the new service header and you need to recompile any package including the service header as well. Otherwise, they still have the old definition in there.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-05-03 04:17:35 -0600

Seen: 1,515 times

Last updated: May 03 '16