Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tutorials:advanced:bullet_world_robot [2015/09/17 15:11] – [Robot URDF description] gkazhoyatutorials:advanced:bullet_world_robot [2015/09/17 15:54] (current) – [Boxy Prolog description] gkazhoya
Line 64: Line 64:
 ===== Directory / file setup ===== ===== Directory / file setup =====
  
-Now let's setup a directory structure for our own packages: a directory (repo) and the metapackage inside: in the ''src'' of a catkin workspace create a new directory, we will call it ''cram_boxy''. Therein create a catkin metapackage with the same name:+Now let's setup a directory structure for our own packages: a directory (repo) and the metapackage inside: in the ''src'' of a catkin workspace create a new directory, we will call it ''cram_quadrotor''. Therein create a catkin metapackage with the same name:
  
 <code bash> <code bash>
-mkdir cram_boxy && cd cram_boxy +mkdir cram_quadrotor && cd cram_quadrotor 
-catkin_create_pkg cram_boxy && cd cram_boxy+catkin_create_pkg cram_quadrotor && cd cram_quadrotor
 </code> </code>
  
Line 75: Line 75:
 <code cmake> <code cmake>
 cmake_minimum_required(VERSION 2.8.3) cmake_minimum_required(VERSION 2.8.3)
-project(cram_boxy)+project(cram_quadrotor)
 find_package(catkin REQUIRED) find_package(catkin REQUIRED)
 catkin_metapackage() catkin_metapackage()
 </code> </code>
  
-The first ROS package we will create will be the Prolog description of our robot. We will call it ''cram_boxy_description''+The first ROS package we will create will be the Prolog description of our robot. We will call it ''cram_quadrotor_description''
-Go back to the root of your ''cram_boxy'' directory and create the package. The dependencies we will definitely need for now will be ''cram_prolog'' (as we're defining Prolog rules) and ''cram_robot_interfaces'' (which defines the names of predicates for describing robots in CRAM):+Go back to the root of your ''cram_quadrotor'' directory and create the package. The dependencies we will definitely need for now will be ''cram_prolog'' (as we're defining Prolog rules) and ''cram_robot_interfaces'' (which defines the names of predicates for describing robots in CRAM):
  
 <code bash> <code bash>
 cd .. cd ..
-catkin_create_pkg cram_boxy_knowledge cram_prolog cram_robot_interfaces+catkin_create_pkg cram_quadrotor_knowledge cram_prolog cram_robot_interfaces
 </code> </code>
  
-Now let's create the corresponding ASDF file called ''cram_boxy_knowledge/cram-boxy-knowledge.asd'':+Now let's create the corresponding ASDF file called ''cram_quadrotor_knowledge/cram-quadrotor-knowledge.asd'':
  
 <code lisp> <code lisp>
 ;;; You might want to add a license header first ;;; You might want to add a license header first
  
-(defsystem cram-boxy-knowledge+(defsystem cram-quadrotor-knowledge
   :author "Your Name"   :author "Your Name"
   :license "BSD"   :license "BSD"
Line 102: Line 102:
     :components     :components
     ((:file "package")     ((:file "package")
-     (:file "boxy-knowledge" :depends-on ("package"))))))+     (:file "quadrotor-knowledge" :depends-on ("package"))))))
 </code> </code>
  
-Now create the corresponding ''src'' directory and a ''cram_boxy_knowledge/src/package.lisp'' file in it:+Now create the corresponding ''src'' directory and a ''cram_quadrotor_knowledge/src/package.lisp'' file in it:
  
 <code lisp> <code lisp>
Line 112: Line 112:
 (in-package :cl-user) (in-package :cl-user)
  
-(defpackage cram-boxy-knowledge+(defpackage cram-quadrotor-knowledge
   (:use #:common-lisp   (:use #:common-lisp
         #:cram-prolog         #:cram-prolog
Line 118: Line 118:
 </code> </code>
  
-Also, an empty ''cram_boxy/cram_boxy_knowledge/src/boxy-knowledge.lisp''.+Also, an empty ''cram_quadrotor/cram_quadrotor_knowledge/src/quadrotor-knowledge.lisp''.
  
-Now, let's compile our new packages and load them through the REPL:+Now, let's compile our new packages (''catkin_make''and load them through the REPL (you need to restart your REPL after you create a new ROS package so that it finds it):
  
 <code lisp> <code lisp>
 CL-USER> , CL-USER> ,
 ros-load-system ros-load-system
-cram_boxy_knowledge +cram_quadrotor_knowledge 
-cram-boxy-knowledge+cram-quadrotor-knowledge
 </code> </code>
  
Line 134: Line 134:
 Now, let's describe our robot in Prolog, such that we could do some reasoning with it. Now, let's describe our robot in Prolog, such that we could do some reasoning with it.
  
-We fill in the file ''cram_boxy/cram_boxy_knowledge/src/boxy-knowledge.lisp'' with some simple descriptions of Boxy, which are the ones relevant for navigation and vision. We will leave manipulation out for now as it is too complex for the scope of this tutorial.+We fill in the file ''cram_quadrotor/cram_quadrotor_knowledge/src/quadrotor-knowledge.lisp'' with some simple descriptions of our robot, which are the ones relevant for navigation and vision. For robots with arms one could also implement manipulation-specific functionality but this is too complex for the scope of this tutorial.
  
 As can be seen from the TF tree, our robot has 3 camera frames, 1 depth and 1 RGB frame from a Kinect camera, and an RGB frame from a Kinect2 camera. As can be seen from the TF tree, our robot has 3 camera frames, 1 depth and 1 RGB frame from a Kinect camera, and an RGB frame from a Kinect2 camera.