ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Not sure whether anything has changed in rospy
in the meantime, but I believe the problem is that rospy.Service(..)
does not support that additional args argument described in the Q&A you link. That's for rospy.Subscriber(..)
only.
See #q247540 for a potential work-around, using a lambda.
Another option would be to create a class, and make callback(..)
a method on that class. It could then refer to any member variables of that class.
2 | No.2 Revision |
Not sure whether anything has changed in rospy
in the meantime, but I believe the problem is that rospy.Service(..)
does not support that additional args argument described in the Q&A you link. That's for rospy.Subscriber(..)
only.
See #q247540 for a potential work-around, using a lambda.
Another option would be to create a class, and make callback(..)
a method on that class. It could then refer to any member variables of that class.
The reason you get that error ("") is because rospy.Service(..)
expects a buff_size
argument (an integer
) where you are passing your AiMachine
instance. See the documentation:
__init__(self, name, service_class, handler, buff_size=65536, error_handler=None)