This is an old revision of the document!
CRAM v0.1 -> CRAM v0.2
cram_core
As the refactoring in v0.2 mostly affected higher level packages of CRAM and didn't influence cram_core
much, there's really not that much you need to do to migrate.
Step 1: Renaming ASDF systems
Search (grep) for designators
and process-modules
in all the *.asd
files of your packages and change designators
(from cram_designators
package) to cram-designators
and process-modules
to cram-process-modules
.
Step 2: Renaming CRAM_REASONING to CRAM_PROLOG
Search for cram_reasoning
in all the package.xml
and CMakeLists.txt
files of your packages and change cram_reasoning
to cram_prolog
.
Then search for cram-reasoning
in all the *.asd
and *.lisp
files of your packages and change cram-reasoning
to cram-prolog
. Also, search for crs
in all the *.lisp
files and change it to prolog
.
Step 3: designator properties as keywords
Search for all make-designator
and with-designators
and change the type of the designator from simple symbol to a keyword, e.g.
(make-designator 'location '((on table)))
should turn into
(make-designator :location '((on table)))
Next search for all make-designator
, with-designators
and (desig-prop ?
calls in all your Lisp files and change the designator properties there from simple symbols to keywords, e.g. 'on
should become :on
. Also, search for all desig-props
in all your Lisp files and get rid of them, e.g.
(desig-prop ?designator (desig-props:to desig-props:see))
should turn into
(desig-prop ?designator (:to :see))
Finally, you can search for def-desig-package
in all your package.lisp
files and get rid of def-desig-package
and designator-properties
there. This is not obligatory but it will make your code cleaner. E.g.:
(desig-props:def-desig-package :cram-designators (:use #:common-lisp #:cram-reasoning #:cut) (:nicknames :desig) (:desig-properties #:obj #:location #:object #:pose #:of #:at #:type #:trajectory #:action #:constraints))
should turn into
(defpackage :cram-designators (:use #:common-lisp #:cram-reasoning #:cut) (:nicknames :desig))
Step 4: one bracket less in WITH-DESIGNATORS
Finally, search for all with-designators
in your *.lisp
files and get rid of one extra bracket there, e.g.
(with-designators ((open-loc (:location `((:to :open) (:to :reach) (:obj ,?obj)))) ; <- 4 brackets in the end (open-action (:action `((:type :trajectory) (:to :open) (:obj ,?obj) (:angle ,?angle)))))
should turn into
(with-designators ((open-loc :location `((:to :open) (:to :reach) (:obj ,?obj))) ; <- 3 brackets in the end (open-action :action `((:type :trajectory) (:to :open) (:obj ,?obj) (:angle ,?angle))))
The idea behind this change was that the less brackets you have the better and that this way with-designators
will look a lot more like make-designator
, e.g.
(with-designators ((some-location :location '((:some :where)))))
(make-designator :location '((:some :where)))
If you don't like this change, please complain.