Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
tutorials:intermediate:bullet_world [2019/07/08 17:17] – [Moving the robot in the Bullet world] gkazhoyatutorials:intermediate:bullet_world [2019/07/08 17:22] – [Moving the robot in the Bullet world] gkazhoya
Line 595: Line 595:
 <html><!-- <html><!--
 To execute any plan in CRAM, we need a top-level context. Besides that we also use a macro to specify that the demo should be executed in simulation, not on the real robot. Putting your plan under ''pr2-proj:with-simulated-robot'' will indicate that your robot is in the projection environment and it also has a top level call within it. The ''with-simulated-robot'' is a way to abstract out the robot details from your plans and its counterpart to execute on a real robot would be ''pr2-pms:with-real-robot''. Also note that without mentioning the robot that you want to execute on, the TF for it is not published and you'll run into errors.  To execute any plan in CRAM, we need a top-level context. Besides that we also use a macro to specify that the demo should be executed in simulation, not on the real robot. Putting your plan under ''pr2-proj:with-simulated-robot'' will indicate that your robot is in the projection environment and it also has a top level call within it. The ''with-simulated-robot'' is a way to abstract out the robot details from your plans and its counterpart to execute on a real robot would be ''pr2-pms:with-real-robot''. Also note that without mentioning the robot that you want to execute on, the TF for it is not published and you'll run into errors. 
 +We can execute some movements in parallel, if they use different joints of the robot. That's what ''cpl:par'' is for. 
 +We have used a simple call to low level methods to achieve motions like move to the ''?grasp-base-pose'' and look at ''?grasp-look-pose''. These can be achieved by corresponding motion designators, which we will look at in later tutorials.
 --></html> --></html>
  
Line 616: Line 618:
                            0.05106258161229582d0))                            0.05106258161229582d0))
   (pr2-proj::drive ?grasp-base-pose)   (pr2-proj::drive ?grasp-base-pose)
-  (pr2-proj::look-at-pose-stamped ?grasp-look-pose))+  (pr2-proj::look-at :pose ?grasp-look-pose))
 </code> </code>
-As some of the functions in ''cram-pr2-projection'' package need a running TF listener object, so wrapped our calls in ''pr2-proj:with-simulated-robot''.+As some of the functions in ''cram-pr2-projection'' package need a running TF listener object, we wrapped our calls in ''pr2-proj:with-simulated-robot''.
  
-We can execute some movements in parallel, if they use different joints of the robot. That's what ''cpl:par'' is for. The function ''park-arms'' performs a motion on the joints of both arms, which brings them into a specific position, so they don't hang around the field of view. We have used a simple call to low level methods to achieve motions like move to the ''?grasp-base-pose'' and look at ''?grasp-look-pose''. These can be achieved by corresponding motion designators, which we will look at in later tutorials.+The function ''pr2-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  
 +<code lisp> 
 +(prolog:prolog '(btr:assert ?world (btr:object-pose ?robot ?target-pose))) 
 +</code> 
 +''pr2-proj::look-at'' calculates the pan and tilt angles of the robot's neck such that it ends up looking at the specified point, and asserts these angles to the neck joints.
  
-To grasp the bottle we need to have its pose in the room. Thereforewe first perceive it and store the result in ''*perceived-object*'':+Nowlet us finally perceive the object and store the result in the ''*perceived-object*'' variable:
 <code lisp> <code lisp>
 BTW-TUT> BTW-TUT>