Revision: 7467
          http://playerstage.svn.sourceforge.net/playerstage/?rev=7467&view=rev
Author:   natepak
Date:     2009-03-12 23:37:08 +0000 (Thu, 12 Mar 2009)

Log Message:
-----------
Updates to the threading

Modified Paths:
--------------
    code/branches/federation/gazebo/SConstruct
    code/branches/federation/gazebo/build.py
    code/branches/federation/gazebo/libgazebo/gazebo.h
    code/branches/federation/gazebo/player/GazeboTime.cc
    code/branches/federation/gazebo/server/gui/StatusBar.cc
    code/branches/federation/gazebo/server/physics/Body.cc
    code/branches/federation/gazebo/server/physics/Geom.cc
    code/branches/federation/gazebo/server/rendering/OgreCreator.cc

Modified: code/branches/federation/gazebo/SConstruct
===================================================================
--- code/branches/federation/gazebo/SConstruct  2009-03-12 21:52:35 UTC (rev 
7466)
+++ code/branches/federation/gazebo/SConstruct  2009-03-12 23:37:08 UTC (rev 
7467)
@@ -37,7 +37,8 @@
             'msg' : 'Error: Ogre3d and development files are required, but not\
                      found. ',
             'flags' : '',
-            'web' : 'http://www.ogre3d.org' 
+            'web' : 'http://www.ogre3d.org',
+            'required' : True
            },
 
   'ODE'  : {
@@ -46,7 +47,8 @@
             'msg' : 'Error: ODE and development files are required, but not\
                      found.',
             'flags' : '',
-            'web' : 'http://www.ode.org'
+            'web' : 'http://www.ode.org',
+            'required' : True
            },
 
   'OpenAL' : {
@@ -54,7 +56,8 @@
               'check' : 'openal',
               'msg' : 'Warning: OpenAL not found. 3D audio will be disbled',
               'flags' : ['-DHAVE_OPENAL'],
-              'web' : 'http://www.openal.org'
+              'web' : 'http://www.openal.org',
+              'required' : False
              },
 
   'XFT' : {
@@ -62,7 +65,8 @@
            'check' : 'xft',
            'msg' : 'Error: ',
            'flags' : '',
-           'web' : 'http://www.xft.org' 
+           'web' : 'http://www.xft.org',
+           'required' : True
           },
 
   'avformat' : {
@@ -71,7 +75,8 @@
                 'msg' : 'Warning: FFMpeg pkg-config not found. MP3 decoding\
                          is disabled',
                 'flags' : '',
-                'web' : 'http://ffmpeg.mplayerhq.hu/' 
+                'web' : 'http://ffmpeg.mplayerhq.hu/',
+                'required' : False
                },
 
   'avcodec' : {
@@ -80,7 +85,8 @@
                'msg' : 'Warning: FFMpeg pkg-config not found. MP3 decoding is\
                          disabled',
                'flags' : '',
-               'web' : 'http://ffmpeg.mplayerhq.hu/' 
+               'web' : 'http://ffmpeg.mplayerhq.hu/',
+               'required' : False
               },
 
   'XML2' : {
@@ -89,7 +95,8 @@
             'msg' : 'Error: libxml2 and development files are required, but\
                       not found.',
             'flags' : '',
-            'web' : 'http://www.xmlsoft.org' 
+            'web' : 'http://www.xmlsoft.org',
+            'required' : True
            },
 
   'FLTK' : {
@@ -99,42 +106,48 @@
             'msg' : 'Error: libfltk & development files are required, but not\
                      found.',
             'flags' : '',
-            'web' : 'http://www.fltk.org' 
+            'web' : 'http://www.fltk.org',
+            'required' : True
            },
   'Player' : {
               'pkgcfg' : 'pkg-config --cflags --libs playerc++',
               'check' : 'playerc++',
               'msg' : 'Warning: Player not found, bindings will not be built.',
               'flags' : ['-DHAVE_PLAYER'],
-              'web' :  'http://playerstage.sourceforge.net'
+              'web' :  'http://playerstage.sourceforge.net',
+              'required' : False
            },
   'event' : {
              'header' : 'event.h',
              'lib' : 'event',
              'msg' : 'Warning: libevent not found. Webgazebo will no be 
built.',
              'flags' : ['-DHAVE_EVENT'],
-             'web' :  'http://www.monkey.org/~provos/libevent/'
+             'web' :  'http://www.monkey.org/~provos/libevent/',
+            'required' : False
            },
   'yaml' : {
              'header' : 'yaml.h',
              'lib' : 'yaml',
              'msg' : 'Warning: yaml not found. Webgazebo will not be built.',
              'flags' : ['-DHAVE_YAML'],
-             'web' :  'http://www.yaml.org'
+             'web' :  'http://www.yaml.org',
+             'required' : False
            },
   'websim' : {
               'pkgcfg' : 'pkg-config --cflags --libs websim',
               'check' : 'websim',
               'msg' : 'Warning: websim not found. Webgazebo will not be 
built.',
               'flags' : ['-DHAVE_WEBSIM'],
-              'web' :  'http://www.playerstage.sourceforge.net'
+              'web' :  'http://www.playerstage.sourceforge.net',
+              'required' : False
            },
   'glib' : {
               'pkgcfg' : 'pkg-config --cflags --libs glib-2.0',
               'check' : 'glib-2.0',
               'msg' : 'Warning: glib not found. Webgazebo will not be built.',
               'flags' : '',
-              'web' :  'http://www.gtk.org'
+              'web' :  'http://www.gtk.org',
+              'required' : False
            },
 } 
 
@@ -165,6 +178,8 @@
   SHCXXCOMSTR = 'Compiling $TARGET',
   SHCCCOMSTR = 'Compiling $TARGET',
   SHLINKCOMSTR = 'Linking $TARGET',
+
+  HAS_ERROR = False,
 )
 
 
@@ -225,6 +240,10 @@
 Config(env, packages)
 
 
+if env['HAS_ERROR'] == True:
+  print "Build failed due to missing packages. See above errors"
+  Exit()
+
 #######
 # Export the environment
 #######

Modified: code/branches/federation/gazebo/build.py
===================================================================
--- code/branches/federation/gazebo/build.py    2009-03-12 21:52:35 UTC (rev 
7466)
+++ code/branches/federation/gazebo/build.py    2009-03-12 23:37:08 UTC (rev 
7467)
@@ -138,6 +138,7 @@
     header=''
     lib=''
     check=''
+    requred = True
 
     if packages[key].has_key('pkgcfg'):
       pkgcfg = packages[key]['pkgcfg']
@@ -151,6 +152,10 @@
     if packages[key].has_key('check'):
       check = packages[key]['check']
 
+    if packages[key].has_key('required'):
+      required = packages[key]['required']
+
+
     msg = packages[key]['msg']
     web = packages[key]['web']
     flags = packages[key]['flags']
@@ -164,8 +169,8 @@
       valid = False
       print '  !!' + msg + key + ' not found.'
       print '  See: ' + web
-      if msg.find('Error') > 0:
-        Exit(1)
+      if required:
+        env['HAS_ERROR'] = True;
  
     # Try parsing the pkg-config
     if docfg and pkgcfg:
@@ -182,8 +187,8 @@
         print "Unable to parse config ["+pkgcfg+"]"
         print '  !!' + msg + key + ' not found.'
         print '  See: ' + web
-        if msg.find('Error') > 0:
-          Exit(1)
+        if required:
+          env['HAS_ERROR'] = True;
     elif header and lib:
       if not conf.CheckLibWithHeader(lib, header, 'c'):
         valid = False

Modified: code/branches/federation/gazebo/libgazebo/gazebo.h
===================================================================
--- code/branches/federation/gazebo/libgazebo/gazebo.h  2009-03-12 21:52:35 UTC 
(rev 7466)
+++ code/branches/federation/gazebo/libgazebo/gazebo.h  2009-03-12 23:37:08 UTC 
(rev 7467)
@@ -379,7 +379,7 @@
   /// Number of times the interface has been opened
   public: int openCount;
 
-  public: float time;
+  public: double time;
 
   public: int version;
 

Modified: code/branches/federation/gazebo/player/GazeboTime.cc
===================================================================
--- code/branches/federation/gazebo/player/GazeboTime.cc        2009-03-12 
21:52:35 UTC (rev 7466)
+++ code/branches/federation/gazebo/player/GazeboTime.cc        2009-03-12 
23:37:08 UTC (rev 7467)
@@ -48,7 +48,7 @@
 int GazeboTime::GetTime(struct timeval* time)
 {
   time->tv_sec = (int) floor(GazeboClient::sim->data->simTime);
-  time->tv_usec = (int) floor(fmod(GazeboClient::sim->data->simTime, 1.0) * 
1e6);
+  time->tv_usec = (int) floor(fmod((double)GazeboClient::sim->data->simTime, 
(double)1.0) * 1e6);
 
   return 0;
 }
@@ -60,7 +60,7 @@
   struct timeval ts;
 
   ts.tv_sec = (int) floor(GazeboClient::sim->data->simTime);
-  ts.tv_usec = (int) floor(fmod(GazeboClient::sim->data->simTime, 1.0) * 1e6);
+  ts.tv_usec = (int) floor(fmod((double)GazeboClient::sim->data->simTime, 
(double)1.0) * 1e6);
 
   *time = ts.tv_sec + ts.tv_usec/1e6;
 

Modified: code/branches/federation/gazebo/server/gui/StatusBar.cc
===================================================================
--- code/branches/federation/gazebo/server/gui/StatusBar.cc     2009-03-12 
21:52:35 UTC (rev 7466)
+++ code/branches/federation/gazebo/server/gui/StatusBar.cc     2009-03-12 
23:37:08 UTC (rev 7467)
@@ -44,22 +44,22 @@
   y += 5;
 
   this->box(FL_UP_BOX);
-  this->fps = new Fl_Value_Output(x,y,40,20,"FPS");
+  this->fps = new Fl_Value_Output(x,y,35,20,"FPS");
   this->fps->precision(0);
 
-  x = this->fps->x() + this->fps->w() + 80;
-  this->realTime = new Fl_Value_Output(x,y,55,20,"Real Time");
+  x = this->fps->x() + this->fps->w() + 95;
+  this->percent = new Fl_Value_Output(x,y,65,20,"% Real Time");
+  this->percent->precision(2);
+
+  x = this->percent->x() + this->percent->w() + 80;
+  this->realTime = new Fl_Value_Output(x,y,55,20,"Real Time (sec)");
   this->realTime->precision(2);
 
-  x = this->realTime->x() + this->realTime->w() + 80;
-  this->percent = new Fl_Value_Output(x,y,55,20,"% Real Time");
-  this->percent->precision(2);
-
-  x = this->percent->x() + this->percent->w() + 75;
-  this->simTime = new Fl_Value_Output(x,y,55,20,"Sim Time");
+  x = this->realTime->x() + this->realTime->w() + 85;
+  this->simTime = new Fl_Value_Output(x,y,65,20,"Sim Time (sec)");
   this->simTime->precision(2);
 
-  x = this->simTime->x() + this->simTime->w() + 90;
+  x = this->simTime->x() + this->simTime->w() + 100;
   this->pauseTime = new Fl_Value_Output(x,y,55,20,"Pause Time");
   this->pauseTime->precision(2);
 
@@ -87,19 +87,29 @@
 void StatusBar::Update()
 {
   float avgFPS = 0;
+  float percent = 0;
+  float sim = 0;
 
   avgFPS = this->gui->GetAvgFPS();
+  percent = 100. * (Simulator::Instance()->GetSimTime() / 
Simulator::Instance()->GetRealTime());
 
+  sim = Simulator::Instance()->GetSimTime();
+  if (sim > 9999)
+  {
+    sim /= 60;
+    this->simTime->lable("Sim Time (min)");
+  }
+
   //this->iterations->value(Simulator::Instance()->GetIterations());
   this->fps->value(avgFPS);
-  this->percent->value(Simulator::Instance()->GetSimTime() / 
Simulator::Instance()->GetRealTime());
+  this->percent->value(percent);
 
   if (Simulator::Instance()->GetRealTime() - this->realTime->value() > 0.1)
   {
     this->realTime->value(Simulator::Instance()->GetRealTime());
   }
 
-  this->simTime->value(Simulator::Instance()->GetSimTime());
+  this->simTime->value();
   this->pauseTime->value(Simulator::Instance()->GetPauseTime());
 }
 

Modified: code/branches/federation/gazebo/server/physics/Body.cc
===================================================================
--- code/branches/federation/gazebo/server/physics/Body.cc      2009-03-12 
21:52:35 UTC (rev 7466)
+++ code/branches/federation/gazebo/server/physics/Body.cc      2009-03-12 
23:37:08 UTC (rev 7467)
@@ -328,7 +328,7 @@
 // Set the pose of the body
 void Body::SetPose(const Pose3d &_pose)
 {
-  boost::recursive_mutex::scoped_lock lock(*this->mutex);
+  //boost::recursive_mutex::scoped_lock lock(*this->mutex);
 
   if (this->IsStatic())
   {
@@ -365,7 +365,7 @@
 // Return the pose of the body
 Pose3d Body::GetPose() const
 {
-  boost::recursive_mutex::scoped_lock lock(*this->mutex);
+  //boost::recursive_mutex::scoped_lock lock(*this->mutex);
 
   /*if (this->IsStatic())
     return this->staticPose;
@@ -378,7 +378,7 @@
 // Update the pose of the body
 void Body::UpdatePose()
 {
-  boost::recursive_mutex::scoped_lock lock(*this->mutex);
+  //boost::recursive_mutex::scoped_lock lock(*this->mutex);
   this->pose.pos = this->GetPosition();
   this->pose.rot = this->GetRotation();
 

Modified: code/branches/federation/gazebo/server/physics/Geom.cc
===================================================================
--- code/branches/federation/gazebo/server/physics/Geom.cc      2009-03-12 
21:52:35 UTC (rev 7466)
+++ code/branches/federation/gazebo/server/physics/Geom.cc      2009-03-12 
23:37:08 UTC (rev 7467)
@@ -313,7 +313,7 @@
 // Set the pose relative to the body
 void Geom::SetPose(const Pose3d &newPose, bool updateCoM)
 {
-  boost::recursive_mutex::scoped_lock lock(*this->mutex);
+  //boost::recursive_mutex::scoped_lock lock(*this->mutex);
 
   if (this->placeable && this->geomId)
   {
@@ -346,7 +346,7 @@
 {
   Pose3d pose;
 
-  boost::recursive_mutex::scoped_lock lock(*this->mutex);
+  //boost::recursive_mutex::scoped_lock lock(*this->mutex);
 
   if (this->placeable && this->geomId)
   {
@@ -380,7 +380,7 @@
 void Geom::SetPosition(const Vector3 &pos)
 {
   Pose3d pose;
-  boost::recursive_mutex::scoped_lock lock(*this->mutex);
+  //boost::recursive_mutex::scoped_lock lock(*this->mutex);
 
   pose = this->GetPose();
   pose.pos = pos;
@@ -392,7 +392,7 @@
 void Geom::SetRotation(const Quatern &rot)
 {
   Pose3d pose;
-  boost::recursive_mutex::scoped_lock lock(*this->mutex);
+  //boost::recursive_mutex::scoped_lock lock(*this->mutex);
 
   pose = this->GetPose();
   pose.rot = rot;

Modified: code/branches/federation/gazebo/server/rendering/OgreCreator.cc
===================================================================
--- code/branches/federation/gazebo/server/rendering/OgreCreator.cc     
2009-03-12 21:52:35 UTC (rev 7466)
+++ code/branches/federation/gazebo/server/rendering/OgreCreator.cc     
2009-03-12 23:37:08 UTC (rev 7467)
@@ -703,9 +703,6 @@
 
       Geom *geom = dynamic_cast<Geom*>(owner);
 
-      if (owner->GetName() == "box1_geom")
-        std::cout << "Pose[" << owner->GetPose() << "]\n";
-
       if (geom || !owner->GetParent())
         vis->SetPose(owner->GetPose());
       else


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to