How to call a service of a seperate package from a node frm another package?
I'm using the rosarduino bridge package on a custom robot and i'm developing a node access the package when required. but im havin trouble callin the services in arduinobridge usin rospy.serviceproxy(' ', )
shld it be called usin another function in da client node.. i did add da dependacies in da node.
This is da code I used to call the service
#!/usr/bin/env python
import sys
import rospy
from ros_arduino_python import *
from ros_arduino_msgs.srv import *
def digital_write_client(pin, value):
# rospy.wait_for_sevice('digital_write')
try:
digital_write = rospy.ServiceProxy('digital_write', DigitalWrite)
digital_write(pin,value)
print"call success"
except rospy.ServiceException, e:
print "Service call failed: %s"%e
if __name__ == "__main__":
digital_write_client(8,1)
Which service are you trying to call? What happens when you try to call it? Do you get a python stack trace?
i'm tryin to call DigitalWrite.srv using the below code, but i keep gettin da exception i have implemented. I'm new to ROS so having trouble
rospy.wait_for_sevice('digital_write')
try: digital_write = rospy.ServiceProxy('digital_write', DigitalWrite) digital_write(pin,value)
Please edit your question with the full program that you're trying to run, and the full exception that you get.