Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision |
tutorials:beginner:package_for_turtlesim [2016/11/16 14:54] – [Creating a CRAM package] gkazhoya | tutorials:beginner:package_for_turtlesim [2019/07/03 11:47] – [Exporting the ASDF system to ROS] tlipps |
---|
| |
In the ''src'' subdirectory of your ROS workspace execute the following command: | In the ''src'' subdirectory of your ROS workspace execute the following command: |
<code bash>$ catkin_create_pkg cram_beginner_tutorial cram_language </code> | <code bash>$ catkin_create_pkg cram_my_beginner_tutorial cram_language </code> |
===== Setting up the Lisp infrastructure ===== | ===== Setting up the Lisp infrastructure ===== |
| |
==== Creating an ASDF system ==== | ==== Creating an ASDF system ==== |
| |
Switch into the root directory of the ''cram_beginner_tutorial'' package | Switch into the root directory of the ''cram_my_beginner_tutorial'' package |
and create a file ''cram-beginner-tutorial.asd''. You shouldn't use underscores but dashes in ''.asd'' file names. The reason is that the system that is defined in the ''.asd'' file should be named like the file itself and in Lisp it is very uncommon to use underscores in general. | and create a file ''cram-my-beginner-tutorial.asd''. You shouldn't use underscores but dashes in ''.asd'' file names. The reason is that the system that is defined in the ''.asd'' file should be named like the file itself and in Lisp it is very uncommon to use underscores in general. |
| |
Put the following content into ''cram-beginner-tutorial.asd'': | Put the following content into ''cram-my-beginner-tutorial.asd'': |
| |
<code lisp> | <code lisp> |
(defsystem cram-beginner-tutorial | (defsystem cram-my-beginner-tutorial |
:depends-on (cram-language) | :depends-on (cram-language) |
:components | :components |
| |
<code lisp> | <code lisp> |
(defpackage :cram-beginner-tutorial | (defpackage :cram-my-beginner-tutorial |
(:nicknames :tut) | (:nicknames :tut) |
(:use :cpl)) | (:use :cpl)) |
</code> | </code> |
| |
We define a package with the name ''cram-beginner-tutorial''. Packages in Common Lisp can have an arbitrary number of nicknames. In our case we nickname ''cram-beginner-tutorial'' as ''tut''. Finally, we define that the package uses another package ''cpl'' which is a nickname of the package ''cram-language'' from the metapackage ''cram_core''. | We define a package with the name ''cram-my-beginner-tutorial''. Packages in Common Lisp can have an arbitrary number of nicknames. In our case we nickname ''cram-my-beginner-tutorial'' as ''tut''. Finally, we define that the package uses another package ''cpl'' which is a nickname of the package ''cram-language'' from the metapackage ''cram_core''. |
| |
==== Exporting the ASDF system to ROS ==== | ==== Exporting the ASDF system to ROS ==== |
| |
<code lisp> | <code lisp> |
CL-USER> (ros-load:load-system "cram_beginner_tutorial" :cram-beginner-tutorial) | CL-USER> (ros-load:load-system "cram_my_beginner_tutorial" :cram-my-beginner-tutorial) |
</code> | </code> |
| |
This loads the ''cram-beginner-tutorial'' of the package ''cram_beginner_tutorial''. | This loads the ''cram-my-beginner-tutorial'' of the package ''cram_my_beginner_tutorial''. |
Test it by evaluating | Test it by evaluating |
| |