
Hey guys,
I have a world_node which offers a service to register_new_robot.
Once called, the service creates a new C++ object from Robot.cpp.
This Robot object now sets up a few topics mainly for controlling the robot (e.g. goToPose) in its contructor.
Now the problem is, when I create the object in my world_node service callback, my whole world_node blocks. I already used AsyncSpinner for multi-threaded calls already (e.g. the topic listeners in Robot), but here is the problem:
The number of robots is changing, which means that I don't know for how many threads I have to set up AsyncSpinner. The API does not offer adding a new thread, so what would you suggest to do? I could stop the spinner, create a new one with more threads, but that would cancel all the stuff currently done by the robots. I could also have the Robot object be created in the a main of it's class file and simply create a new node. But that seems even more messy than what I already do.
I use jade. Please help me.
Originally posted by Borob on ROS Answers with karma: 111 on 2016-03-08
Post score: 0