Commits

John Hsu  committed 169facb Merge

merging from default

  • Participants
  • Parent commits b1ca264, d5aeea2
  • Branches time_correct_patch_default

Comments (0)

Files changed (338)

File cmake/SearchForStuff.cmake

 ########################################
 # Find Boost, if not specified manually
 include(FindBoost)
-find_package(Boost ${MIN_BOOST_VERSION} REQUIRED thread signals system filesystem program_options regex iostreams)
+find_package(Boost ${MIN_BOOST_VERSION} REQUIRED thread signals system filesystem program_options regex iostreams date_time)
 
 if (NOT Boost_FOUND)
   set (BUILD_GAZEBO OFF CACHE INTERNAL "Build Gazebo" FORCE)
-  BUILD_ERROR ("Boost not found. Please install thread signals system filesystem program_options regex boost version ${MIN_BOOST_VERSION} or higher.")
+  BUILD_ERROR ("Boost not found. Please install thread signals system filesystem program_options regex date_time boost version ${MIN_BOOST_VERSION} or higher.")
 endif() 
 
 ########################################

File cmake/gazebo_config.h.in

File contents unchanged.

File doc/doxygen.css

 	padding: 2px;
 }
 
-div.qindex, div.navpath {
-	width: 100%;
+div.qindex
+{
+  width: 100%;
+	line-height: 140%;
+}
+
+div.navpath
+{
+  margin-left: 20em;
 	line-height: 140%;
 }
 

File examples/stand_alone/listener/CMakeLists.txt

+cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
+
+include (FindPkgConfig)
+if (PKG_CONFIG_FOUND)
+  pkg_check_modules(GAZEBO gazebo)
+endif()
+
+include(FindBoost)
+find_package(Boost ${MIN_BOOST_VERSION} REQUIRED system filesystem regex)
+
+find_package(Protobuf REQUIRED)
+
+include_directories(${GAZEBO_INCLUDE_DIRS})
+link_directories(${GAZEBO_LIBRARY_DIRS})
+
+add_executable(listener listener.cc)
+target_link_libraries(listener ${GAZEBO_LIBRARIES} ${Boost_LIBRARIES} ${PROTOBUF_LIBRARIES})

File examples/stand_alone/listener/listener.cc

+/*
+ * Copyright 2011 Nate Koenig & Andrew Howard
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/
+
+#include <gazebo/transport/transport.hh>
+#include <gazebo/msgs/msgs.hh>
+
+#include <iostream>
+
+/////////////////////////////////////////////////
+// Function is called everytime a message is received.
+void cb(ConstWorldStatisticsPtr &_msg)
+{
+  // Dump the message contents to stdout.
+  std::cout << _msg->DebugString();
+}
+
+/////////////////////////////////////////////////
+int main()
+{
+  // Initialize transport
+  gazebo::transport::init();
+
+  // Create our node for communication
+  gazebo::transport::NodePtr node(new gazebo::transport::Node());
+  node->Init();
+
+  // Listen to Gazebo world_stats topic
+  gazebo::transport::SubscriberPtr sub = node->Subscribe("~/world_stats", cb);
+
+  // Start transport
+  gazebo::transport::run();
+
+  // Busy wait loop...replace with your own code as needed.
+  while (true)
+    gazebo::common::Time::MSleep(10);
+
+  // Make sure to shut everything down.
+  gazebo::transport::fini();
+}

File gazebo/Master.cc

     PubList::iterator pubIter = this->publishers.begin();
     while (pubIter != this->publishers.end())
     {
-      if ((*pubIter).second->id ==
-          connIter->second->id)
+      if ((*pubIter).second->GetId() == connIter->second->GetId())
       {
         this->RemovePublisher((*pubIter).first);
         done = false;
     SubList::iterator subIter = this->subscribers.begin();
     while (subIter != this->subscribers.end())
     {
-      if ((*subIter).second->id == connIter->second->id)
+      if ((*subIter).second->GetId() == connIter->second->GetId())
       {
         this->RemoveSubscriber((*subIter).first);
         done = false;

File gazebo/Server.cc

 
 #include "gazebo/gazebo.hh"
 #include "gazebo/transport/transport.hh"
+
+#include "gazebo/common/LogRecord.hh"
+#include "gazebo/common/LogPlay.hh"
 #include "gazebo/common/Timer.hh"
 #include "gazebo/common/Exception.hh"
 #include "gazebo/common/Plugin.hh"
       this->systemPluginsArgv[i][j] = argv[i][j];
   }
 
-  std::string configFilename;
 
   po::options_description v_desc("Allowed options");
   v_desc.add_options()
     ("help,h", "Produce this help message.")
+    ("record,r", "Record state data to disk.")
+    ("play,p", po::value<std::string>(), "Play a log file.")
     ("pause,u", "Start the server in a paused state.")
     ("server-plugin,s", po::value<std::vector<std::string> >(),
      "Load a plugin.");
 
   try
   {
-    po::store(
-        po::command_line_parser(argc, argv).options(desc).positional(
+    po::store(po::command_line_parser(argc, argv).options(desc).positional(
           p_desc).allow_unregistered().run(), this->vm);
+
     po::notify(this->vm);
-  } catch(boost::exception &_e)
+  }
+  catch(boost::exception &_e)
   {
     std::cerr << "Error. Invalid arguments\n";
     // NOTE: boost::diagnostic_information(_e) breaks lucid
     }
   }
 
+  // Set the parameter to record a log file
+  if (this->vm.count("record"))
+    this->params["record"] = "bz2";
+
   if (this->vm.count("pause"))
     this->params["pause"] = "true";
   else
     this->params["pause"] = "false";
 
-  if (this->vm.count("world_file"))
-    configFilename = this->vm["world_file"].as<std::string>();
+  // The following "if" block must be processed directly before
+  // this->ProcessPrarams.
+  //
+  // Set the parameter to playback a log file. The log file contains the
+  // world description, so don't try to reead the world file from the
+  // command line.
+  if (this->vm.count("play"))
+  {
+    // Load the log file
+    common::LogPlay::Instance()->Open(this->vm["play"].as<std::string>());
+
+    // Get the SDF world description from the log file
+    std::string sdfString;
+    common::LogPlay::Instance()->Step(sdfString);
+
+    // Load the server
+    if (!this->LoadString(sdfString))
+      return false;
+  }
   else
-    configFilename = "worlds/empty.world";
+  {
+    // Get the world file name from the command line, or use "empty.world"
+    // if no world file is specified.
+    std::string configFilename = "worlds/empty.world";
+    if (this->vm.count("world_file"))
+      configFilename = this->vm["world_file"].as<std::string>();
 
-  if (!this->Load(configFilename))
-    return false;
+    // Load the server
+    if (!this->LoadFile(configFilename))
+      return false;
+  }
 
   this->ProcessParams();
   this->Init();
 }
 
 /////////////////////////////////////////////////
-bool Server::Load(const std::string &_filename)
+bool Server::LoadFile(const std::string &_filename)
 {
   // Quick test for a valid file
   FILE *test = fopen(common::find_file(_filename).c_str(), "r");
   }
   fclose(test);
 
-  std::string host = "";
-  unsigned int port = 0;
-
-  gazebo::transport::get_master_uri(host, port);
-
-  this->master = new gazebo::Master();
-  this->master->Init(port);
-  this->master->RunThread();
-
   // Load the world file
   sdf::SDFPtr sdf(new sdf::SDF);
   if (!sdf::init(sdf))
     return false;
   }
 
+  return this->LoadImpl(sdf->root);
+}
+
+/////////////////////////////////////////////////
+bool Server::LoadString(const std::string &_sdfString)
+{
+  // Load the world file
+  sdf::SDFPtr sdf(new sdf::SDF);
+  if (!sdf::init(sdf))
+  {
+    gzerr << "Unable to initialize sdf\n";
+    return false;
+  }
+
+  if (!sdf::readString(_sdfString, sdf))
+  {
+    gzerr << "Unable to read SDF string[" << _sdfString << "]\n";
+    return false;
+  }
+
+  return this->LoadImpl(sdf->root);
+}
+
+/////////////////////////////////////////////////
+bool Server::LoadImpl(sdf::ElementPtr _elem)
+{
+  std::string host = "";
+  unsigned int port = 0;
+
+  gazebo::transport::get_master_uri(host, port);
+
+  this->master = new gazebo::Master();
+  this->master->Init(port);
+  this->master->RunThread();
+
+
   // Load gazebo
   gazebo::load(this->systemPluginsArgc, this->systemPluginsArgv);
 
   /// Load the physics library
   physics::load();
 
-  sdf::ElementPtr worldElem = sdf->root->GetElement("world");
+  sdf::ElementPtr worldElem = _elem->GetElement("world");
   if (worldElem)
   {
     physics::WorldPtr world = physics::create_world();
     {
       gzthrow("Failed to load the World\n"  << e);
     }
-
-    this->worldFilenames[world->GetName()] = _filename;
   }
 
   this->node = transport::NodePtr(new transport::Node());
 
       physics::pause_worlds(p);
     }
+    else if (iter->first == "record")
+    {
+      common::LogRecord::Instance()->Start(iter->second);
+    }
   }
 }
 
       if ((*iter).has_save_filename())
         world->Save((*iter).save_filename());
       else
-        world->Save(this->worldFilenames[world->GetName()]);
+        gzerr << "No filename specified.\n";
     }
     else if ((*iter).has_new_world() && (*iter).new_world())
     {

File gazebo/Server.hh

     public: void PrintUsage();
     public: bool ParseArgs(int argc, char **argv);
 
-    public: bool Load(const std::string &_filename="worlds/empty.world");
+    public: bool LoadFile(const std::string &_filename="worlds/empty.world");
+    public: bool LoadString(const std::string &_sdfString);
     public: void Init();
     public: void Run();
     public: void Stop();
 
     public: bool GetInitialized() const;
 
+    /// \brief Load implementation.
+    /// \param[in] _elem Description of the world to load.
+    private: bool LoadImpl(sdf::ElementPtr _elem);
+
     private: static void SigInt(int _v);
 
     private: void ProcessParams();
 
     private: boost::mutex *receiveMutex;
     private: std::list<msgs::ServerControl> controlMsgs;
-    private: std::map<std::string, std::string> worldFilenames;
 
     private: gazebo::common::StrStr_M params;
     private: po::variables_map vm;

File gazebo/common/Animation.cc

 
 #include "math/Spline.hh"
 #include "math/RotationSpline.hh"
+#include "common/Console.hh"
 #include "common/KeyFrame.hh"
 #include "common/Animation.hh"
 
 }
 
 /////////////////////////////////////////////////
-KeyFrame* Animation::GetKeyFrame(unsigned int _index) const
+KeyFrame *Animation::GetKeyFrame(unsigned int _index) const
 {
-  return this->keyFrames[_index];
+  KeyFrame *result = NULL;
+
+  if (_index < this->keyFrames.size())
+    result = this->keyFrames[_index];
+  else
+  {
+    gzerr << "Key frame index[" << _index
+          << "] is larger than key frame array size["
+          << this->keyFrames.size() << "]\n";
+  }
+
+  return result;
 }
 
 /////////////////////////////////////////////////

File gazebo/common/Animation.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
     /// \addtogroup gazebo_common
     /// \{
 
+    /// \class Animation Animation.hh common/common.hh
     /// \brief Manages an animation, which is a collection of keyframes and
     /// the ability to interpolate between the keyframes
     class Animation

File gazebo/common/BVHLoader.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
     /// \addtogroup gazebo_common
     /// \{
 
+    /// \class BVHLoader BVHLoader.hh common/common.hh
     /// \brief Handles loading BVH animation files
     class BVHLoader
     {

File gazebo/common/CMakeLists.txt

   Exception.cc
   Image.cc
   KeyFrame.cc
+  LogPlay.cc
+  LogRecord.cc
   Material.cc
   Mesh.cc
   MeshLoader.cc
   Exception.hh
   Image.hh 
   KeyFrame.hh
+  LogPlay.hh
+  LogRecord.hh
   Material.hh
   Mesh.hh
   MeshLoader.hh

File gazebo/common/ColladaLoader.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
     /// \addtogroup gazebo_common Common
     /// \{
 
+    /// \class ColladaLoader ColladaLoader.hh common/common.hh
     /// \brief Class used to load Collada mesh files
     class ColladaLoader : public MeshLoader
     {

File gazebo/common/Color.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
     /// \addtogroup gazebo_common Common
     /// \{
 
+    /// \class Color Color.hh common/common.hh
     /// \brief Defines a color
     class Color
     {
       /// \brief (1, 0, 1)
       public: static const Color Purple;
 
+      /// \def RGBA
+      /// \brief A RGBA packed value as an unsigned int
       public: typedef unsigned int RGBA;
+
+      /// \def BGRA
+      /// \brief A BGRA packed value as an unsigned int
       public: typedef unsigned int BGRA;
+
+      /// \def ARGB
+      /// \brief A ARGB packed value as an unsigned int
       public: typedef unsigned int ARGB;
+
+      /// \def ABGR
+      /// \brief A ABGR packed value as an unsigned int
       public: typedef unsigned int ABGR;
 
       /// \brief Constructor

File gazebo/common/Common.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.

File gazebo/common/CommonTypes.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
   class SystemPlugin;
   class VisualPlugin;
 
+  /// \def WorldPluginPtr
+  /// \brief boost::shared_ptr to WorldPlugin
   typedef boost::shared_ptr<WorldPlugin> WorldPluginPtr;
+
+  /// \def ModelPluginPtr
+  /// \brief boost::shared_ptr to ModelPlugin
   typedef boost::shared_ptr<ModelPlugin> ModelPluginPtr;
+
+  /// \def SensorPluginPtr
+  /// \brief boost::shared_ptr to SensorPlugin
   typedef boost::shared_ptr<SensorPlugin> SensorPluginPtr;
+
+  /// \def GUIPluginPtr
+  /// \brief boost::shared_ptr to GUIPlugin
   typedef boost::shared_ptr<GUIPlugin> GUIPluginPtr;
+
+  /// \def SystemPluginPtr
+  /// \brief boost::shared_ptr to SystemPlugin
   typedef boost::shared_ptr<SystemPlugin> SystemPluginPtr;
+
+  /// \def VisualPluginPtr
+  /// \brief boost::shared_ptr to VisualPlugin
   typedef boost::shared_ptr<VisualPlugin> VisualPluginPtr;
 
   namespace common
     template <typename T>
     class ParamT;
 
+    /// \def Param_V
+    /// \brief std::vector of Param*
     typedef std::vector<common::Param*> Param_V;
+
+    /// \def StrStr_M
+    /// \brief std::map of a std::string to a std::string
     typedef std::map<std::string, std::string> StrStr_M;
+
+    /// \def AnimationPtr
+    /// \brief boost::shared_ptr to an Animation class
     typedef boost::shared_ptr<Animation> AnimationPtr;
+
+    /// \def PoseAnimationPtr
+    /// \brief boost::shared_ptr to a PoseAnimation class
     typedef boost::shared_ptr<PoseAnimation> PoseAnimationPtr;
+
+    /// \def NumericAnimationPtr
+    /// \brief boost::shared_ptr to a NumericAnimation class
     typedef boost::shared_ptr<NumericAnimation> NumericAnimationPtr;
   }
 
   namespace event
   {
     class Connection;
+
+    /// \def ConnectionPtr
+    /// \brief boost::shared_ptr to a Connection class
     typedef boost::shared_ptr<Connection> ConnectionPtr;
+
+    /// \def Connection_V
+    /// \brief std::vector of ConnectionPtr
     typedef std::vector<ConnectionPtr> Connection_V;
   }
 }

File gazebo/common/Console.cc

 //////////////////////////////////////////////////
 void Console::Load()
 {
-  char logFilename[50];
-
-  // TODO: Reimplement logging
-  /*if (**(this->logDataP))
-    {
-    time_t t;
-    struct tm *localTime;
-    char baseFilename[50];
-
-    time(&t);
-    localTime = localtime(&t);
-
-    strftime(baseFilename, sizeof(baseFilename),
-    "gazebo-%Y_%m_%d_%H_%M", localTime);
-
-    snprintf(logFilename, sizeof(logFilename), "%s.log", baseFilename);
-    }
-    else
-    {
-    */
-  snprintf(logFilename, strlen("/dev/null"), "/dev/null");
-  // }
-
-  this->logStream.open(logFilename, std::ios::out);
 }
 
 //////////////////////////////////////////////////
 
   return *this->errStream;
 }
-
-//////////////////////////////////////////////////
-std::ofstream &Console::Log()
-{
-  return this->logStream;
-}

File gazebo/common/Console.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
     #define gzerr (gazebo::common::Console::Instance()->ColorErr("Error", \
           __FILE__, __LINE__, 31))
 
-    /// \brief Log a message
-    #define gzlog (gazebo::common::Console::Instance()->Log() << "[" <<\
-        __FILE__ << ":" << __LINE__ << "] ")
-
     /// start marker
     #define gzclr_start(clr) "\033[1;33m"
     /// end marker
     #define gzclr_end "\033[0m"
 
-    /// \brief Message, error, warning, and logging functionality
+
+
+    /// \addtogroup gazebo_common Common
+    /// \{
+
+    /// \class Console Console.hh common/commom.hh
+    /// \brief Message, error, warning functionality
+
     class Console
     {
       /// \brief Default constructor
       public: std::ostream &ColorErr(const std::string &_lbl,
                   const std::string &_file, unsigned int _line, int _color);
 
-      /// \brief Use this to output a message to a log file
-      /// \return Reference to output stream
-      public: std::ofstream &Log();
-
-      /// \brief True if logging data
-      private: bool logData;
-
+      /// \class NullStream Animation.hh common/common.hh
       /// \brief A stream that does not output anywhere
       private: class NullStream : public std::ostream
                {
       /// \brief error stream
       private: std::ostream *errStream;
 
-      /// \brief log stream
-      private: std::ofstream logStream;
-
       /// Pointer to myself
       private: static Console *myself;
     };

File gazebo/common/Diagnostics.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
     class DiagnosticTimer;
     typedef boost::shared_ptr< DiagnosticTimer > DiagnosticTimerPtr;
 
+    /// \class DiagnosticManager Diagnostics.hh common/common.hh
     /// \brief A diagnostic manager class
     class DiagnosticManager : public SingletonT<DiagnosticManager>
     {
       private: friend class SingletonT<DiagnosticManager>;
     };
 
+    /// \class DiagnosticTimer Diagnostics.hh common/common.hh
     /// \brief A timer designed for diagnostics
     class DiagnosticTimer : public Timer
     {

File gazebo/common/Event.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
     /// \addtogroup gazebo_event Events
     /// \{
 
+    /// \class Event Event.hh common/common.hh
     /// \brief Base class for all events
     class Event
     {
       public: template<typename T> friend class EventT;
     };
 
+    /// \class EventT Event.hh common/common.hh
     /// \brief A class for event processing
     template< typename T>
     class EventT : public Event
     }
 
     /// \brief Removes a connection
-    /// \param[_id] the connection index
+    /// \param[in] _id the connection index
     template<typename T>
     void EventT<T>::Disconnect(int _id)
     {

File gazebo/common/Events.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * limitations under the License.
  *
 */
-#ifndef EVENTS_HH
-#define EVENTS_HH
+#ifndef _EVENTS_HH_
+#define _EVENTS_HH_
 
 #include <string>
 #include "common/Event.hh"
 {
   namespace event
   {
+    /// \addtogroup gazebo_event
+    /// \{
+
+    /// \class Events Events.hh common/common.hh
     /// \brief An Event class to get notifications for simulator events
     class Events
     {
-      /// \addtogroup gazebo_event
-      /// \{
-
       //////////////////////////////////////////////////////////////////////////
       /// \brief Connect a boost::slot the the pause signal
       /// \param[in] _subscriber the subscriber to this event

File gazebo/common/Exception.cc

   this->file = _file;
   this->line = _line;
   this->str = _msg;
-  gazebo::common::Console::Instance()->ColorErr("Exception",
-      this->file, this->line, 31) << *this << "\n";
 }
 
 //////////////////////////////////////////////////
 Exception::~Exception()
 {
+}
+
+//////////////////////////////////////////////////
+void Exception::Print() const
+{
   gazebo::common::Console::Instance()->ColorErr("Exception",
       this->file, this->line, 31) << *this << "\n";
 }

File gazebo/common/Exception.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
       throwStream << msg << std::endl << std::flush;\
       throw gazebo::common::Exception(__FILE__, __LINE__, throwStream.str()); }
 
+    /// \class Exception Exception.hh common/common.hh
     /// \brief Class for generating exceptions
     class Exception
     {
       public: Exception();
 
       /// \brief Default constructor
-      /// \param[in] file File name
-      /// \param[in] line Line number where the error occurred
-      /// \param[in] msg Error message
-      public: Exception(const char *file,
-                          int line,
-                          std::string msg);
+      /// \param[in] _file File name
+      /// \param[in] _line Line number where the error occurred
+      /// \param[in] _msg Error message
+      public: Exception(const char *_file,
+                          int _line,
+                          std::string _msg);
 
       /// \brief Destructor
       public: virtual ~Exception();
       /// \return The error string
       public: std::string GetErrorStr() const;
 
+      /// \brief Print the exception to std out.
+      public: void Print() const;
+
       /// \brief The error function
       private: std::string file;
 

File gazebo/common/Image.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
     /// \addtogroup gazebo_common Common
     /// \{
 
+    /// \class Image Image.hh common/common.hh
     /// \brief Encapsulates an image
     class Image
     {

File gazebo/common/KeyFrame.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
     /// \addtogroup gazebo_common Common
     /// \{
 
+    /// \class KeyFrame KeyFrame.hh common/common.hh
     /// \brief A key frame in an animation
     class KeyFrame
     {
       public: const math::Vector3 &GetTranslation() const;
 
       /// \brief Set the rotation for the keyframe
-      /// \param[in] _trans Rotation amount
+      /// \param[in] _rot Rotation amount
       public: void SetRotation(const math::Quaternion &_rot);
 
       /// \brief Get the rotation of the keyframe
     class NumericKeyFrame : public KeyFrame
     {
       /// \brief Constructor
-      /// \param[in] Time of the keyframe
+      /// \param[in] _time Time of the keyframe
       public: NumericKeyFrame(double _time);
 
       /// \brief Destructor

File gazebo/common/LogPlay.cc

 #include <boost/iostreams/filter/bzip2.hpp>
 #include <boost/iostreams/filtering_stream.hpp>
 #include <boost/iostreams/copy.hpp>
+#include <boost/archive/iterators/base64_from_binary.hpp>
 #include <boost/archive/iterators/binary_from_base64.hpp>
 #include <boost/archive/iterators/remove_whitespace.hpp>
 #include <boost/archive/iterators/istream_iterator.hpp>
+#include <boost/archive/iterators/transform_width.hpp>
 
 #include "gazebo/math/Rand.hh"
 
 #include "gazebo/common/Exception.hh"
 #include "gazebo/common/Console.hh"
+#include "gazebo/common/LogRecord.hh"
 #include "gazebo/common/LogPlay.hh"
 
 using namespace gazebo;

File gazebo/common/LogPlay.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
     /// \{
 
     /// \class Logplay Logplay.hh common/common.hh
-    /// \brief Open and playback log files that were recorded using LogWrite.
+    /// \brief Open and playback log files that were recorded using LogRecord.
     ///
     /// Use Logplay to open a log file (Logplay::Open), and access the
     /// recorded state information. Iterators are available to step through
     /// World using the Play functions. Replay involves reading and applying
     /// state information to a World.
     ///
-    /// \sa LogWrite, State
+    /// \sa LogRecord, State
     class LogPlay : public SingletonT<LogPlay>
     {
       /// \brief Constructor

File gazebo/common/LogRecord.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <boost/archive/iterators/insert_linebreaks.hpp>
 #include <boost/archive/iterators/transform_width.hpp>
 #include <boost/archive/iterators/ostream_iterator.hpp>
+#include <boost/filesystem.hpp>
 
 #include "common/Event.hh"
 #include "common/SingletonT.hh"
     /// addtogroup gazebo_common
     /// \{
 
-    /// \class LogRecord LogRecord.hh physics/LogRecord.hh
+    /// \class LogRecord LogRecord.hh common/common.hh
     /// \brief Handles logging of data to disk
     ///
     /// The LogRecord class is a Singleton that manages data logging of any
       ///
       /// Init may only be called once, False will be returned if called
       /// multiple times.
+      /// \param[in] _subdir Directory to record to
       /// \return True if successful.
       public: bool Init(const std::string &_subdir);
 

File gazebo/common/Material.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
     /// \addtogroup gazebo_common Common
     /// \{
 
+    /// \class Material Material.hh common/common.hh
     /// \brief Encapsulates description of a material
     class Material
     {
       public: std::string GetName() const;
 
       /// \brief Set a texture image
-      /// \param[i] _tex The name of the texture, which must be in Gazebo's
+      /// \param[in] _tex The name of the texture, which must be in Gazebo's
       ///             resource path
       public: void SetTextureImage(const std::string &_tex);
 
       /// \brief Set a texture image
-      /// \param[i] _tex The name of the texture
-      /// \param[_resourcePath] _resourcePath Path which contains _tex
+      /// \param[in] _tex The name of the texture
+      /// \param[in] _resourcePath Path which contains _tex
       public: void SetTextureImage(const std::string &_tex,
                                    const std::string &_resourcePath);
 

File gazebo/common/Mesh.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * limitations under the License.
  *
 */
-#ifndef MESH_HH
-#define MESH_HH
+#ifndef _MESH_HH_
+#define _MESH_HH_
 
 #include <vector>
 #include <string>
     /// \addtogroup gazebo_common Common
     /// \{
 
+    /// \class Mesh Mesh.hh common/common.hh
     /// \brief A 3D mesh
     class Mesh
     {

File gazebo/common/MeshLoader.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
     /// \addtogroup gazebo_common Common
     /// \{
 
+    /// \class MeshLoader MeshLoader.hh common/common.hh
     /// \brief Base class for loading meshes
     class MeshLoader
     {
       public: virtual ~MeshLoader();
 
       /// \brief Load a 3D mesh
-      /// \param[in] the path to the mesh
+      /// \param[in] _filename the path to the mesh
       /// \return a pointer to the created mesh
-      public: virtual Mesh *Load(const std::string &filename) = 0;
+      public: virtual Mesh *Load(const std::string &_filename) = 0;
     };
     /// \}
   }

File gazebo/common/MeshManager.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * limitations under the License.
  *
 */
-#ifndef MESHMANAGER_HH
-#define MESHMANAGER_HH
+#ifndef _MESHMANAGER_HH_
+#define _MESHMANAGER_HH_
 
 #include <map>
 #include <string>
     /// \addtogroup gazebo_common Common
     /// \{
 
+    /// \class MeshManager MeshManager.hh common/common.hh
     /// \brief Maintains and manages all meshes
     class MeshManager : public SingletonT<MeshManager>
     {

File gazebo/common/ModelDatabase.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.

File gazebo/common/MouseEvent.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
     /// \addtogroup gazebo_common
     /// \{
 
+    /// \class MouseEvent MouseEvent.hh common/common.hh
     /// \brief Generic description of a mouse event.
     class MouseEvent
     {

File gazebo/common/PID.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
     /// \addtogroup gazebo_common
     /// \{
 
+    /// \class PID PID.hh common/common.hh
     /// \brief Generic PID controller class.
     /// Generic proportiolnal-integral-derivative controller class that
     /// keeps track of PID-error states and control inputs given

File gazebo/common/Plugin.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
     VISUAL_PLUGIN
   };
 
+
+  /// \class PluginT Plugin.hh common/common.hh
   /// \brief A class which all plugins must inherit from
   template<class T>
   class PluginT
     /// It locates the shared library and loads it dynamically.
     /// \param[in] _filename the path to the shared library.
     /// \param[in] _handle short name of the handler
+    /// \return Shared Pointer to this class type
     public: static TPtr Create(const std::string &_filename,
                 const std::string &_handle)
             {
             }
 
     /// \brief Returns the type of the plugin
+    /// \return type of the plugin
     public: PluginType GetType() const
             {
               return this->type;
              } fptr_union_t;
   };
 
+  /// \class WorldPlugin Plugin.hh common/common.hh
   /// \brief A plugin with access to physics::World.  See
   ///        <a href="http://gazebosim.org/wiki/tutorials/plugins">
   ///        reference</a>.
     ///
     /// Called when a Plugin is first created, and after the World has been
     /// loaded. This function should not be blocking.
-    /// \param _model Pointer the Model
-    /// \param _sdf Pointer the the SDF element of the plugin.
+    /// \param[in] _model Pointer to the Model
+    /// \param[in] _sdf Pointer to the SDF element of the plugin.
     public: virtual void Load(physics::ModelPtr _model,
                               sdf::ElementPtr _sdf) = 0;
 
     public: virtual void Reset() {}
   };
 
+  /// \class SensorPlugin Plugin.hh common/common.hh
   /// \brief A plugin with access to physics::Sensor.  See
   ///        <a href="http://gazebosim.org/wiki/tutorials/plugins">
   ///        reference</a>.

File gazebo/common/STLLoader.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * limitations under the License.
  *
 */
-#ifndef STLLOADER_HH
-#define STLLOADER_HH
+#ifndef _STLLOADER_HH_
+#define _STLLOADER_HH_
 
 #include <stdint.h>
 #include <string>
     /// \addtogroup gazebo_common Common
     /// \{
 
+    /// \class STLLoader STLLoader.hh common/common.hh
     /// \brief Class used to load STL mesh files
     class STLLoader : public MeshLoader
     {
       public: virtual ~STLLoader();
 
       /// \brief Creates a new mesh and loads the data from a file
-      /// \param[in] filename the mesh file
-      public: virtual Mesh *Load(const std::string &filename);
+      /// \param[in] _filename the mesh file
+      public: virtual Mesh *Load(const std::string &_filename);
 
       /// \brief Reads an ASCII STL (stereolithography) file.
       /// \param[in] _filein the file pointer
       /// \param[out] _mesh the mesh where to load the data
+      /// \return true if read was successful
       private: bool ReadAscii(FILE *_filein, Mesh *_mesh);
 
       /// \brief Reads a binary STL (stereolithography) file.
       /// \param[in] _filein the file pointer
       /// \param[out] the mesh where to load the data
+      /// \return true if read was successful
       private: bool ReadBinary(FILE *_filein, Mesh *_mesh);
 
       /// \brief Compares two strings for equality, disregarding case.
       /// \param[in] _a the vector data
       /// \param[in] _m the number of columns in the table
       /// \param[in] _n the number of rows in the table
+      /// \return The column index of the vector
       private: int RcolFind(float _a[][COR3_MAX], int _m, int _n, float _r[]);
 
       /// \brief Reads a long int from a binary file.

File gazebo/common/SingletonT.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * Date: 2 Sept 2007
  */
 
-#ifndef SINGLETONT_HH
-#define SINGLETONT_HH
+#ifndef _SINGLETONT_HH_
+#define _SINGLETONT_HH_
 
 /// \addtogroup gazebo_common Common
 /// \{
 
+/// \class SingletonT SingletonT.hh common/common.hh
 /// \brief Singleton template class
 template <class T>
 class SingletonT

File gazebo/common/Skeleton.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * limitations under the License.
  *
 */
-#ifndef SKELETON_HH
-#define SKELETON_HH
+#ifndef _SKELETON_HH_
+#define _SKELETON_HH_
 
 #include <vector>
 #include <string>
     /// \addtogroup gazebo_common Common Animation
     /// \{
 
+    /// \class Skeleton Skeleton.hh common/common.hh
     /// \brief A skeleton
     class Skeleton
     {
                                      double _weight);
 
       /// \brief Returns the number of bone weights for a vertex
-      /// \param[in] the index of the vertex
+      /// \param[in] _vertex the index of the vertex
       /// \return the count
       public: unsigned int GetNumVertNodeWeights(unsigned int _vertex);
 
       public: unsigned int GetNumAnimations();
 
       /// \brief Find animation
-      /// \param _i the animation index
+      /// \param[in] _i the animation index
       /// \return the animation, or NULL if _i is out of bounds
       public: SkeletonAnimation* GetAnimation(const unsigned int _i);
 
       /// \brief Add an animation. The skeleton does not take ownership of the
       /// animation
-      /// \param _anim the animation
+      /// \param[in] _anim the animation to add
       public: void AddAnimation(SkeletonAnimation *_anim);
 
       /// \brief Initializes the hande numbers for each node in the map
-      /// using breath first traversal
+      /// using breadth first traversal
       protected: void BuildNodeMap();
 
       /// \brief the root node
       protected: std::vector<SkeletonAnimation*> anims;
     };
 
+    /// \class SkeletonNode Skeleton.hh common/common.hh
     /// \brief A skeleton node
     class SkeletonNode
     {
       public: enum SkeletonNodeType {NODE, JOINT};
 
       /// \brief Constructor
+      /// \param[in] _parent The parent node
       public: SkeletonNode(SkeletonNode* _parent);
 
       /// \brief Constructor
       /// \param[in] _parent the parent node
-      /// \param[in] __name name of node
-      /// \param
+      /// \param[in] _name name of node
+      /// \param[in] _id Id of node
+      /// \param[in] _type The type of this node
       public: SkeletonNode(SkeletonNode* _parent, std::string _name,
                 std::string _id, SkeletonNodeType _type = JOINT);
 
       protected: std::vector<NodeTransform> rawTransforms;
     };
 
+    /// \clas NodeTransform Skeleton.hh common/common.hh
     /// \brief A transformation node
     class NodeTransform
     {

File gazebo/common/SkeletonAnimation.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
     /// \addtogroup gazebo_common Common Animation
     /// \{
 
+    /// \class NodeAnimation SkeletonAnimation.hh common/common.hh
     /// \brief Node animation
     class NodeAnimation
     {

File gazebo/common/SystemPaths.cc

File contents unchanged.

File gazebo/common/SystemPaths.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
     /// \addtogroup gazebo_common Common
     /// \{
 
+    /// \class SystemPaths SystemPaths.hh common/common.hh
     /// \brief Functions to handle getting system paths, keeps track of:
     ///        \li SystemPaths#gazeboPaths - media paths containing
     ///            worlds, models, sdf descriptions, material scripts,
 
       /// \brief Find a file or path using a URI
       /// \param[in] _uri the uniform resource identifier
+      /// \return Returns full path name to file
       public: std::string FindFileURI(const std::string &_uri);
 
       /// \brief Find a file in the gazebo paths
       /// \param[in] _filename Name of the file to find.
       /// \param[in] _searchLocalPath True to search in the current working
       /// directory.
+      /// \return Returns full path name to file
       public: std::string FindFile(const std::string &_filename,
                                    bool _searchLocalPath = true);
 
       /// \brief clear out SystemPaths#pluginPaths
       public: void ClearPluginPaths();
 
-      /// \brief add _suffix to the list of path search sufixes
+      /// \brief add _suffix to the list of path search suffixes
+      /// \param[in] _suffix The suffix to add
       public: void AddSearchPathSuffix(const std::string &_suffix);
 
       /// \brief re-read SystemPaths#gazeboPaths from environment variable

File gazebo/common/Time.hh

 /*
- * Copyright 2011 Nate Koenig
+ * Copyright 2012 Nate Koenig
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * Date: 03 Apr 2007
  */
 
-#ifndef TIME_HH
-#define TIME_HH
+#ifndef _TIME_HH_
+#define _TIME_HH_
 
 #include <stdlib.h>
 #include <time.h>
     /// \addtogroup gazebo_common
     /// \{
 
+    /// \class Time Time.hh common/common.hh
     /// \brief A Time class, can be used to hold wall- or sim-time.
     ///        stored as sec and nano-sec.
     class Time
       public: Time(const Time &_time);
 
       /// \brief Constructor
-      /// \param[in] tv Time to initialize to
+      /// \param[in] _tv Time to initialize to
       public: Time(const struct timeval &_tv);
 
       /// \brief Constructor
-      /// \param[in] tv Time to initialize to
+      /// \param[in] _tv Time to initialize to
       public: Time(const struct timespec &_tv);
 
       /// \brief Constructor
-      /// \param[in] sec Seconds
-      /// \param[in] nsec Microseconds
+      /// \param[in] _sec Seconds
+      /// \param[in] _nsec Nanoseconds
       public: Time(int32_t _sec, int32_t _nsec);
 
       /// \brief Constuctor
-      /// \param[in] time Time in double format sec.nsec
+      /// \param[in] _time Time in double format sec.nsec
       public: Time(double _time);
 
       /// \brief Destructor
       public: void SetToWallTime();
 
       /// \brief Set to sec and nsec
-      /// \param[in] sec Seconds
-      /// \param[in] nsec micro seconds
+      /// \param[in] _sec Seconds
+      /// \param[in] _nsec Nanoseconds
       public: void Set(int32_t _sec, int32_t _nsec);
 
       /// \brief Set to seconds
-      /// \param[in] seconds Number of seconds
+      /// \param[in] _seconds Number of seconds
       public: void Set(double _seconds);
 
       /// \brief Get the time as a double
       public: static Time NSleep(Time _time);
 
       /// \brief Assignment operator
-      /// \param[in] tv the new time
+      /// \param[in] _tv the new time
       /// \return a reference to this instance
-      public: Time &operator =(const struct timeval &tv);
+      public: Time &operator =(const struct timeval &_tv);
 
       /// \brief Assignment operator
-      /// \param[in] tv the new time
+      /// \param[in] _tv the new time
       /// \return a reference to this instance
-      public: Time &operator =(const struct timespec &tv);
+      public: Time &operator =(const struct timespec &_tv);
 
       /// \brief Assignment operator
-      /// \param[in] time the new time
+      /// \param[in] _time the new time
       /// \return a reference to this instance
-      public: Time &operator =(const Time &time);
+      public: Time &operator =(const Time &_time);
 
       /// \brief Addition operators
-      /// \param[in] tv the time to add
+      /// \param[in] _tv the time to add
       /// \return a Time instance
-      public: Time operator +(const struct timeval &tv) const;
+      public: Time operator +(const struct timeval &_tv) const;
 
       /// \brief Addition operators
-      /// \param[in] tv the time to add
+      /// \param[in] _tv the time to add
       /// \return a Time instance
-      public: Time operator +(const struct timespec &tv) const;
+      public: Time operator +(const struct timespec &_tv) const;
 
       /// \brief Addition assignment operator
-      /// \param[in] tv
+      /// \param[in] _tv the time to add
       /// \return a reference to this instance
-      public: const Time &operator +=(const struct timeval &tv);
+      public: const Time &operator +=(const struct timeval &_tv);
 
       /// \brief Addition assignment operator
-      /// \param[in] tv
+      /// \param[in] _tv the time to add
       /// \return a reference to this instance
-      public: const Time &operator +=(const struct timespec &tv);
+      public: const Time &operator +=(const struct timespec &_tv);
 
       /// \brief Addition operators
+      /// \param[in] _time The time to add
       /// \return a Time instance
-      public: Time operator +(const Time &time) const;
+      public: Time operator +(const Time &_time) const;
 
       /// \brief Addition assignemtn operator
+      /// \param[in] _time The time to add
       /// \return a Time instance
-      public: const Time &operator +=(const Time &time);
+      public: const Time &operator +=(const Time &_time);
 
       /// \brief Subtraction operator
+      /// \param[in] _tv The time to subtract
       /// \return a Time instance
-      public: Time operator -(const struct timeval &tv) const;
+      public: Time operator -(const struct timeval &_tv) const;
 
       /// \brief Subtraction assignment operator
+      /// \param[in] _tv The time to subtract
       /// \return a Time instance
-      public: const Time &operator -=(const struct timeval &tv);
+      public: const Time &operator -=(const struct timeval &_tv);
 
       /// \brief Subtraction operator
+      /// \param[in] _tv The time to subtract
       /// \return a Time instance
-      public: Time operator -(const struct timespec &tv) const;
+      public: Time operator -(const struct timespec &_tv) const;
 
       /// \brief Subtraction assignment operator
+      /// \param[in] _tv The time to subtract
       /// \return a Time instance
-      public: const Time &operator -=(const struct timespec &tv);
+      public: const Time &operator -=(const struct timespec &_tv);
 
       /// \brief Subtraction operator
+      /// \param[in] _time The time to subtract
       /// \return a Time instance
-      public: Time operator -(const Time &time) const;
+      public: Time operator -(const Time &_time) const;
 
       /// \brief Subtraction assignment operator
+      /// \param[in] _time The time to subtract
       /// \return a reference to this instance
-      public: const Time &operator -=(const Time &time);
+      public: const Time &operator -=(const Time &_time);
 
       /// \brief Multiplication operator
+      /// \param[in] _tv The scaling duration
       /// \return Time instance
-      public: Time operator *(const struct timeval &tv) const;
+      public: Time operator *(const struct timeval &_tv) const;
 
       /// \brief Multiplication assignment operator