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

Modified Files:
      Tag: opengl
        Makefile.am p_graphics3d.cc p_laser.cc p_position.cc 
Log Message:
fixed plugin

Index: p_position.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstageplugin/Attic/p_position.cc,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** p_position.cc       27 Nov 2007 05:36:02 -0000      1.1.2.2
--- p_position.cc       24 Dec 2007 11:20:37 -0000      1.1.2.3
***************
*** 74,81 ****
      //memset( &scmd, 0, sizeof(scmd));
  
!     mod->goal.x = pcmd->vel.px;
!     mod->goal.y = pcmd->vel.py;
!     mod->goal.a = pcmd->vel.pa;
!     mod->control_mode = STG_POSITION_CONTROL_VELOCITY;
  
      return 0;
--- 74,78 ----
      //memset( &scmd, 0, sizeof(scmd));
  
!     mod->SetSpeed( pcmd->vel.px, pcmd->vel.py, pcmd->vel.pa );
  
      return 0;
***************
*** 93,101 ****
      memset( &scmd, 0, sizeof(scmd));
  
!     mod->goal.x = pcmd->pos.px;
!     mod->goal.y = pcmd->pos.py;
!     mod->goal.a = pcmd->pos.pa;
!     mod->control_mode = STG_POSITION_CONTROL_POSITION;
! 
      return 0;
    }
--- 90,94 ----
      memset( &scmd, 0, sizeof(scmd));
  
!     mod->GoTo( pcmd->vel.px, pcmd->vel.py, pcmd->vel.pa );
      return 0;
    }
***************
*** 112,120 ****
      memset( &scmd, 0, sizeof(scmd));
  
!     mod->goal.x = pcmd->velocity;
!     mod->goal.y = 0;
!     mod->goal.a = pcmd->angle;
!     mod->control_mode = STG_POSITION_CONTROL_VELOCITY;
! 
      return 0;
    }
--- 105,109 ----
      memset( &scmd, 0, sizeof(scmd));
  
!     mod->SetSpeed( pcmd->velocity, 0, pcmd->angle );
      return 0;
    }

Index: p_graphics3d.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstageplugin/Attic/p_graphics3d.cc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** p_graphics3d.cc     4 Oct 2007 01:17:03 -0000       1.1.2.1
--- p_graphics3d.cc     24 Dec 2007 11:20:37 -0000      1.1.2.2
***************
*** 37,43 ****
  #endif
  
! #include <GL/gl.h>
! #include <GL/glu.h>
! #include <GL/glext.h>
  
  extern GList* dl_list;
--- 37,43 ----
  #endif
  
! //#include <gl.h>
! //#include <glu.h>
! //#include <glext.h>
  
  extern GList* dl_list;
***************
*** 121,127 ****
  }
  
! int InterfaceGraphics3d::ProcessMessage(MessageQueue* resp_queue,
!                                player_msghdr_t* hdr,
!                                void* data)
  {
  
--- 121,127 ----
  }
  
! int InterfaceGraphics3d::ProcessMessage( QueuePointer & resp_queue,
!                                        player_msghdr_t* hdr,
!                                        void* data)
  {
  

Index: Makefile.am
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstageplugin/Attic/Makefile.am,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** Makefile.am 27 Nov 2007 05:36:02 -0000      1.1.2.2
--- Makefile.am 24 Dec 2007 11:20:37 -0000      1.1.2.3
***************
*** 18,21 ****
--- 18,22 ----
        p_driver.cc \
        p_driver.h \
+       p_graphics3d.cc \
        p_laser.cc \
        p_position.cc \

Index: p_laser.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstageplugin/Attic/p_laser.cc,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -d -r1.1.2.3 -r1.1.2.4
*** p_laser.cc  27 Nov 2007 07:03:33 -0000      1.1.2.3
--- p_laser.cc  24 Dec 2007 11:20:37 -0000      1.1.2.4
***************
*** 53,59 ****
  {
    StgModelLaser* mod = (StgModelLaser*)this->mod;
!   
    // don't publish anything until we have some real data
!   if( mod->samples == NULL )
      return;
    
--- 53,60 ----
  {
    StgModelLaser* mod = (StgModelLaser*)this->mod;
!   stg_laser_sample_t* samples = mod->GetSamples();
! 
    // don't publish anything until we have some real data
!   if( samples == NULL )
      return;
    
***************
*** 61,69 ****
    memset( &pdata, 0, sizeof(pdata) );
  
!   pdata.min_angle = -mod->fov/2.0;
!   pdata.max_angle = +mod->fov/2.0;
!   pdata.max_range = mod->range_max;
!   pdata.resolution = mod->fov / (double)(mod->sample_count-1);
!   pdata.ranges_count = pdata.intensity_count = mod->sample_count;
    pdata.id = this->scan_id++;
    
--- 62,73 ----
    memset( &pdata, 0, sizeof(pdata) );
  
!   stg_laser_cfg_t cfg;
!   mod->GetConfig( &cfg );
! 
!   pdata.min_angle = -cfg.fov/2.0;
!   pdata.max_angle = +cfg.fov/2.0;
!   pdata.max_range = cfg.range_bounds.max;
!   pdata.resolution = cfg.fov / (double)(cfg.sample_count-1);
!   pdata.ranges_count = pdata.intensity_count = cfg.sample_count;
    pdata.id = this->scan_id++;
    
***************
*** 71,79 ****
    pdata.intensity = new uint8_t[pdata.ranges_count];
    
!   for( int i=0; i<mod->sample_count; i++ )
      {
        //printf( "range %d %d\n", i, samples[i].range);
!       pdata.ranges[i] = mod->samples[i].range;
!       pdata.intensity[i] = (uint8_t)mod->samples[i].reflectance;
      }
    
--- 75,83 ----
    pdata.intensity = new uint8_t[pdata.ranges_count];
    
!   for( int i=0; i<cfg.sample_count; i++ )
      {
        //printf( "range %d %d\n", i, samples[i].range);
!       pdata.ranges[i] = samples[i].range;
!       pdata.intensity[i] = (uint8_t)samples[i].reflectance;
      }
    
***************
*** 111,124 ****
                    plc->resolution/1e2);
  
  
        // tweak the parts that player knows about
!       mod->fov = plc->max_angle - plc->min_angle;
! 
!       // TODO
!       //mod->sample_count = (int)(slc.fov / DTOR(plc->resolution/1e2));
  
        PRINT_DEBUG2( "setting laser config: fov %.2f samples %d", 
                    slc.fov, slc.samples );
        
        this->driver->Publish(this->addr, resp_queue,
                            PLAYER_MSGTYPE_RESP_ACK, 
--- 115,133 ----
                    plc->resolution/1e2);
  
+       stg_laser_cfg_t cfg;
+       mod->GetConfig( &cfg );
  
        // tweak the parts that player knows about
!       cfg.fov = plc->max_angle - plc->min_angle;
!       
!       // todo - test this
!       cfg.sample_count = (int)(cfg.fov / DTOR(plc->resolution/1e2));
  
        PRINT_DEBUG2( "setting laser config: fov %.2f samples %d", 
                    slc.fov, slc.samples );
        
+       mod->SetConfig( &cfg );
+       
+ 
        this->driver->Publish(this->addr, resp_queue,
                            PLAYER_MSGTYPE_RESP_ACK, 
***************
*** 141,150 ****
      if( hdr->size == 0 )
      {
        player_laser_config_t plc;
        memset(&plc,0,sizeof(plc));
!       plc.min_angle = -mod->fov/2.0;
!       plc.max_angle = +mod->fov/2.0;
!       plc.max_range = mod->range_max;
!       plc.resolution = (uint8_t)(RTOD(mod->fov / (mod->sample_count-1)) * 
100);
        plc.intensity = 1; // todo
  
--- 150,162 ----
      if( hdr->size == 0 )
      {
+       stg_laser_cfg_t cfg;
+       mod->GetConfig( &cfg );
+ 
        player_laser_config_t plc;
        memset(&plc,0,sizeof(plc));
!       plc.min_angle = -cfg.fov/2.0;
!       plc.max_angle = +cfg.fov/2.0;
!       plc.max_range = cfg.range_bounds.max;
!       plc.resolution = (uint8_t)(RTOD(cfg.fov / (cfg.sample_count-1)) * 100);
        plc.intensity = 1; // todo
  


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
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