Update of /cvsroot/playerstage/code/stage/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9073/src

Modified Files:
      Tag: release-2-1-patches
        model_gripper.c p_simulation.cc 
Log Message:
removed a couple of simulation debug printf's
Applied patches:
1912203           Grip location patch
1912201           add disable optmize configur option



Index: model_gripper.c
===================================================================
RCS file: /cvsroot/playerstage/code/stage/src/Attic/model_gripper.c,v
retrieving revision 1.26
retrieving revision 1.26.8.1
diff -C2 -d -r1.26 -r1.26.8.1
*** model_gripper.c     12 May 2006 22:09:50 -0000      1.26
--- model_gripper.c     16 Mar 2008 02:14:41 -0000      1.26.8.1
***************
*** 438,443 ****
  
  int gripper_paddle_contact( stg_model_t* mod, 
!                           stg_gripper_config_t* cfg,
!                           double contacts[2] )
  { 
    stg_geom_t geom;
--- 438,443 ----
  
  int gripper_paddle_contact( stg_model_t* mod, 
!   stg_gripper_config_t* cfg,
!   double contacts[2] )
  { 
    stg_geom_t geom;
***************
*** 456,464 ****
    // y location of paddle beam origin
  
!     lpz.y = (1.0 - cfg->paddle_position) * 
!       ((geom.size.y/2.0) - (geom.size.y*cfg->paddle_size.y));
  
!     rpz.y = (1.0 - cfg->paddle_position) * 
!       -((geom.size.y/2.0) - (geom.size.y*cfg->paddle_size.y));
    
  /*   // if we're opening, we check the outside of the paddle instead */
--- 456,464 ----
    // y location of paddle beam origin
  
!   lpz.y = (1.0 - cfg->paddle_position) * 
!     ((geom.size.y/2.0) - (geom.size.y*cfg->paddle_size.y));
  
!   rpz.y = (1.0 - cfg->paddle_position) * 
!     -((geom.size.y/2.0) - (geom.size.y*cfg->paddle_size.y));
    
  /*   // if we're opening, we check the outside of the paddle instead */
***************
*** 485,496 ****
  
    itl_t* litl = itl_create( lpz.x, lpz.y, lpz.a, 
!                          bbr,
!                          mod->world->matrix, 
!                          PointToBearingRange );
  
    itl_t* ritl = itl_create( rpz.x, rpz.y, rpz.a, 
!                          bbr,
!                          mod->world->matrix, 
!                          PointToBearingRange );
    
    stg_model_t* lhit = NULL;
--- 485,496 ----
  
    itl_t* litl = itl_create( lpz.x, lpz.y, lpz.a, 
!     bbr,
!     mod->world->matrix, 
!     PointToBearingRange );
  
    itl_t* ritl = itl_create( rpz.x, rpz.y, rpz.a, 
!     bbr,
!     mod->world->matrix, 
!     PointToBearingRange );
    
    stg_model_t* lhit = NULL;
***************
*** 507,558 ****
    // if the breakbeam strikes anything
    if( (lhit = itl_first_matching( litl, gripper_raytrace_match, mod )) )
!     {
!       contacts[0] = 1; // touching something
!       
!       //if( cfg->paddles == STG_GRIPPER_PADDLE_CLOSING || 
!       //  cfg->paddles == STG_GRIPPER_PADDLE_OPENING )
!       //cfg->paddles_stalled = TRUE;
        
!       //puts( "left hit" );
!     }
  
        
    if( (rhit = itl_first_matching( ritl, gripper_raytrace_match, mod )))
!     {
!       contacts[1] = 1;      
!       //puts( "right hit" );
!     }
    
    if( lhit && (lhit == rhit) )
      {
!       //puts( "left and right hit same thing" );
        
!       if(  cfg->paddles == STG_GRIPPER_PADDLE_CLOSING )
!       {
!         // grab the model we hit - very simple grip model for now
!         stg_model_set_parent( lhit, mod );
!         
!         // and move it to be right between the paddles
!         stg_geom_t hitgeom;
!         stg_model_get_geom( lhit, &hitgeom );
!         
!         stg_pose_t pose;
!         pose.x = hitgeom.size.x/2.0;
!         pose.y = 0;
!         pose.a = 0;
!         
!         stg_model_set_pose( lhit, &pose );          
!         
!         // add this item to the stack
!         cfg->grip_stack = g_slist_prepend( cfg->grip_stack, lhit );
!         
!         // calculate how far closed we can get the paddles now
!         double puckw = hitgeom.size.y;
!         double gripperw = geom.size.y;              
!         
!         cfg->close_limit = 
!           MAX( 0.0, 1.0 - puckw/(gripperw - cfg->paddle_size.y/2.0 )); 
!       }
      }
  
    itl_destroy( litl );
--- 507,557 ----
    // if the breakbeam strikes anything
    if( (lhit = itl_first_matching( litl, gripper_raytrace_match, mod )) )
!   {
!     contacts[0] = 1; // touching something
!     
!     //if( cfg->paddles == STG_GRIPPER_PADDLE_CLOSING || 
!     //  cfg->paddles == STG_GRIPPER_PADDLE_OPENING )
!       //cfg->paddles_stalled = TRUE;
        
!     //puts( "left hit" );
!   }
  
        
    if( (rhit = itl_first_matching( ritl, gripper_raytrace_match, mod )))
!   {
!     contacts[1] = 1;      
!     //puts( "right hit" );
!   }
    
    if( lhit && (lhit == rhit) )
+   {
+     //puts( "left and right hit same thing" );
+     
+     if(  cfg->paddles == STG_GRIPPER_PADDLE_CLOSING )
      {
!       // get the global pose of the gripper for calculations of the gripped 
object position
!         // and move it to be right between the paddles
!       stg_geom_t hitgeom;
!       stg_model_get_geom( lhit, &hitgeom );
! 
!       stg_pose_t pose = {0,0,0};
!       stg_model_local_to_global( lhit, &pose );
!       stg_model_global_to_local( mod, &pose );
! 
!       // grab the model we hit - very simple grip model for now
!       stg_model_set_parent( lhit, mod );
! 
!       stg_model_set_pose( lhit, &pose );
        
!         // add this item to the stack
!       cfg->grip_stack = g_slist_prepend( cfg->grip_stack, lhit );
!       
!       // calculate how far closed we can get the paddles now
!       double puckw = hitgeom.size.y;
!       double gripperw = geom.size.y;        
!       
!       cfg->close_limit = MAX( 0.0, 1.0 - puckw/(gripperw - 
cfg->paddle_size.y/2.0 ));
      }
+   }
  
    itl_destroy( litl );

Index: p_simulation.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/src/Attic/p_simulation.cc,v
retrieving revision 1.23
retrieving revision 1.23.4.1
diff -C2 -d -r1.23 -r1.23.4.1
*** p_simulation.cc     2 Nov 2007 00:06:51 -0000       1.23
--- p_simulation.cc     16 Mar 2008 02:14:41 -0000      1.23.4.1
***************
*** 241,245 ****
        (player_simulation_pose2d_req_t*)data;
        
!       printf( "Stage: received request for position of object \"%s\"\n", 
req->name );
        
        // look up the named model      
--- 241,245 ----
        (player_simulation_pose2d_req_t*)data;
        
!       //printf( "Stage: received request for position of object \"%s\"\n", 
req->name );
        
        // look up the named model      
***************
*** 251,256 ****
        stg_pose_t* pose = &mod->pose;
  
!       printf( "Stage: returning location (%.2f,%.2f,%.2f)\n",
!               pose->x, pose->y, pose->a );
  
  
--- 251,255 ----
        stg_pose_t* pose = &mod->pose;
  
!       //printf( "Stage: returning location (%.2f,%.2f,%.2f)\n", pose->x, 
pose->y, pose->a );
  
  


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to