This is an old revision of the document!
Setting up the Bullet world with a new robot
This tutorial will walk you though creating your own repo / metapackage from scratch that will use CRAM and Bullet world with your own robots. In this tutorial we will use the Boxy robot as an example.
The starting point of this tutorial is an installation of CRAM including projection with PR2. If you followed the installation manual, you should have all the necessary packages already.
Directory / file setup
First of all, let's create a directory for our code and the metapackage: 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:
mkdir cram_boxy && cd cram_boxy catkin_create_pkg cram_boxy && cd cram_boxy
Edit the CMakeLists.txt
such that it contains only the metapackage boilerplate code:
cmake_minimum_required(VERSION 2.8.3) project(cram_boxy) find_package(catkin REQUIRED) catkin_metapackage()
The first ROS package we will create will be the Prolog description of our robot. We will call it cram_boxy_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):
cd .. catkin_create_pkg cram_boxy_knowledge cram_prolog cram_robot_interfaces
Now let's create the corresponding ASD file called cram_boxy_knowledge/cram-boxy-knowledge.asd
:
;;; You might want to add a license header first (defsystem cram-boxy-knowledge :author "Your Name" :license "BSD" :depends-on (cram-prolog cram-robot-interfaces) :components ((:module "src" :components ((:file "package") (:file "boxy-knowledge" :depends-on ("package"))))))
Now create the corresponding src
directory and a cram_boxy_knowledge/src/package.lisp
file in it:
;;; license (in-package :cl-user) (defpackage cram-boxy-knowledge (:use #:common-lisp #:cram-prolog #:cram-robot-interfaces))
Robot URDF description
Now, before creating the file with the actual code (called boxy-knowledge.lisp
as you can see from the cram-boxy-knowledge.asd
file), we first need a URDF description of our robot. For Boxy it is located in a repo on Github, so let's clone it into our ROS workspace:
cd ROS_WORKSPACE_FOR_LISP_CODE cd src git clone https://github.com/code-iai/iai_robots.git
Compile the workspace package and
…as well as the cram_boxy_knowledge/src/boxy-knowledge.lisp
file: