How do I implement a PDDL generated plan into a Python code communicating with motors?

321 Views Asked by At

So i have a problem which I modeled using PDDL. I want to implement the plan generated from this problem to a an existing Python code which controls two motors via Wi-Fi with a loop on VS Code (Python). I want this code to take my plan and execute it. Does this mean I need to define the actions I have as functions for my Python code and read the .plan file as a text and call the functions step by step? What are other options I might have?

Thank you for sparing your time!

1

There are 1 best solutions below

0
Victor Paléologue On

Yes, it means that for every action of your PDDL, you have a corresponding function. And for every object in your problem, you have a corresponding instance that you can pass as an argument to the functions.

When you get a plan, you must parse it, take the step of the plan and:

  • look up the function by your action name
  • look up the instances by name to pass them to the function. Once the function completes successfully, repeat.

Note that if you want to be able to interrupt the action while it is ongoing, you might need more complex kind of functions, if not objects.