Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorials:intermediate:bullet_world [2022/04/12 14:35] – [Manipulating the kitchen] schimpf | tutorials:intermediate:bullet_world [2023/05/02 14:15] (current) – [Abstract entity descriptions] gkazhoya | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | **//Tested with Cram v0.7.0, ROS version: | + | **//Tested with Cram v0.8.0, ROS version: |
====== Bullet world demonstration ====== | ====== Bullet world demonstration ====== | ||
Line 308: | Line 308: | ||
<code lisp> | <code lisp> | ||
BTW-TUT> (prolog: | BTW-TUT> (prolog: | ||
- | (cram-robot-interfaces:robot ?robot) | + | (rob-int:robot ?robot) |
(btr: | (btr: | ||
NIL | NIL | ||
Line 332: | Line 332: | ||
BTW-TUT> | BTW-TUT> | ||
(def-fact-group costmap-metadata () | (def-fact-group costmap-metadata () | ||
- | (<- (location-costmap: | + | (<- (costmap-size 12 12)) |
- | (<- (location-costmap: | + | (<- (costmap-origin -6 -6)) |
- | (<- (location-costmap: | + | (<- (costmap-resolution 0.04)) |
- | + | ||
- | (<- (location-costmap: | + | (<- (costmap-padding 0.3)) |
- | (<- (location-costmap: | + | (<- (costmap-manipulation-padding 0.4)) |
- | (<- (location-costmap: | + | (<- (costmap-in-reach-distance 0.7)) |
- | (<- (location-costmap: | + | (<- (costmap-reach-minimal-distance 0.2)) |
- | (<- (location-costmap: | + | (<- (visibility-costmap-size 2)) |
- | (<- (location-costmap: | + | (<- (orientation-samples 2)) |
- | (<- (location-costmap: | + | (<- (orientation-sample-step 0.1))) |
</ | </ | ||
Now, we create an abstract location description that we call a // | Now, we create an abstract location description that we call a // | ||
Line 368: | Line 368: | ||
(type counter-top) | (type counter-top) | ||
| | ||
- | | + | |
| | ||
| | ||
Line 420: | Line 420: | ||
(btr: | (btr: | ||
' | ' | ||
- | | + | |
</ | </ | ||
The drawer is called ''" | The drawer is called ''" | ||
Line 441: | Line 441: | ||
(prolog '(and (btr: | (prolog '(and (btr: | ||
(btr: | (btr: | ||
- | (assert (btr: | + | (assert (btr: |
</ | </ | ||
Notice, that the joint name differs from the link name. Now the fork moves when the drawer is moved. | Notice, that the joint name differs from the link name. Now the fork moves when the drawer is moved. | ||
Line 447: | Line 447: | ||
(btr: | (btr: | ||
' | ' | ||
- | | + | |
</ | </ | ||
Every attachment can be checked with the following predicate: | Every attachment can be checked with the following predicate: | ||
<code lisp> | <code lisp> | ||
(prolog '(and (btr: | (prolog '(and (btr: | ||
- | (btr: | + | (btr: |
</ | </ | ||
This checks if there is any attachments between kitchen and fork. If needed, it is possible to set the name of a link to be specifically checked. Or set the ''? | This checks if there is any attachments between kitchen and fork. If needed, it is possible to set the name of a link to be specifically checked. Or set the ''? | ||
Line 458: | Line 458: | ||
(prolog '(and (btr: | (prolog '(and (btr: | ||
(btr: | (btr: | ||
- | (btr: | + | (btr: |
</ | </ | ||
This detaches the fork from all the links of the kitchen that it has been attached to. | This detaches the fork from all the links of the kitchen that it has been attached to. | ||
Line 538: | Line 538: | ||
and the following does: | and the following does: | ||
<code lisp> | <code lisp> | ||
- | BTW-TUT> (pr2-proj: | + | BTW-TUT> (urdf-proj: |
| | ||
</ | </ | ||
Line 545: | Line 545: | ||
==== Moving the robot in the Bullet world ==== | ==== Moving the robot in the Bullet world ==== | ||
- | In this part of the tutorial we will look into moving the robot and it's body parts as well as perceiving objects through the Bullet world. We will use functions from the '' | + | In this part of the tutorial we will look into moving the robot and it's body parts as well as perceiving objects through the Bullet world. We will use functions from the '' |
- | This teleporting is done by directly calling Prolog predicates that move objects in the world (for navigating the robot, simply teleport it to the goal), changing joint angles (to move the arm simply teleport the arm to given joint values) etc. '' | + | This teleporting is done by directly calling Prolog predicates that move objects in the world (for navigating the robot, simply teleport it to the goal), changing joint angles (to move the arm simply teleport the arm to given joint values) etc. '' |
Another package that we will use in this part of the tutorial is '' | Another package that we will use in this part of the tutorial is '' | ||
Line 569: | Line 569: | ||
BTW-TUT> (btr-utils: | BTW-TUT> (btr-utils: | ||
(cl-transforms: | (cl-transforms: | ||
- | | + | |
| | ||
</ | </ | ||
Line 605: | Line 605: | ||
<code lisp> | <code lisp> | ||
BTW-TUT> | BTW-TUT> | ||
- | (pr2-proj: | + | (urdf-proj: |
- | (pr2-proj:: | + | (urdf-proj:: |
| | ||
| | ||
Line 620: | Line 620: | ||
| | ||
| | ||
- | (pr2-proj:: | + | (urdf-proj:: |
- | (pr2-proj:: | + | (urdf-proj:: |
</ | </ | ||
- | As some of the functions in '' | + | As some of the functions in '' |
- | The function '' | + | The function '' |
<code lisp> | <code lisp> | ||
(prolog: | (prolog: | ||
</ | </ | ||
- | '' | + | '' |
Now, let us finally perceive the object and store the result in the '' | Now, let us finally perceive the object and store the result in the '' | ||
Line 635: | Line 635: | ||
BTW-TUT> | BTW-TUT> | ||
(defvar *perceived-object* nil " | (defvar *perceived-object* nil " | ||
- | (pr2-proj: | + | (urdf-proj: |
(setf *perceived-object* | (setf *perceived-object* | ||
- | (pr2-proj:: | + | (urdf-proj:: |
</ | </ | ||
Line 643: | Line 643: | ||
<code lisp> | <code lisp> | ||
- | (pr2-proj: | + | (urdf-proj: |
- | (let ((? | + | (urdf-proj:: |
- | (pr2-proj:: | + | |
</ | </ | ||