software:cram:development_experiences:new_goals
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| software:cram:development_experiences:new_goals [2013/04/26 11:22] – created bartelsg | software:cram:development_experiences:new_goals [2016/05/19 09:19] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ===== How to register and achieve a new goal ===== | ===== How to register and achieve a new goal ===== | ||
| + | |||
| + | ==== A plan for a new goal ==== | ||
| + | |||
| + | Let's assume we wanna write a plan to achieve a new goal, e.g. to flip a pancake. Best practice is to put this plan into one of the source-files of a plan library, e.g. cram_plan_library: | ||
| + | |||
| + | |||
| + | <code lisp> | ||
| + | (def-goal (achieve (flip-pancake ...)) | ||
| + | (with-designators ((action-desig | ||
| + | | ||
| + | ...) | ||
| + | ... | ||
| + | (perform action))) | ||
| + | </ | ||
| + | |||
| + | If you want other packages to also use this plan, export the goal-symbol in the package.lisp of the your plan library. Make sure to also export all designator properties used in your plan: | ||
| + | |||
| + | <code lisp> | ||
| + | (desig-props: | ||
| + | ... | ||
| + | | ||
| + | #: | ||
| + | ...) | ||
| + | | ||
| + | </ | ||
| + | |||
| + | Catch #1: If you one of your manipulation process modules, e.g. the pr2_manipulation_process_module, | ||
| + | |||
| + | Catch #2: You also need to export the goal-symbol, | ||
| + | |||
| + | < | ||
| + | WARNING: | ||
| + | | ||
| + | #< | ||
| + | | ||
| + | </ | ||
| + | ==== How to use/achieve the new plan ==== | ||
| + | |||
| + | You can now try to achieve your new goal like this: | ||
| + | |||
| + | <code lisp> | ||
| + | (top-level | ||
| + | (cpm: | ||
| + | (pr2-manipulation-process-module) | ||
| + | (achieve `(flip-pancake)))) | ||
| + | </ | ||
| + | |||
| + | You need to make sure that cram_environment_representation is loaded (either in your package that uses cram_plan_library or in your REPL). Otherwise (holds ...) will not be known. | ||
software/cram/development_experiences/new_goals.1366975359.txt.gz · Last modified: (external edit)
