0
$\begingroup$

Rosanswers logo

Hi,

I have a problem when I try to call a Trigger service from Python. There is a service call /ur_hardware_interface/dashboard/program_state of the Universal Robots Driver, I can successfully call the service using the terminal rosservice call /ur_hardware_interface/dashboard/program_state. However when I try to call the service using a simply Python script, it fails

import rospy
from std_srvs.srv import Trigger, TriggerRequest

rospy.wait_for_service('/ur_hardware_interface/dashboard/program_state')
check_connection = rospy.ServiceProxy('/ur_hardware_interface/dashboard/program_state', Trigger)

req = TriggerRequest()
res = check_connection(req)
print("Check connection", res)

I get the following error message:

rospy.service.ServiceException: unable to connect to service: remote error reported: client wants service /ur_hardware_interface/dashboard/program_state to have md5sum 937c9679a518e3a18d831e57125ea522, but it has 522d35a6f2ebd9702cb1e33489e1aa96. Dropping connection.

The universal robot driver is compiled from source in my catkin_ws, it is up-to-date, and has no modifications. The service and the client are running on the same PC so I don't really understand, though just in case I rebuild my catkin_ws but it does not change anything. Additionally, other services published by the Universal Robots Driver do work without problem from the Python script


Originally posted by cambel07 on ROS Answers with karma: 92 on 2021-03-20

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

As you can see in the documentation (here), the dashboard/program_state service is not of type std_srvs/Trigger, but type ur_dashboard_msgs/GetProgramState.

You cannot call that service with a std_srvs/TriggerRequest, and the MD5 mismatch error is correct.

You can verify this by running rosservice type /ur_hardware_interface/dashboard/program_state (or rosservice info ... for more information).

Many services offered by that node actually use types other than Trigger, see again the documentation.


Originally posted by gvdhoorn with karma: 86574 on 2021-03-20

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by cambel07 on 2021-03-20:
I see, thank you!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.