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

Modified Files:
        ctrl.cc model_laser.cc 
Log Message:
working on demos

Index: model_laser.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstage/model_laser.cc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** model_laser.cc      18 Feb 2008 03:52:30 -0000      1.3
--- model_laser.cc      21 Feb 2008 05:57:43 -0000      1.4
***************
*** 174,179 ****
  void StgModelLaser::Update( void )
  {     
-   StgModel::Update();
-   
    double bearing = -fov/2.0;
    double sample_incr = fov / (double)(sample_count-1);  
--- 174,177 ----
***************
*** 229,232 ****
--- 227,232 ----
     
     data_dirty = true;
+ 
+   StgModel::Update();  
  }
  

Index: ctrl.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstage/ctrl.cc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ctrl.cc     21 Feb 2008 03:35:05 -0000      1.2
--- ctrl.cc     21 Feb 2008 05:57:43 -0000      1.3
***************
*** 32,37 ****
  int LaserUpdate( StgModel* mod, robot_t* robot )
  {
    robot->pos->SetSpeed( 0.1, 0, 0.1 );  
!   return FALSE; // run again
  }
  
--- 32,47 ----
  int LaserUpdate( StgModel* mod, robot_t* robot )
  {
+   // inspect the laser data and decide what to do
+   uint32_t sample_count=0;
+   stg_laser_sample_t* scan = robot->laser->GetSamples( &sample_count );
+   assert(scan);
+ 
+   printf( "Laser %u samples\n", sample_count );
+   for( uint32_t s=0; s<sample_count; s++ )
+     printf( "%.2f ", scan[s] );
+   puts("");
+ 
    robot->pos->SetSpeed( 0.1, 0, 0.1 );  
!   return 0; // run again
  }
  
***************
*** 43,47 ****
          pose.x, pose.y, pose.z, pose.a );
  
!   return FALSE; // run again
  }
  
--- 53,57 ----
          pose.x, pose.y, pose.z, pose.a );
  
!   return 0; // run again
  }
  


-------------------------------------------------------------------------
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