ROSPlan
ROSPlan copied to clipboard
concurrent plan execution for multiple robots are not working in ROSplan
Hi,
I've encountered a problem while executing parallel actions. As shown below, concurrently dispatched actions are executed sequentially.
Am I missing some points?
Any comments would be appreciated very much.
Hello there,
From your diagram I am assuming that the three forklift actions are dispatched at 0.000, but then they are executed in sequence?
Take a look at the code that implements the execution of the forklift action (that is subscribed to the PDDL action message) perhaps this code is resolving the actions in sequence, despite there being multiple forklifts?
Best regards, Michael
While using Action Interface based on RPSimulatedActionInterface Class, ros::Rate.sleep() is used to set the duration of action. Contrary to my expectation, it ends up with not receiving other topics or services, and am working on to fix this problem.
Am I going to right direction?
Appreciate your help.
Yes, that's the right direction. The simulated action interface can only serve one action at a time (this is not completely unreasonable, as it resembles real actions such as move_base goals).
However, for the same action on different robots, it makes sense that they run in parallel. Please let me know if you are able to update the action interface to cope with this -- it would be useful to merge in!
Michael
Sure, willing to share the codes.
Hi there, I found a way to solve this problem. I made some variations in the ActionInterface and it works well for multiple robots implementing the same action concurrently.
Thanks! Can you please open a pull request and refer this issue from it? We can then provide feedback
I've run into the same issue. Correct me if I am wrong, concurrent execution of same action by multiple robots needs to be handled by an Action Interface extending RPActionInterface.cpp. My understanding is that to do this the concreteCallback method of the action interface needs to be run on separate threads for each robot that is supposed to perform the action and RPActionInterface currently does not have anything to handle this. Any comments regarding this would be much appreciated.
Thanks
Hi there, sorry for the delay in my answer, I will open a pull request today with my solution to this problem. I modified the Action Interface to solve the problem.
Hello Sarvesh,
The solution will depend a bit upon how the multiple robots are set up (e.g. in separate namespaces, or on different physical machines, etc.).
It can be straightforward:
- Each robot should be running its own action interface. For example, this means for the action "do_action" you will run the action interface on each robot.
- As a parameter of the "do_action" interface, you can set the robot name, or take it from the namespace.
- In the concrete_dispatch method of the "do_action" interface, you can check the robot name matches the action parameter before executing the action.
To run an interface for each robot, make sure the node names do not clash, either:
- give each interface its own node name: e.g. "do_action_interface_robot1".
- put them in the namespaces of each robot, e.g. <group "robot1"> ...
If you need an action that runs on one machine, and in the planning model can be run against itself in parallel an unlimited number of times, then you might need to look into threading. However, if the number of actions is limited (e.g. one for each simulated robot) or the actions are on separate machines (e.g. separate robots/namespaces) then this should suffice.
Michael