Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pddl_planner/demos/2013_fridge_demo] fix bug #81

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Naoki-Hiraoka
Copy link
Contributor

@Naoki-Hiraoka Naoki-Hiraoka commented Jun 19, 2020

I fixed two bugs in 2013_fridge_demo.

  1. mismatch precondition
    move-to

    :precondition '((AT ?FROM)
    (NOT (= ?FROM SOMEWHERE))
    (NOT (= ?FROM ?TO)))

    move-to_f
    :precondition '((AT ?FROM)
    (NOT (= ?TO SOMEWHERE))
    (NOT (= ?FROM ?TO)))

  2. Currently, the planner intentionally uses the failure action in the main plan.

The planner exploits the following actions to close door in the main plan.

(move-to_f hoge fuga)
(try-close)
(move-recoverly)
(move-to FRONTFRIDGE START)

This PR removed failure actions from domain while keeping error recovery.

before this fix
Screenshot from 2021-03-03 15-34-13

after this fix
Screenshot from 2021-03-03 15-35-42

result of pddl
debug png-1

@k-okada
Copy link
Member

k-okada commented Oct 2, 2023

something wrong, the test fails, even on local environment


[INFO] [1696228221.417916]: [/pddl_planner] result => [u'(TRY-CLOSE)', u'(MOVE-RECOVERLY)', u'(MOVE-TO FRONTFRIDGE START)']
[INFO] [1696228221.420078]: [/pddl_planner] action finished with success
waiting pddl_planner
get actionlib server
send goal and waiting...
[INFO] [1696228221.453325]: [/pddl_planner] take a message
[INFO] [1696228221.454916]: [/pddl_planner] gen_tmp_pddl_file: requirements::typing
[INFO] [1696228221.456375]: [/pddl_planner] problem_path => /tmp/problem_k18R6b
[INFO] [1696228221.458324]: [/pddl_planner] domain_path => /tmp/domain_ezdWli
[INFO] [1696228221.459781]: [/pddl_planner] Command: rosrun ffha ffha -i 120 -f /tmp/problem_k18R6b -o /tmp/domain_ezdWli
[INFO] [1696228221.665023]: [/pddl_planner]  none, i.e. plan length

no metric specified. plan length assumed.
setting gtt = 1.0 to simulate STRIPS planning.


checking for cyclic := effects --- OK.display info is 120

ff: search configuration is EHC, if that fails then  best-first on 1*g(s) + 5*h(s) where
    metric is  plan length

Real initial cost 5.000000, with 5 actions


Cueing down from goal distance:   5.00 into depth [1][2]
                                  4.00             [1][2][3]
                                  3.00             [1]
                                  2.00             [1][2]
                                  1.00             [1]
                                  0.00             

ff: found legal plan (steps: 9) as follows
   0: (TRY-CLOSE)
   1: (MOVE-RECOVERLY)
   2: (OPEN-DOOR)
   3: (MOVE-TO FRONTFRIDGE PREGRASP)
   4: (GRASP-OBJECT CAN)
   5: (MOVE-TO PREGRASP START)
   6: (MOVE-TO START PRECLOSE)
   7: (CLOSE-DOOR)
   8: (MOVE-TO PRECLOSE START)

@Naoki-Hiraoka
Copy link
Contributor Author

Naoki-Hiraoka commented Oct 3, 2023

3年前のことで記憶がありませんが、このPRは最初のコメントに書かれている2点の他に、もう1つバグ?の修正をしているようです。

  1. ロボットが移動に失敗して迷った場合に行く場所である"SOMEWHERE"に、能動的にmove-toで移動する行動がmain planに入っている. SOMEWHEREにいるとリカバリアクションである"try-close"アクションでドアを閉めることができるため、ドアを閉めたいときに正規の"close-door"アクションを使わずにドアを閉めるハッキングができてしてしまっている。
(MOVE-TO START FRONTFRIDGE)
(OPEN-DOOR)
(MOVE-TO FRONTFRIDGE PREGRASP)
(GRASP-OBJECT CAN)
(MOVE-TO PREGRASP START)
(MOVE-TO START SOMEWHERE)
(TRY-CLOSE)
(MOVE-RECOVERLY)
(MOVE-TO FRONTFRIDGE START)

このPRでは、このハッキングを禁止するために、move-toのpreconditionに (NOT (= ?TO SOMEWHERE))を追加しています。

テストを通るようにするためには、

sequence_action: ['(MOVE-TO START FRONTFRIDGE)', '(OPEN-DOOR)', '(MOVE-TO FRONTFRIDGE PREGRASP)', '(GRASP-OBJECT CAN)', '(MOVE-TO PREGRASP START)', '(MOVE-TO START SOMEWHERE)', '(TRY-CLOSE)', '(MOVE-RECOVERLY)', '(MOVE-TO FRONTFRIDGE START)']

を修正してtry-closeを使わないプランを正解として書く必要があります。

これがバグなのか、ハッキングを興味深いとする原作者の意図的なものなのか分からないのですが、バグであるとみなして大丈夫でしょうか?

@Naoki-Hiraoka
Copy link
Contributor Author

Naoki-Hiraoka commented Oct 3, 2023

  1. Currently, the planner intentionally uses the failure action in the main plan.

については、このデモに限らずtask-compiler全体の問題になります。
task-compilerのデモでは、計画する際に利用可能なアクションのリストの中に失敗アクションが入っています。計画する際に利用可能なアクションの中に失敗アクションが入っていると、失敗アクションを意図的に使うプランが出てくる恐れがあります。計画する際に利用可能なアクションの中には失敗アクションを含めず、計画後に失敗状態を生成する際にだけ失敗アクションを使う、という方式に変えているのが、このPRです。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants