Calling a (Gazebo) service parallelly from multiple nodes/ Remapping a (Gazebo) service to a particular namespace
I have a multi robot setting (with different namespaces which work totally independent of each other, in the same empty_world) in Gazebo. I have to reset the manipulated objects after a certain time interval. I have different ROS nodes controlling the robots and the resetting objects. So I want to use gazebo/set_model_state service parallelly in all the nodes. Spawning one robot works fine as it is the only node using the service. But as soon as I launch the second node it gives me the following error from the first simulation and the second simulation starts running fine.
rospy.service.ServiceException: service [/gazebo/set_model_state] returned no response
I'm aware that the service call executes commands in a serial manner. But I would like to call the service parallelly from all the nodes at the same time. Is this possible? I suppose this can be done if I can somehow "remap" the service like I do for the topics. That way I can specifically call the service belonging to the robot of that particular namespace. Or if I somehow clone the existing service into multiple unique services each node can call these unique nodes parallelly. But I'm not sure how this can be done. Any suggestions?