PlanSys2 / ros2_planning_system

This repo contains a PDDL-based planning system for ROS2.
Apache License 2.0
384 stars 86 forks source link

Problems with types in the problem expert #258

Open roveri-marco opened 1 year ago

roveri-marco commented 1 year ago

The types in the problem expert does not seem to be correct. Indeed, although they are specified correctly in the terminal, the problem.pddl file generated is wrong and causes popf to go in seg fault!

The source code that show the problem: assignment_3_5.zip

ros2 launch assignment_3_5 plansys2_simple_example_launch.py on terminal one ros2 run plansys2_terminal plansys2_terminal then in the terminal execute the commands set instance capacity_4 capacity_number source assignment_3_5/launch/commands

If you then issue a get plan the answer is no plan, but an investigation show that popf goes seg fault since the problem file is not precise.

The generated (correct) domain.pddl file domain.pddl.txt

The generated (wrong) problem.pddl file problem.pddl.txt

The plan file generated when popf is called plan.txt

The commands: commands.txt

The correct problem file to generate: good-problem.pddl.txt

fmrico commented 1 year ago

Hi @roveri-marco

I see that the bug is that it uses the base type instead the derived type of an instance, right?

roveri-marco commented 1 year ago

Not sure it is only that...

antbono commented 1 year ago

Hi everyone!

I think I also have an issue related to the domain expert... Like in the generated domain.pddl of @roveri-marco, also mine has a empty block for functions. This automatically generated block is an issue when the used solver does not support pddl 2.1

antbono commented 1 year ago

I tried to use the same example of @roveri-marco and I had the same issue. Moreover I cannot use the command source assignment_3_5/launch/commands

roveri-marco commented 1 year ago

I tried to use the same example of @roveri-marco and I had the same issue. Moreover I cannot use the command source assignment_3_5/launch/commands

It should work... Can you share the output?

roveri-marco commented 1 year ago

We can optimize the output to remove the function if no functions declared. It should be possible. I'll take care in one of the possible next pull request.

antbono commented 1 year ago

It should work... Can you share the output?

The output of the terminal is: Failing to open file "assignment_3_5/launch/commands"

I also found the following compilation error that could be related to this unexpected behavior

Screenshot from 2023-05-17 11-42-25

Strangely this error is reported only at the first attempt of building the package. If i try to build again everything goes well

antbono commented 1 year ago

It works specifying the absolute path of the commands file