KCL-Planning / ROSPlan

The ROSPlan framework provides a generic method for task planning in a ROS system.
http://kcl-planning.github.io/ROSPlan
BSD 2-Clause "Simplified" License
353 stars 159 forks source link

concurrent plan execution for multiple robots are not working in ROSplan #115

Open Etns opened 6 years ago

Etns commented 6 years ago

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.

image

m312z commented 6 years ago

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

Etns commented 6 years ago

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.

m312z commented 6 years ago

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

Etns commented 6 years ago

Sure, willing to share the codes.

YanielCarreno commented 5 years ago

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.

oscar-lima commented 5 years ago

Thanks! Can you please open a pull request and refer this issue from it? We can then provide feedback

SarveshS325 commented 5 years ago

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

YanielCarreno commented 5 years ago

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.

m312z commented 5 years ago

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:

To run an interface for each robot, make sure the node names do not clash, either:

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