All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | List of all members
gazebo::physics::Logger Class Reference

Handles logging of data to disk. More...

#include <physics/Logger.hh>

Inheritance diagram for gazebo::physics::Logger:
Inheritance graph

Public Member Functions

bool Add (const std::string &_entityName, const std::string &_filename)
 Add an entity to a log file.
bool Remove (const std::string &_entity)
 Remove an entity from a log.

Additional Inherited Members

- Static Public Member Functions inherited from SingletonT< T >
static T * Instance ()
 Get an instance of the singleton.
- Protected Member Functions inherited from SingletonT< T >
 SingletonT ()
virtual ~SingletonT ()

Detailed Description

Handles logging of data to disk.

The Logger class is a Singleton that manages data logging of any entity within a running simulation. An entity may be a World, Model, or any of their child entities. This class only writes log files, see LogPlay for playback functionality.

State information for an entity may be logged through the Logger::Add function, and stopped through the Logger::Remove function. Data may be logged into a single file, or split into many separate files by specifying different filenames for the Logger::Add function.

The Logger is updated at the start of each simulation step. This guarantees that all data is stored.

See Also
Logplay, State

Member Function Documentation

bool gazebo::physics::Logger::Add ( const std::string &  _entityName,
const std::string &  _filename 

Add an entity to a log file.

Add a new entity to a log. An entity can be any valid named object in the world, including the world itself. Duplicate additions are ignored. Entites can be added to the same file by passing specifying the same _filename.

_entityNameName of the entity to log.
_filenameFilename of the log file.
True if the Entity was added to a log. False if the entity is already being logged.
bool gazebo::physics::Logger::Remove ( const std::string &  _entity)

Remove an entity from a log.

Removes an entity from the logger. The stops data recording for the entity and all its children. For example, specifying a world will stop all data logging.

_entityName of the entity to stop logging
True if the entity existed and was removed. False if the entity was not registered with the logger.

The documentation for this class was generated from the following file: