Revision: 4457
          http://playerstage.svn.sourceforge.net/playerstage/?rev=4457&view=rev
Author:   natepak
Date:     2008-03-28 13:38:22 -0700 (Fri, 28 Mar 2008)

Log Message:
-----------
Removed latest gazeboMessage update

Modified Paths:
--------------
    code/gazebo/trunk/server/GazeboError.hh
    code/gazebo/trunk/server/GazeboMessage.cc
    code/gazebo/trunk/server/GazeboMessage.hh
    code/gazebo/trunk/server/Global.hh
    code/gazebo/trunk/server/Model.cc
    code/gazebo/trunk/server/Simulator.cc
    code/gazebo/trunk/server/World.cc
    code/gazebo/trunk/server/XMLConfig.cc
    code/gazebo/trunk/server/controllers/Controller.cc
    code/gazebo/trunk/server/controllers/factory/Factory.cc
    code/gazebo/trunk/server/physics/Body.cc
    code/gazebo/trunk/server/physics/HeightmapGeom.cc
    code/gazebo/trunk/server/rendering/OgreAdaptor.cc
    code/gazebo/trunk/server/rendering/OgreCreator.cc
    code/gazebo/trunk/server/rendering/OgreVisual.cc
    code/gazebo/trunk/server/sensors/Sensor.cc
    code/gazebo/trunk/server/sensors/camera/MonoCameraSensor.cc
    code/gazebo/trunk/server/sensors/camera/StereoCameraSensor.cc

Modified: code/gazebo/trunk/server/GazeboError.hh
===================================================================
--- code/gazebo/trunk/server/GazeboError.hh     2008-03-28 20:32:57 UTC (rev 
4456)
+++ code/gazebo/trunk/server/GazeboError.hh     2008-03-28 20:38:22 UTC (rev 
4457)
@@ -34,32 +34,27 @@
 
 namespace gazebo
 {
+  
   /// \addtogroup gazebo_server
   /// \brief Gazebo error class
   /// \{
 
-  //TODO: global variable, static in the class would be better, if only the 
linker didn't oppose to it ...
-  static std::ostringstream throwStream;
   /// Throw an error
-  #define gzthrow(msg) throwStream << "Exception: " << msg << std::endl << 
std::flush;\
-                       throw 
gazebo::GazeboError(__FILE__,__LINE__,throwStream.str())
-
+  #define gzthrow(msg) throw 
gazebo::GazeboError(__FILE__,__LINE__,std::string(msg))
   
   /// \brief Class to handle errors
   ///
   /**
-   Use <tt>gzthrow(data1 << data2)</tt> to throw errors.
+   Use <tt>gzthrow(std::string)</tt> to throw errors.
 
    Example:
    
    \verbatim
-   Recommended new way:
-   gzthrow("This is an error message of type[" << type << "]");
-   Old way:
    std::ostringstream stream;
    stream << "This is an error message of type[" << type << "]\n";
    gzthrow(stream.str());
-   The final "\n" is not needed anymore, the code should be changed to the new 
type.
+   or if type is a string, simply:
+   gzthrow("This is an error message of type[" + type + "]\n");
    \endverbatim
 
   */
@@ -91,7 +86,7 @@
     /// \brief Return the error string
     /// \return The error string
     public: std::string GetErrorStr() const; 
-
+  
     /// \brief The error function
     private: std::string file;
   

Modified: code/gazebo/trunk/server/GazeboMessage.cc
===================================================================
--- code/gazebo/trunk/server/GazeboMessage.cc   2008-03-28 20:32:57 UTC (rev 
4456)
+++ code/gazebo/trunk/server/GazeboMessage.cc   2008-03-28 20:38:22 UTC (rev 
4457)
@@ -38,7 +38,10 @@
 /// Default constructor
 GazeboMessage::GazeboMessage()
 {
-  this->level = 2;
+  this->msgStream = &std::cout;
+  this->errStream = &std::cerr;
+
+  this->level = 0;
 }
 
 
////////////////////////////////////////////////////////////////////////////////
@@ -67,7 +70,7 @@
     gzthrow("Null XMLConfig node");
   }
 
-  this->SetVerbose(node->GetInt("verbosity",2,0));
+  this->SetVerbose(node->GetInt("verbosity",0,0));
   this->logData = node->GetBool("logData",false);
 
   if (this->logData)
@@ -96,6 +99,17 @@
 {
   node->SetValue("verbosity", this->level);
   node->SetValue("logData", this->logData);
+
+  /*
+    node->NewElement("verbosity", String(this->level)); //std::ostringstream 
<< this->level);
+
+    node->NewElement("logData", gazebo::String(this->logData));
+
+    if (this->logData)
+      node->NewElement("logData", std::ostringstream << "true");
+    else
+      node->NewElement("logData", std::ostringstream << "true");
+    */
 }
 
 
////////////////////////////////////////////////////////////////////////////////
@@ -107,22 +121,24 @@
 
 
////////////////////////////////////////////////////////////////////////////////
 /// Get the message stream
-void GazeboMessage::Msg( int msglevel, std::string msg )
+std::ostream &GazeboMessage::Msg( int msglevel )
 {
+  if (msglevel <= this->level)
+    return *this->msgStream;
+  else
+    return this->nullStream;
+}
 
-  if (msglevel >= this->level)
-    return;
-
-  if (msglevel <0)
-    std::cerr << msg;
+////////////////////////////////////////////////////////////////////////////////
+/// Get the error stream
+std::ostream &GazeboMessage::Err( int msglevel )
+{
+  if (msglevel <= this->level)
+    return *this->errStream;
   else
-    std::cout << msg;
-
-  if (this->logData)
-    this->Log() << msg;
+    return this->nullStream;
 }
 
-
 
////////////////////////////////////////////////////////////////////////////////
 // Log a message
 std::ofstream &GazeboMessage::Log()

Modified: code/gazebo/trunk/server/GazeboMessage.hh
===================================================================
--- code/gazebo/trunk/server/GazeboMessage.hh   2008-03-28 20:32:57 UTC (rev 
4456)
+++ code/gazebo/trunk/server/GazeboMessage.hh   2008-03-28 20:38:22 UTC (rev 
4457)
@@ -32,51 +32,37 @@
 #include <fstream>
 #include <string>
 #include <sstream>
-#include "XMLConfig.hh" 
 
 namespace gazebo
 {
   
-  class XMLConfigNode;
   /// \addtogroup gazebo_server
   /// \brief Gazebo message class
   /// \{
-  
+
   /// Output a message
-  static std::ostringstream messageStream;
-  
-  #define gzmsg(level, msg) messageStream <<  "[" << __FILE__ << ":" << 
__LINE__ << "]\n" << msg << std::endl << std::flush;\
-                             gazebo::GazeboMessage::Instance()->Msg(level, 
messageStream.str()) 
-  #define gzerr(msg) gzmsg (-1, msg)
- 
-/*
-* */
+  #define gzmsg(level) (gazebo::GazeboMessage::Instance()->Msg(level) << "[" 
<< __FILE__ << ":" << __LINE__ << "]\n  ")
 
-  /// Log a message : not used so far but who knows
-  #define gzlog() (gazebo::GazeboMessage::Instance()->Log() << "[" << __FILE__ 
<< ":" << __LINE__ << "]\n ")
+  #define gzerr(level) (gazebo::GazeboMessage::Instance()->Err(level) << 
"Error: [" << __FILE__ << ":" << __LINE__ << "]\n  ")
+ 
+  /// Log a message
+  #define gzlog() (gazebo::GazeboMessage::Instance()->Log() << "[" << __FILE__ 
<< ":" << __LINE__ << "] ")
   
-  
+    class XMLConfigNode;
+ 
   /// \brief Gazebo class for outputings messages
   ///
   /**
-   Use <tt>gzmsg(level, msg)</tt> being msg an ostream to output messages, 
where level is 
+   Use <tt>gzmsg(level)</tt> as an ostream to output messages, where level is 
    an integer priority level.
 
    Example:
    
    \verbatim
-   gzmsg(0, "This is an important message");
-   gzmsg(2, "This is a less important message");
+   gzmsg(0) << "This is an important message";
+   gzmsg(2) << "This is a less important message";
    \endverbatim
- 
-   Currently levels correspond roughly to this:
-   -1 : errors that makes Gazebo finish (can't find a bsp, a model, etc.)
-    0 : errors that affect how Gazebo works (can't find a texture, etc.)
-    1 : General information (Gui Initialized)
-    2 : Verbose information / Debugging 
-
-   gzerr is equivalent to gzmsg(-1)
-   */
+  */
   class GazeboMessage
   {
     /// \brief Default constructor
@@ -100,11 +86,11 @@
   
     /// \brief Use this to output a message to the terminal
     /// \param level Level of the message
-    public: void Msg( int level, std::string msg );
+    public: std::ostream &Msg( int level = 0 );
 
     /// \brief Use this to output an error to the terminal
     /// \param level Level of the message
-//    public: std::ostream &Err( int level = 0 );
+    public: std::ostream &Err( int level = 0 );
   
     /// \brief Use this to output a message to a log file
     public: std::ofstream &Log();
@@ -115,8 +101,11 @@
     /// \brief True if logging data
     private: bool logData;
   
-    /// \brief The logstream 
+    private: std::ostringstream nullStream;
+    private: std::ostream *msgStream;
+    private: std::ostream *errStream;
     private: std::ofstream logStream;
+  
     /// Pointer to myself
     private: static GazeboMessage *myself;
   };
@@ -124,6 +113,4 @@
   /// \}
 }
 
-
-
 #endif

Modified: code/gazebo/trunk/server/Global.hh
===================================================================
--- code/gazebo/trunk/server/Global.hh  2008-03-28 20:32:57 UTC (rev 4456)
+++ code/gazebo/trunk/server/Global.hh  2008-03-28 20:38:22 UTC (rev 4457)
@@ -33,9 +33,7 @@
 
 #include <list>
 #include <math.h>
-#include <sstream>
 
-
 #include "Pose3d.hh"
 #include "GazeboError.hh"
 #include "GazeboMessage.hh"
@@ -118,6 +116,7 @@
   */  
   class Global
   {
+
     /// Paths gazebo install
     public: static std::list<std::string> gazeboPaths;
 

Modified: code/gazebo/trunk/server/Model.cc
===================================================================
--- code/gazebo/trunk/server/Model.cc   2008-03-28 20:32:57 UTC (rev 4456)
+++ code/gazebo/trunk/server/Model.cc   2008-03-28 20:38:22 UTC (rev 4457)
@@ -455,7 +455,7 @@
 
   // Store this body
   if (this->bodies[body->GetName()])
-    gzmsg(0, "Body with name[" << body->GetName() << "] already exists!!");
+    gzmsg(0) << "Body with name[" << body->GetName() << "] already exists!!\n";
 
   // Store the pointer to this body
   this->bodies[body->GetName()] = body;
@@ -557,7 +557,8 @@
     }
     catch (GazeboError e)
     {
-      gzerr("Error Loading Controller[" <<  controllerName << "]\n" << e) ;
+      std::cerr << "Error Loading Controller[" <<  controllerName
+      << "]\n" << e << std::endl;
       delete controller;
       return;
     }
@@ -567,7 +568,7 @@
   }
   else
   {
-    gzmsg(0, "Unknown controller[" << controllerType << "]");
+    gzmsg(0) << "Unknown controller[" << controllerType << "]\n";
   }
 }
 
@@ -684,7 +685,8 @@
     }
     catch (GazeboError e)
     {
-      gzmsg(0,"Error Loading body[" << 
childNode->GetString("name",std::string(), 0) << "]\n" << e );
+      std::cerr << "Error Loading body[" << 
childNode->GetString("name",std::string(), 0) << "]\n";
+      std::cerr <<  e << std::endl;
       childNode = childNode->GetNextByNSPrefix("body");
       continue;
     }
@@ -702,7 +704,8 @@
     }
     catch (GazeboError e)
     {
-      gzmsg(0,"Error Loading Joint[" << 
childNode->GetString("name",std::string(), 0) << "]\n" << e );
+      std::cerr << "Error Loading Joint[" << childNode->GetString("name", 
std::string(), 0) << "]\n";
+      std::cerr <<  e << std::endl;
       childNode = childNode->GetNextByNSPrefix("joint");
       continue;
     }

Modified: code/gazebo/trunk/server/Simulator.cc
===================================================================
--- code/gazebo/trunk/server/Simulator.cc       2008-03-28 20:32:57 UTC (rev 
4456)
+++ code/gazebo/trunk/server/Simulator.cc       2008-03-28 20:38:22 UTC (rev 
4457)
@@ -101,13 +101,17 @@
 
   // Load the world file
   this->xmlFile=new gazebo::XMLConfig();
+
   try
   {
     xmlFile->Load(worldFileName);
   }
   catch (GazeboError e)
   {
-    gzthrow("The XML config file can not be loaded, please make sure is a 
correct file\n" << e); 
+    std::ostringstream stream;
+    stream << "The XML config file can not be loaded, please make sure is a 
correct file\n"
+    << e << "\n";
+    gzthrow(stream.str());
   }
 
   XMLConfigNode *rootNode(xmlFile->GetRootNode());
@@ -122,7 +126,10 @@
   }
   catch (GazeboError e)
   {
-    gzthrow( "Error loading the GUI\n" << e);
+    std::ostringstream stream;
+    stream << "Error loading the GUI\n"
+    << e << "\n";
+    gzthrow(stream.str());
   }
 
   //Initialize RenderingEngine
@@ -132,8 +139,11 @@
   }
   catch (gazebo::GazeboError e)
   {
-    gzthrow("Failed to Initialize the OGRE Rendering system\n" << e );
- }
+    std::ostringstream stream;
+    stream << "Failed to Initialize the OGRE Rendering system\n"
+    << e << "\n";
+    gzthrow(stream.str());
+  }
 
   //Preload basic shapes that can be used anywhere
   OgreCreator::CreateBasicShapes();
@@ -145,7 +155,10 @@
   }
   catch (GazeboError e)
   {
-    gzthrow("Failed to load the GUI\n"  << e);
+    std::ostringstream stream;
+    stream << "Error loading the GUI\n"
+    << e << "\n";
+    gzthrow(stream.str());
   }
 
   this->loaded=true;
@@ -165,8 +178,10 @@
 
   if (xmlFile->Save(filename)<0)
   {
-   gzthrow("The XML file could not be written back to " << filename );
-   }
+    std::ostringstream stream;
+    stream << "The XML file coult not be written back to " << filename << 
std::endl;
+    gzthrow(stream.str());
+  }
 }
 
 
@@ -362,7 +377,7 @@
     int y = childNode->GetTupleInt("pos",1,0);
     std::string type = childNode->GetString("type","fltk",1);
 
-    gzmsg(1, "Creating GUI:\n\tType[" << type << "] Pos[" << x << " " << y << 
"] Size[" << width << " " << height << "]");
+    gzmsg(1) << "Creating GUI:\n\tType[" << type << "] Pos[" << x << " " << y 
<< "] Size[" << width << " " << height << "]\n";
     if (type != "fltk")
     {
       gzthrow("The only GUI available is 'fltk', for no-GUI simulation, delete 
the 'gui' tag and its children");
@@ -378,7 +393,7 @@
   else
   {
     // Create a dummy GUI
-    gzmsg(1, "Creating a dummy GUI");
+    gzmsg(1) << "Creating a dummy GUI\n";
     this->gui = GuiFactory::NewGui(std::string("dummy"), 0, 0, 0, 0, 
std::string());
   }
 }

Modified: code/gazebo/trunk/server/World.cc
===================================================================
--- code/gazebo/trunk/server/World.cc   2008-03-28 20:32:57 UTC (rev 4456)
+++ code/gazebo/trunk/server/World.cc   2008-03-28 20:38:22 UTC (rev 4457)
@@ -230,7 +230,7 @@
   }
   catch (std::string e)
   {
-    gzmsg(-1, "Problem destroying simIface[" << e << "]");
+    gzmsg(-1) << "Problem destroying simIface[" << e << "]\n";
   }
 
   this->server->Fini();
@@ -575,7 +575,7 @@
       }
       else
       {
-        gzmsg(-1, "Simulation Iface: Model[" << 
this->simIface->data->model_name << "] does not exist");
+        gzmsg(-1) << "Simulation Iface: Model[" << 
this->simIface->data->model_name << "] does not exist\n";
       }
 
       strcpy((char*)this->simIface->data->model_name, "");

Modified: code/gazebo/trunk/server/XMLConfig.cc
===================================================================
--- code/gazebo/trunk/server/XMLConfig.cc       2008-03-28 20:32:57 UTC (rev 
4456)
+++ code/gazebo/trunk/server/XMLConfig.cc       2008-03-28 20:38:22 UTC (rev 
4457)
@@ -65,6 +65,7 @@
 // Load world from file
 void XMLConfig::Load( const std::string &filename )
 {
+  std::ostringstream stream;
   this->filename = filename;
 
   // Enable line numbering
@@ -74,7 +75,8 @@
   this->xmlDoc = xmlParseFile( this->filename.c_str() );
   if (xmlDoc == NULL)
   {
-    gzthrow( "Unable to parse xml file: " << this->filename);
+    stream << "Unable to parse xml file: " << this->filename;
+    gzthrow(stream.str());
   }
 
   // Create xpath evaluation context
@@ -95,7 +97,8 @@
   this->root = this->CreateNodes( NULL, xmlDocGetRootElement(this->xmlDoc) );
   if (this->root == NULL)
   {
-    gzthrow( "Empty document [" << this->filename << "]");
+    stream << "Empty document [" << this->filename << "]";
+    gzthrow(stream.str());
   }
 }
 
@@ -108,7 +111,9 @@
   this->xmlDoc = xmlParseDoc( (xmlChar*)(str.c_str()) );
   if (xmlDoc == NULL)
   {
-    gzthrow("unable to parse [" << str << "]");
+    std::ostringstream stream;
+    stream << "unable to parse [" << str << "]";
+    gzthrow(stream.str());
   }
 
   // Create wrappers for all the nodes (recursive)
@@ -117,7 +122,9 @@
 
   if (this->root == NULL)
   {
-    gzthrow( "Empty document [" << str<< "]") ;
+    std::ostringstream stream;
+    stream << "Empty document [" << str << "\n";
+    gzthrow(stream.str());
   }
 }
 
@@ -402,7 +409,8 @@
 {
   XMLConfigNode *node;
 
-  gzmsg(2, "name = [" << (const char*) this->xmlNode->name << "]");
+  std::cout << "name = [" << (const char*) this->xmlNode->name
+  << "]\n";
 
   // Recurse
   for (node = this->childFirst; node != NULL; node = node->next)
@@ -474,7 +482,9 @@
 
   if (!value && require)
   {
-    gzthrow( "unable to find required string attribute[" << key << "] in world 
file node[" << this->GetName() << "]");
+    std::ostringstream stream;
+    stream << "unable to find required string attribute[" << key << "] in 
world file node[" << this->GetName() << "]";
+    gzthrow(stream.str());
   }
   else if ( !value )
     return def;
@@ -491,7 +501,9 @@
 
   if (!value && require)
   {
-    gzthrow("unable to find required char attribute[" << key << "] in world 
file node[" << this->GetName() << "]");
+    std::ostringstream stream;
+    stream << "unable to find required char attribute[" << key << "] in world 
file node[" << this->GetName() << "]";
+    gzthrow(stream.str());
   }
   else if ( !value )
     return def;
@@ -541,7 +553,9 @@
 
   if (!value && require)
   {
-    gzthrow ("unable to find required int attribute[" << key << "] in world 
file node[" << this->GetName() << "]");
+    std::ostringstream stream;
+    stream << "unable to find required int attribute[" << key << "] in world 
file node[" << this->GetName() << "]";
+    gzthrow(stream.str());
   }
   else if ( !value )
     return def;
@@ -558,7 +572,9 @@
 
   if (!value && require)
   {
-    gzthrow( "unable to find required double attribute[" << key << "] in world 
file node[" << this->GetName() << "]");
+    std::ostringstream stream;
+    stream << "unable to find required double attribute[" << key << "] in 
world file node[" << this->GetName() << "]";
+    gzthrow(stream.str());
   }
   else if ( !value )
     return def;
@@ -574,7 +590,9 @@
 
   if (!value && require)
   {
-    gzthrow( "unable to find required float attribute[" << key << "] in world 
file node[" << this->GetName() << "]");
+    std::ostringstream stream;
+    stream << "unable to find required float attribute[" << key << "] in world 
file node[" << this->GetName() << "]";
+    gzthrow(stream.str());
   }
   else if ( !value )
     return def;
@@ -593,7 +611,9 @@
   if (!value && require)
   {
     xmlFree(value);
-    gzthrow( "unable to find required bool attribute[" << key << "] in world 
file node[" << this->GetName() << "]");
+    std::ostringstream stream;
+    stream << "unable to find required bool attribute[" << key << "] in world 
file node[" << this->GetName() << "]";
+    gzthrow(stream.str());
   }
   else if ( !value )
   {
@@ -905,7 +925,9 @@
     newNode = xmlNewNode(0, (xmlChar*) key); //I hope we don't need namespaces 
here
     if (!newNode)
     {
-      gzthrow( "unable to create an element [" << key << "] in world file 
node[" << this->GetName() << "]");
+      std::ostringstream stream;
+      stream << "unable to create an element [" << key << "] in world file 
node[" << this->GetName() << "]";
+      gzthrow(stream.str());
     }
     xmlNodeSetContent(newNode, (xmlChar*) value);
     xmlAddChild(this->xmlNode, newNode);

Modified: code/gazebo/trunk/server/controllers/Controller.cc
===================================================================
--- code/gazebo/trunk/server/controllers/Controller.cc  2008-03-28 20:32:57 UTC 
(rev 4456)
+++ code/gazebo/trunk/server/controllers/Controller.cc  2008-03-28 20:38:22 UTC 
(rev 4457)
@@ -90,7 +90,7 @@
     }
     catch (...) //TODO: Show the exception text here (subclass exception?)
     {
-      gzmsg(0, "No manager for the interface " << ifaceType << " found. 
Disabled.");
+      gzmsg(1) << "No manager for the interface " << ifaceType << " found. 
Disabled.\n";
       childNode = childNode->GetNextByNSPrefix("interface");
       continue;
     }
@@ -105,7 +105,9 @@
 
   if (this->ifaces.size() <= 0)
   {
-    gzthrow( "No interface defined for " << this->name << " controller");
+    std::ostringstream stream;
+    stream << "No interface defined for " << this->name << " controller";
+    gzthrow(stream.str());
   }
 
   this->LoadChild(node);

Modified: code/gazebo/trunk/server/controllers/factory/Factory.cc
===================================================================
--- code/gazebo/trunk/server/controllers/factory/Factory.cc     2008-03-28 
20:32:57 UTC (rev 4456)
+++ code/gazebo/trunk/server/controllers/factory/Factory.cc     2008-03-28 
20:38:22 UTC (rev 4457)
@@ -100,7 +100,7 @@
     }
     catch (gazebo::GazeboError e)
     {
-      gzerr("The controlled factory could not load its XML data [" << e << 
"]");
+      std::cerr << "The controlled factory could not load its XML data [" << e 
<< "]\n";
       return;
     }
 

Modified: code/gazebo/trunk/server/physics/Body.cc
===================================================================
--- code/gazebo/trunk/server/physics/Body.cc    2008-03-28 20:32:57 UTC (rev 
4456)
+++ code/gazebo/trunk/server/physics/Body.cc    2008-03-28 20:38:22 UTC (rev 
4457)
@@ -549,7 +549,7 @@
 {
   if (!this->bodyId)
   {
-    gzmsg(0, "Set velocity to an invalid ODE body");
+    gzmsg(0) << "Invalid ODE body\n";
   }
   else
     dBodySetLinearVel(this->bodyId, vel.x, vel.y, vel.z);
@@ -564,7 +564,7 @@
 
   if (!this->bodyId)
   {
-    gzmsg(0, "Invalid ODE body");
+    gzmsg(0) << "Invalid ODE body\n";
     return vel;
   }
 
@@ -583,7 +583,7 @@
 {
   if (!this->bodyId)
   {
-    gzmsg(0, "Invalid ODE body");
+    gzmsg(0) << "Invalid ODE body\n";
   }
   else
     dBodySetAngularVel(this->bodyId, vel.x, vel.y, vel.z);
@@ -598,7 +598,7 @@
 
   if (!this->bodyId)
   {
-    gzmsg(0, "Invalid ODE body");
+    gzmsg(0) << "Invalid ODE body\n";
     return vel;
   }
 
@@ -616,7 +616,7 @@
 {
   if (!this->bodyId)
   {
-    gzmsg(0, "Invalid ODE body");
+    gzmsg(0) << "Invalid ODE body\n";
   }
   else
     dBodySetForce(this->bodyId, force.x, force.y, force.z);
@@ -631,7 +631,7 @@
 
   if (!this->bodyId)
   {
-    gzmsg(0, "Invalid ODE body");
+    gzmsg(0) << "Invalid ODE body\n";
     return force;
   }
 
@@ -650,7 +650,7 @@
 {
   if (!this->bodyId)
   {
-    gzmsg(0, "Invalid ODE body");
+    gzmsg(0) << "Invalid ODE body\n";
   }
   else
     dBodySetTorque(this->bodyId, torque.x, torque.y, torque.z);
@@ -665,7 +665,7 @@
 
   if (!this->bodyId)
   {
-    gzmsg(0, "Invalid ODE body");
+    gzmsg(0) << "Invalid ODE body\n";
     return torque;
   }
 

Modified: code/gazebo/trunk/server/physics/HeightmapGeom.cc
===================================================================
--- code/gazebo/trunk/server/physics/HeightmapGeom.cc   2008-03-28 20:32:57 UTC 
(rev 4456)
+++ code/gazebo/trunk/server/physics/HeightmapGeom.cc   2008-03-28 20:38:22 UTC 
(rev 4457)
@@ -30,7 +30,6 @@
 #include <string.h>
 
 #include "GazeboError.hh"
-#include "GazeboMessage.hh"
 #include "OgreAdaptor.hh"
 #include "Global.hh"
 #include "Body.hh"
@@ -175,7 +174,7 @@
 
   std::ostringstream stream;
 
-  gzmsg(2, "Terrain Image[" << this->terrainImage << "] Size[" << 
this->terrainSize << "]");
+  std::cout << "Terrain Image[" << this->terrainImage << "] Size[" << 
this->terrainSize << "]\n";
 
   stream << "WorldTexture=" << worldTexture << "\n";
   //The detail texture

Modified: code/gazebo/trunk/server/rendering/OgreAdaptor.cc
===================================================================
--- code/gazebo/trunk/server/rendering/OgreAdaptor.cc   2008-03-28 20:32:57 UTC 
(rev 4456)
+++ code/gazebo/trunk/server/rendering/OgreAdaptor.cc   2008-03-28 20:38:22 UTC 
(rev 4457)
@@ -193,8 +193,7 @@
     this->sceneMgr->setShadowTechnique( Ogre::SHADOWTYPE_TEXTURE_ADDITIVE );
   else if (shadowTechnique == std::string("none"))
     this->sceneMgr->setShadowTechnique( Ogre::SHADOWTYPE_NONE );
-  else 
-    gzthrow("Unsupported shadow technique:\n" << shadowTechnique);
+  else gzthrow(std::string("Unsupported shadow technique: ") + shadowTechnique 
+ "\n");
 
   this->sceneMgr->setShadowTextureSelfShadow(true);
   this->sceneMgr->setShadowTexturePixelFormat(Ogre::PF_FLOAT32_R);
@@ -236,7 +235,7 @@
     }
     catch (Ogre::Exception e)
     {
-      gzmsg(-1, "Unable to load BSP geometry." << e.getDescription()) ;
+      gzmsg(0) << "Unable to load BSP geometry." << e.getDescription() << "\n";
       exit(0);
     }
   }

Modified: code/gazebo/trunk/server/rendering/OgreCreator.cc
===================================================================
--- code/gazebo/trunk/server/rendering/OgreCreator.cc   2008-03-28 20:32:57 UTC 
(rev 4456)
+++ code/gazebo/trunk/server/rendering/OgreCreator.cc   2008-03-28 20:38:22 UTC 
(rev 4457)
@@ -289,7 +289,7 @@
       }
       catch (int)
       {
-        gzmsg(0, "Unable to set sky dome to material[" << material << "]");
+        gzmsg(0) << "Unable to set sky dome to material[" << material << "]\n";
       }
 
     }

Modified: code/gazebo/trunk/server/rendering/OgreVisual.cc
===================================================================
--- code/gazebo/trunk/server/rendering/OgreVisual.cc    2008-03-28 20:32:57 UTC 
(rev 4456)
+++ code/gazebo/trunk/server/rendering/OgreVisual.cc    2008-03-28 20:38:22 UTC 
(rev 4457)
@@ -194,15 +194,15 @@
   }
   catch (Ogre::Exception e)
   {
-    gzmsg(0, "Unable to get Material[" << materialName << "] for Geometry[" 
-    << this->sceneNode->getName() << ". Object will appear white.");
+    gzmsg(0) << "Unable to get Material[" << materialName << "] for Geometry["
+    << this->sceneNode->getName() << ". Object will appear white.\n";
     return;
   }
 
   if (this->origMaterial.isNull())
   {
-    gzmsg(0, "Unable to get Material[" << materialName << "] for Geometry["
-    << this->sceneNode->getName() << ". Object will appear white");
+    gzmsg(0) << "Unable to get Material[" << materialName << "] for Geometry["
+    << this->sceneNode->getName() << ". Object will appear white\n";
     return;
   }
 
@@ -243,8 +243,8 @@
   }
   catch (Ogre::Exception e)
   {
-    gzmsg(0, "Unable to set Material[" << myMaterialName << "] to Geometry["
-    << this->sceneNode->getName() << ". Object will appear white.");
+    gzmsg(0) << "Unable to set Material[" << myMaterialName << "] to Geometry["
+    << this->sceneNode->getName() << ". Object will appear white.\n";
   }
 }
 
@@ -260,7 +260,7 @@
 
   if (this->myMaterial.isNull())
   {
-    gzmsg(0, "The visual " << this->sceneNode->getName() << " can't set 
transparency for this geom without a material");
+    gzmsg(0) << "The visual " << this->sceneNode->getName() << " can't set 
transparency for this geom without a material\n";
     return;
   }
 

Modified: code/gazebo/trunk/server/sensors/Sensor.cc
===================================================================
--- code/gazebo/trunk/server/sensors/Sensor.cc  2008-03-28 20:32:57 UTC (rev 
4456)
+++ code/gazebo/trunk/server/sensors/Sensor.cc  2008-03-28 20:38:22 UTC (rev 
4457)
@@ -91,7 +91,7 @@
 {
   if (!node)
   {
-    gzmsg(0, this->GetName() << " sensor has no controller.");
+    gzmsg(0) << this->GetName() << " sensor has no controller.\n";
     return;
   }
 

Modified: code/gazebo/trunk/server/sensors/camera/MonoCameraSensor.cc
===================================================================
--- code/gazebo/trunk/server/sensors/camera/MonoCameraSensor.cc 2008-03-28 
20:32:57 UTC (rev 4456)
+++ code/gazebo/trunk/server/sensors/camera/MonoCameraSensor.cc 2008-03-28 
20:38:22 UTC (rev 4457)
@@ -133,7 +133,7 @@
 const unsigned char *MonoCameraSensor::GetImageData(unsigned int i)
 {
   if (i!=0)
-    gzmsg(0) <<  "Camera index must be zero for mono cam";
+    gzerr(0) << "Camera index must be zero for mono cam";
 
   Ogre::HardwarePixelBufferSharedPtr mBuffer;
   size_t size;

Modified: code/gazebo/trunk/server/sensors/camera/StereoCameraSensor.cc
===================================================================
--- code/gazebo/trunk/server/sensors/camera/StereoCameraSensor.cc       
2008-03-28 20:32:57 UTC (rev 4456)
+++ code/gazebo/trunk/server/sensors/camera/StereoCameraSensor.cc       
2008-03-28 20:38:22 UTC (rev 4457)
@@ -262,7 +262,7 @@
 
   if (i > 1)
   {
-    gzmsg(0) <<  "Camera index must be 0=Left or 1=Right for stereo camera";
+    gzerr(0) << "Camera index must be 0=Left or 1=Right for stereo camera\n";
     i = 1;
   }
 


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

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