ros-drivers / rosserial

A ROS client library for small, embedded devices, such as Arduino. See: http://wiki.ros.org/rosserial
517 stars 525 forks source link

Question on possible bug in SerialClient.py but involving rospy/service.py #568

Open altineller opened 3 years ago

altineller commented 3 years ago

Hello,

When a connected board is reset, the rosserial connection re-inits itself, and publishers and subscribers work, but not services.

When the connection is re initiated a service already registered error comes up.

Namely Code from rospy/service.py is triggered,

def register(self, resolved_service_name, service): err = None with self.lock: if resolved_service_name in self.map: err = "service [%s] already registered"%resolved_service_name else: self.map[resolved_service_name] = service self.registration_listeners.notify_added(resolved_service_name, service.uri, Registration.SRV) if err: raise ServiceException(err)

The if clause checks service_name in a map, and if found, it will print an error. I removed the if statement and only used self.map[resolved_service_name] = service , and it seems to work for me.

But I wonder what else am I breaking?

Any ideas / discussion on this greatly appreciated. I could produce error logs / console output and such.

Best Regards, Can