rospy service multiple argument
Hello,
It might be a total newbie question but I can't find the solution. I know that for Subscriber I can call callback_args but how am I suppose to do it for Services ?
I'm creating 2 services that are going to do the same thing BUT I want the callback to receive an id so it knows from which robot the service was required. I could pass it in the message but a better way to do it for me is to add a constant number associated to each call_back. I though of something like this but this abviously doesn't work :
service.append(rospy.Service(name, sentobject, self.check, callback_args=0) ) #Here 0 would be my id
service.append(rospy.Service(name, sentobject, self.check, callback_args=1) ) #Here 1 would be my id
With check being defined as :
def check(self, rep, robot_id):
How can I do it in python ?
Thanks a lot