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:intermediate:bullet_world [2022/04/12 15:04] – [Moving the robot in the Bullet world] schimpftutorials: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: Kinetic, Ubuntu 16.04//**+**//Tested with Cram v0.8.0, ROS version: Noetic, Ubuntu 20.04//**
  
 ====== Bullet world demonstration ====== ====== Bullet world demonstration ======
Line 308: Line 308:
 <code lisp> <code lisp>
 BTW-TUT> (prolog:prolog '(and (btr:bullet-world ?world) BTW-TUT> (prolog:prolog '(and (btr:bullet-world ?world)
-                              (assert (btr:object-pose ?world :pr2 +                              (rob-int:robot ?robot) 
-                                                       ((0.5 0) (0 0 1 0))))))+                              (btr:visible ?world ?robot mug-1)))
 NIL NIL
 </code> </code>
Line 332: Line 332:
 BTW-TUT> BTW-TUT>
 (def-fact-group costmap-metadata () (def-fact-group costmap-metadata ()
-    (<- (:costmap-size 12 12)) +    (<- (costmap-size 12 12)) 
-    (<- (:costmap-origin -6 -6)) +    (<- (costmap-origin -6 -6)) 
-    (<- (:costmap-resolution 0.04))+    (<- (costmap-resolution 0.04))
    
-    (<- (:costmap-padding 0.3)) +    (<- (costmap-padding 0.3)) 
-    (<- (:costmap-manipulation-padding 0.4)) +    (<- (costmap-manipulation-padding 0.4)) 
-    (<- (:costmap-in-reach-distance 0.7)) +    (<- (costmap-in-reach-distance 0.7)) 
-    (<- (:costmap-reach-minimal-distance 0.2)) +    (<- (costmap-reach-minimal-distance 0.2)) 
-    (<- (:visibility-costmap-size 2)) +    (<- (visibility-costmap-size 2)) 
-    (<- (:orientation-samples 2)) +    (<- (orientation-samples 2)) 
-    (<- (:orientation-sample-step 0.1)))+    (<- (orientation-sample-step 0.1)))
 </code> </code>
 Now, we create an abstract location description that we call a //designator//. The abstract description gets grounded into specific geometric coordinates with the ''reference'' function.  Now, we create an abstract location description that we call a //designator//. The abstract description gets grounded into specific geometric coordinates with the ''reference'' function. 
Line 538: Line 538:
 and the following does: and the following does:
 <code lisp> <code lisp>
-BTW-TUT> (pr2-proj:with-simulated-robot+BTW-TUT> (urdf-proj:with-simulated-robot
            (cl-tf:lookup-transform cram-tf:*transformer* "map" "l_gripper_tool_frame"))            (cl-tf:lookup-transform cram-tf:*transformer* "map" "l_gripper_tool_frame"))
 </code> </code>
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 ''cram_pr2_projection'' package, which implements a simple robot simulator in the Bullet world. This robot simulator does not execute motions in a continuous manner, but by teleporting through key poses. +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 ''cram-urdf-projection'' package, which implements a simple robot simulator in the Bullet world. This robot simulator does not execute motions in a continuous manner, but by teleporting through key poses. 
-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. ''cram_pr2_projection'' also uses Prolog predicates for attaching and detaching objects to the robot, as we did with the fork and the drawer.+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. ''cram-urdf-projection'' also uses Prolog predicates for attaching and detaching objects to the robot, as we did with the fork and the drawer.
  
 Another package that we will use in this part of the tutorial is ''cram_bullet_reasoning_utilities'', which has a number of utility functions to make rapid prototyping with the Bullet world faster and easier. Another package that we will use in this part of the tutorial is ''cram_bullet_reasoning_utilities'', which has a number of utility functions to make rapid prototyping with the Bullet world faster and easier.
Line 623: Line 623:
   (urdf-proj::look-at ?grasp-look-pose nil))   (urdf-proj::look-at ?grasp-look-pose nil))
 </code> </code>
-As some of the functions in ''cram-pr2-projection'' package need a running TF listener object, we wrapped our calls in ''urdf-proj:with-simulated-robot''.+As some of the functions in ''cram-urdf-projection'' package need a running TF listener object, we wrapped our calls in ''urdf-proj:with-simulated-robot''.
  
-The function ''urdf-proj::move-joints'' moves the joints of both arms, which brings them into a specific position, specified in the arguments, so they don't hang around the field of view. ''pr2-proj::drive'' moves the robot, by internally calling +The function ''urdf-proj::move-joints'' moves the joints of both arms, which brings them into a specific position, specified in the arguments, so they don't hang around the field of view. ''urdf-proj::drive'' moves the robot, by internally calling 
 <code lisp> <code lisp>
 (prolog:prolog '(btr:assert ?world (btr:object-pose ?robot ?target-pose))) (prolog:prolog '(btr:assert ?world (btr:object-pose ?robot ?target-pose)))