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

Modified Files:
      Tag: opengl
        Makefile.am p_driver.cc p_driver.h p_graphics3d.cc p_laser.cc 
        p_position.cc p_simulation.cc stg_time.cc 
Removed Files:
      Tag: opengl
        stg_time.h 
Log Message:
plugin works again

Index: p_graphics3d.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstageplugin/Attic/p_graphics3d.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_graphics3d.cc     8 Jan 2008 00:30:12 -0000       1.1.2.3
--- p_graphics3d.cc     14 Jan 2008 22:35:46 -0000      1.1.2.4
***************
*** 1,7 ****
  /*
!  *  Player - One Hell of a Robot Server
!  *  Copyright (C) 2004, 2005 Richard Vaughan
   *                      
-  * 
   *  This program is free software; you can redistribute it and/or modify
   *  it under the terms of the GNU General Public License as published by
--- 1,6 ----
  /*
!  *  Stage 
!  *  Copyright (C) Richard Vaughan
   *                      
   *  This program is free software; you can redistribute it and/or modify
   *  it under the terms of the GNU General Public License as published by
***************
*** 37,44 ****
  #endif
  
- //#include <gl.h>
- //#include <glu.h>
- //#include <glext.h>
- 
  //extern GList* dl_list;
  
--- 36,39 ----
***************
*** 125,129 ****
                                         void* data)
  {
- 
    // TODO queue *all* commands so that tranformations and clearing are
    // done synchronously
--- 120,123 ----
***************
*** 205,210 ****
  
        // move into the relevant model's coordinate frame
!       stg_pose_t gpose;
!       mod->GetGlobalPose( &gpose );
        
        glPushMatrix();
--- 199,203 ----
  
        // move into the relevant model's coordinate frame
!       stg_pose_t gpose = mod->GetGlobalPose();
        
        glPushMatrix();

Index: p_driver.h
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstageplugin/Attic/p_driver.h,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_driver.h  27 Nov 2007 05:36:02 -0000      1.1.2.2
--- p_driver.h  14 Jan 2008 22:35:46 -0000      1.1.2.3
***************
*** 8,13 ****
  #include <libplayercore/playercore.h>
  
! #include "../libstage/stage.hh"
! #include "stg_time.h"
  
  #define DRIVER_ERROR(X) printf( "Stage driver error: %s\n", X )
--- 8,12 ----
  #include <libplayercore/playercore.h>
  
! #include "../libstage/stage_internal.hh"
  
  #define DRIVER_ERROR(X) printf( "Stage driver error: %s\n", X )
***************
*** 15,18 ****
--- 14,18 ----
  // foward declare;
  class Interface;
+ class StgTime;
  
  class StgDriver : public Driver
***************
*** 304,307 ****
--- 304,324 ----
  };
  
+ /** Replaces Player's real time clock object */
+ class StTime : public PlayerTime
+ { 
+  private: 
+   StgDriver* driver;
+   
+  public: 
+  // Constructor
+   StTime( StgDriver* driver );
+  
+  // Destructor
+  virtual ~StTime();
+  
+  // Get the simulator time
+  int GetTime(struct timeval* time);
+  int GetTimeDouble(double* time);
+ };
  
  

Index: p_position.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstageplugin/Attic/p_position.cc,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -d -r1.1.2.4 -r1.1.2.5
*** p_position.cc       8 Jan 2008 00:30:12 -0000       1.1.2.4
--- p_position.cc       14 Jan 2008 22:35:46 -0000      1.1.2.5
***************
*** 87,93 ****
      player_position2d_cmd_pos_t* pcmd = (player_position2d_cmd_pos_t*)data;
  
-     stg_position_cmd_t scmd; 
-     memset( &scmd, 0, sizeof(scmd));
- 
      mod->GoTo( pcmd->vel.px, pcmd->vel.py, pcmd->vel.pa );
      return 0;
--- 87,90 ----
***************
*** 102,108 ****
      player_position2d_cmd_car_t* pcmd = (player_position2d_cmd_car_t*)data;
  
-     stg_position_cmd_t scmd; 
-     memset( &scmd, 0, sizeof(scmd));
- 
      mod->SetSpeed( pcmd->velocity, 0, pcmd->angle );
      return 0;
--- 99,102 ----
***************
*** 116,121 ****
      if(hdr->size == 0)
      {
!       stg_geom_t geom;
!       this->mod->GetGeom( &geom );
  
        // fill in the geometry data formatted player-like
--- 110,114 ----
      if(hdr->size == 0)
      {
!       stg_geom_t geom = this->mod->GetGeom();
  
        // fill in the geometry data formatted player-like
***************
*** 285,289 ****
    
    player_position2d_data_t ppd;
!   memset( &ppd, 0, sizeof(ppd) );
    
    // pack the data into player format
--- 278,282 ----
    
    player_position2d_data_t ppd;
!   bzero( &ppd, sizeof(ppd) );
    
    // pack the data into player format
***************
*** 294,298 ****
    ppd.pos.pa = mod->est_pose.a;
  
!   stg_velocity_t v = mod->Velocity();
  
    ppd.vel.px = v.x;
--- 287,291 ----
    ppd.pos.pa = mod->est_pose.a;
  
!   stg_velocity_t v = mod->GetVelocity();
  
    ppd.vel.px = v.x;

Index: p_laser.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstageplugin/Attic/p_laser.cc,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -d -r1.1.2.4 -r1.1.2.5
*** p_laser.cc  24 Dec 2007 11:20:37 -0000      1.1.2.4
--- p_laser.cc  14 Jan 2008 22:35:46 -0000      1.1.2.5
***************
*** 180,188 ****
      if(hdr->size == 0)
      {
!       stg_geom_t geom;
!       this->mod->GetGeom( &geom );
  
!       stg_pose_t pose;
!       this->mod->GetPose( &pose);
  
        // fill in the geometry data formatted player-like
--- 180,186 ----
      if(hdr->size == 0)
      {
!       stg_geom_t geom = this->mod->GetGeom();
  
!       stg_pose_t pose = this->mod->GetPose();
  
        // fill in the geometry data formatted player-like

Index: p_driver.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstageplugin/Attic/p_driver.cc,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -d -r1.1.2.4 -r1.1.2.5
*** p_driver.cc 8 Jan 2008 00:30:12 -0000       1.1.2.4
--- p_driver.cc 14 Jan 2008 22:35:46 -0000      1.1.2.5
***************
*** 28,32 ****
  // DOCUMENTATION ------------------------------------------------------------
  
! /** @defgroup player libstageplugin - Stage plugin driver for Player
  
  <b>libstageplugin</b> is a plugin for Player that allows Player
--- 28,32 ----
  // DOCUMENTATION ------------------------------------------------------------
  
! /** @defgroup player libstageplugin -  simulation driver for Player
  
  <b>libstageplugin</b> is a plugin for Player that allows Player
***************
*** 151,155 ****
  
  #include "p_driver.h"
- //#include "zoo_driver.h"
  
  const char* copyright_notice = 
--- 151,154 ----

Index: Makefile.am
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstageplugin/Attic/Makefile.am,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -d -r1.1.2.3 -r1.1.2.4
*** Makefile.am 24 Dec 2007 11:20:37 -0000      1.1.2.3
--- Makefile.am 14 Jan 2008 22:35:46 -0000      1.1.2.4
***************
*** 30,34 ****
  #     p_power.cc 
  #     p_graphics2d.cc
- #     p_graphics3d.cc 
  #     p_bumper.cc 
  #     p_fiducial.cc 
--- 30,33 ----

--- stg_time.h DELETED ---

Index: p_simulation.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstageplugin/Attic/p_simulation.cc,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -d -r1.1.2.4 -r1.1.2.5
*** p_simulation.cc     8 Jan 2008 00:30:12 -0000       1.1.2.4
--- p_simulation.cc     14 Jan 2008 22:35:46 -0000      1.1.2.5
***************
*** 49,55 ****
  #define DEBUG
  
  #include <libplayercore/globals.h> // for player_argc & player_argv
  #include "p_driver.h"
- #include <libgen.h> // for dirname(3)
  
  // these are Player globals
--- 49,56 ----
  #define DEBUG
  
+ #include <libgen.h> // for dirname(3)
  #include <libplayercore/globals.h> // for player_argc & player_argv
+ 
  #include "p_driver.h"
  
  // these are Player globals
***************
*** 74,85 ****
    //puts( "InterfaceSimulation constructor" );
    
!   // boot libstage, requesting halt on any glib/gtk/gnome problem
! //   int argc = 2;
! //   char* argv[2];
! //   argv[0] = "player";
! //   argv[1] = "--g-fatal-warnings";
! //   stg_init( argc, argv );
! 
!   StgWorld::Init( &player_argc, &player_argv );
  
    const char* worldfile_name = cf->ReadString(section, "worldfile", NULL );
--- 75,79 ----
    //puts( "InterfaceSimulation constructor" );
    
!   Stg::Init( &player_argc, &player_argv );
  
    const char* worldfile_name = cf->ReadString(section, "worldfile", NULL );
***************
*** 117,121 ****
    // worldfile
    
!   StgDriver::world = new StgWorldGui( 700,700, "Player/Stage" );
    assert(StgDriver::world);
  
--- 111,115 ----
    // worldfile
    
!   StgDriver::world = new StgWorldGui( 800,840, "Player/Stage" );
    assert(StgDriver::world);
  
***************
*** 133,138 ****
  
    // steal the global clock - a bit aggressive, but a simple approach
!   if( GlobalTime ) delete GlobalTime;
!   assert( (GlobalTime = new StgTime( driver ) ));
    
    // start the simulation
--- 127,133 ----
  
    // steal the global clock - a bit aggressive, but a simple approach
! 
!   //  if( GlobalTime ) delete GlobalTime;
!   //assert( (GlobalTime = new StgTime( driver ) ));
    
    // start the simulation

Index: stg_time.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstageplugin/Attic/stg_time.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
*** stg_time.cc 27 Nov 2007 05:36:02 -0000      1.1.2.2
--- stg_time.cc 14 Jan 2008 22:35:46 -0000      1.1.2.3
***************
*** 27,38 ****
  ///////////////////////////////////////////////////////////////////////////
  
- 
- #include "../libstage/stage.hh"
- #include "stg_time.h"
- #include "math.h"
  #include "p_driver.h"
  
  // Constructor
! StgTime::StgTime( StgDriver* driver )
  {
    assert(driver);
--- 27,35 ----
  ///////////////////////////////////////////////////////////////////////////
  
  #include "p_driver.h"
+ #include "math.h"
  
  // Constructor
! StTime::StTime( StgDriver* driver )
  {
    assert(driver);
***************
*** 42,46 ****
  
  // Destructor
! StgTime::~StgTime()
  {
    return;
--- 39,43 ----
  
  // Destructor
! StTime::~StTime()
  {
    return;
***************
*** 48,52 ****
  
  // Get the simulator time
! int StgTime::GetTime(struct timeval* time)
  {
    PRINT_DEBUG( "get time" );
--- 45,49 ----
  
  // Get the simulator time
! int StTime::GetTime(struct timeval* time)
  {
    PRINT_DEBUG( "get time" );
***************
*** 56,61 ****
    StgWorld* world = driver->world;
    
!   time->tv_sec  = (int)floor(world->sim_time / 1e6);
!   time->tv_usec = (int)rint(fmod(world->sim_time,1e6) * 1e6);
    
    PRINT_DEBUG2( "time now %ld sec %ld usec", time->tv_sec, time->tv_usec );
--- 53,59 ----
    StgWorld* world = driver->world;
    
!   stg_usec_t usec = world->SimTimeNow();
!   time->tv_sec  = (int)floor(usec/million);
!   time->tv_usec = (int)rint(fmod(usec,million) * million);
    
    PRINT_DEBUG2( "time now %ld sec %ld usec", time->tv_sec, time->tv_usec );
***************
*** 64,68 ****
  }
  
! int StgTime::GetTimeDouble(double* time)
  {
    PRINT_DEBUG( "get time (double)" );
--- 62,66 ----
  }
  
! int StTime::GetTimeDouble(double* time)
  {
    PRINT_DEBUG( "get time (double)" );
***************
*** 72,76 ****
    StgWorld* world = driver->world;
    
!   *time = world->sim_time / 1e6;
    
    PRINT_DEBUG1( "time now %f sec ", *time);
--- 70,74 ----
    StgWorld* world = driver->world;
    
!   *time = world->SimTimeNow() / million;
    
    PRINT_DEBUG1( "time now %f sec ", *time);


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to