Common

Classes and functions used by multiple modules. More...

Files

file  CommonTypes.hh
 

Namespaces

 gazebo::common
 Common namespace.
 

Classes

class  Animation
 Manages an animation, which is a collection of keyframes and the ability to interpolate between the keyframes. More...
 
class  AssertionInternalError
 Class for generating Exceptions which come from gazebo assertions. More...
 
class  AudioDecoder
 An audio decoder based on FFMPEG. More...
 
class  Battery
 A battery abstraction. More...
 
class  BVHLoader
 Handles loading BVH animation files. More...
 
class  ColladaExporter
 Class used to export Collada mesh files. More...
 
class  ColladaLoader
 Class used to load Collada mesh files. More...
 
class  Console
 Container for loggers, and global logging options (such as verbose vs. More...
 
class  DEM
 Encapsulates a DEM (Digital Elevation Model) file. More...
 
class  Dem
 
class  Exception
 Class for generating exceptions. More...
 
class  FileLogger
 A logger that outputs messages to a file. More...
 
class  FuelModelDatabase
 Connects to an Igniiton Fuel model database, and has utility functions to find models. More...
 
class  GTSMeshUtils
 Creates GTS utilities for meshes. More...
 
class  HeightmapData
 Encapsulates a generic heightmap data file. More...
 
class  HeightmapDataLoader
 Helper class for loading heightmap data. More...
 
class  Image
 Encapsulates an image. More...
 
class  ImageHeightmap
 Encapsulates an image that will be interpreted as a heightmap. More...
 
class  InternalError
 Class for generating Internal Gazebo Errors: those errors which should never happend and represent programming bugs. More...
 
class  KeyEvent
 Generic description of a keyboard event. More...
 
class  KeyFrame
 A key frame in an animation. More...
 
class  Logger
 Terminal logger. More...
 
class  Material
 Encapsulates description of a material. More...
 
class  Mesh
 A 3D mesh. More...
 
class  MeshCSG
 Creates CSG meshes. More...
 
class  MeshExporter
 Base class for exporting meshes. More...
 
class  MeshLoader
 Base class for loading meshes. More...
 
class  MeshManager
 Maintains and manages all meshes. More...
 
class  ModelDatabase
 Connects to model database, and has utility functions to find models. More...
 
class  ModelPlugin
 A plugin with access to physics::Model. More...
 
class  MouseEvent
 Generic description of a mouse event. More...
 
class  MovingWindowFilter< T >
 Base class for MovingWindowFilter. More...
 
class  NodeAnimation
 Node animation. More...
 
class  NodeAssignment
 Vertex to node weighted assignement for skeleton animation visualization. More...
 
class  NodeTransform
 NodeTransform Skeleton.hh common/common.hh More...
 
class  NumericAnimation
 A numeric animation. More...
 
class  NumericKeyFrame
 A keyframe for a NumericAnimation. More...
 
class  OBJLoader
 Class used to load obj mesh files. More...
 
class  PID
 Generic PID controller class. More...
 
class  PluginT< T >
 A class which all plugins must inherit from. More...
 
class  PoseAnimation
 A pose animation. More...
 
class  PoseKeyFrame
 A keyframe for a PoseAnimation. More...
 
class  SemanticVersion
 Version comparison class based on Semantic Versioning 2.0.0 http://semver.org/ Compares versions and converts versions from string. More...
 
class  SensorPlugin
 A plugin with access to physics::Sensor. More...
 
class  SingletonT< T >
 Singleton template class. More...
 
class  Skeleton
 A skeleton. More...
 
class  SkeletonAnimation
 Skeleton animation. More...
 
class  SkeletonNode
 A skeleton node. More...
 
class  SphericalCoordinates
 Convert spherical coordinates for planetary surfaces. More...
 
class  STLLoader
 Class used to load STL mesh files. More...
 
class  SubMesh
 A child mesh. More...
 
class  SystemPaths
 Functions to handle getting system paths, keeps track of: More...
 
class  SystemPlugin
 A plugin loaded within the gzserver on startup. More...
 
class  Time
 A Time class, can be used to hold wall- or sim-time. More...
 
class  Timer
 A timer class, used to time things in real world walltime. More...
 
class  Video
 Handle video encoding and decoding using libavcodec. More...
 
class  VideoEncoder
 The VideoEncoder class supports encoding a series of images to a video format, and then writing the video to disk. More...
 
class  VisualPlugin
 A plugin with access to rendering::Visual. More...
 
class  WorldPlugin
 A plugin with access to physics::World. More...
 

Macros

#define gzdbg   (gazebo::common::Console::dbg(__FILE__, __LINE__))
 Output a debug message. More...
 
#define gzerr   (gazebo::common::Console::err(__FILE__, __LINE__))
 Output an error message. More...
 
#define gzlog   (gazebo::common::Console::log())
 Output a message to a log file. More...
 
#define gzLogDirectory()   (gazebo::common::Console::log.GetLogDirectory())
 Get the full path of the directory where the log files are stored. More...
 
#define gzLogInit(_prefix, _str)   (gazebo::common::Console::log.Init(_prefix, _str))
 Initialize log file with filename given by _str. More...
 
#define gzmsg   (gazebo::common::Console::msg())
 Output a message. More...
 
#define gzthrow(msg)
 This macro logs an error to the throw stream and throws an exception that contains the file name and line number. More...
 
#define gzwarn   (gazebo::common::Console::warn(__FILE__, __LINE__))
 Output a warning message. More...
 

Enumerations

enum  PluginType {
  WORLD_PLUGIN, MODEL_PLUGIN, SENSOR_PLUGIN, SYSTEM_PLUGIN,
  VISUAL_PLUGIN, GUI_PLUGIN
}
 Used to specify the type of plugin. More...
 

Functions

 MovingWindowFilter ()
 Constructor. More...
 
 SemanticVersion ()
 Default constructor. More...
 
 SemanticVersion (const std::string &_v)
 Constructor. More...
 
 SemanticVersion (const SemanticVersion &_copy)
 Copy constructor. More...
 
 SemanticVersion (const unsigned int _major, const unsigned int _minor=0, const unsigned int _patch=0, const std::string &_prerelease="", const std::string &_build="")
 Constructor. More...
 
virtual ~MovingWindowFilter ()
 Destructor. More...
 
 ~SemanticVersion ()
 Destructor. More...
 
std::string absPath (const std::string &_path)
 Get the absolute path of a provided path. More...
 
void add_search_path_suffix (const std::string &_suffix)
 add path sufix to common::SystemPaths More...
 
std::string Build () const
 Get the build metadata string. More...
 
std::string CachedFilePath (const std::string &_uri)
 Get the full local path to a cached file based on its URI. More...
 
bool copyDir (const boost::filesystem::path &_source, const boost::filesystem::path &_destination)
 Copy a directory, overwrite the destination directory if exists. More...
 
bool copyFile (const std::string &_existingFilename, const std::string &_newFilename)
 Copy a file. More...
 
std::string cwd ()
 Get the current working directory. More...
 
static bool DelaunayTriangulation (const std::vector< ignition::math::Vector2d > &_vertices, const std::vector< ignition::math::Vector2i > &_edges, SubMesh *_submesh)
 Perform delaunay triangulation on input vertices. More...
 
void DownloadDependencies (const std::string &_path)
 Download all dependencies for a give model path. More...
 
bool exists (const std::string &_path)
 Returns true if _path is a file or directory. More...
 
std::string find_file (const std::string &_file)
 search for file in common::SystemPaths More...
 
std::string find_file (const std::string &_file, bool _searchLocalPath)
 search for file in common::SystemPaths More...
 
std::string find_file_path (const std::string &_file)
 search for a file in common::SystemPaths More...
 
void Fini ()
 Finalize the model database. More...
 
Get ()
 Get filtered result. More...
 
template<typename T >
std::string get_sha1 (const T &_buffer)
 Compute the SHA1 hash of an array of bytes. More...
 
std::string GetDBConfig (const std::string &_uri)
 Return the database.config file as a string. More...
 
const char * getEnv (const char *_name)
 Cross platform retrieval of an environment variable. More...
 
std::string GetModelConfig (const std::string &_uri)
 Return the model.config file as a string. More...
 
std::string GetModelFile (const std::string &_uri)
 Get a model's SDF file based on a URI. More...
 
std::string GetModelName (const std::string &_uri)
 Get the name of a model based on a URI. More...
 
std::string GetModelPath (const std::string &_uri, bool _forceDownload=false)
 Get the local path to a model. More...
 
std::map< std::string, std::string > GetModels ()
 Returns the dictionary of all the model names. More...
 
event::ConnectionPtr GetModels (boost::function< void(const std::map< std::string, std::string > &)> _func)
 Get the dictionary of all model names via a callback. More...
 
std::string GetURI ()
 Returns the the global model database URI. More...
 
bool GetWindowFilled () const
 Get whether the window has been filled. More...
 
unsigned int GetWindowSize () const
 Get the window size. More...
 
bool HasModel (const std::string &_modelName)
 Returns true if the model exists on the database. More...
 
bool isDirectory (const std::string &_path)
 Check if the given path is a directory. More...
 
bool isFile (const std::string &_path)
 Check if the given path is a file. More...
 
void load ()
 Load the common library. More...
 
unsigned int Major () const
 Get the major number. More...
 
unsigned int Minor () const
 Get the minor number. More...
 
std::string ModelFile (const std::string &_uri)
 Get a model's SDF file based on a URI. More...
 
std::string ModelPath (const std::string &_uri, const bool _forceDownload=false)
 Get the local path to a model. More...
 
virtual void Models (const ignition::fuel_tools::ServerConfig &_server, std::function< void(const std::vector< ignition::fuel_tools::ModelIdentifier > &)> &_func)
 Get the list of all models via a callback. More...
 
virtual std::vector< ignition::fuel_tools::ModelIdentifier > Models (const ignition::fuel_tools::ServerConfig &_server) const
 Get the list of all models. More...
 
bool moveFile (const std::string &_existingFilename, const std::string &_newFilename)
 Move a file. More...
 
bool operator!= (const SemanticVersion &_other) const
 Inequality comparison operator. More...
 
bool operator< (const SemanticVersion &_other) const
 Less than comparison operator. More...
 
bool operator<= (const SemanticVersion &_other) const
 Less than or equal comparison operator. More...
 
SemanticVersionoperator= (const SemanticVersion &_other)
 Assignment operator. More...
 
bool operator== (const SemanticVersion &_other) const
 Equality comparison operator. More...
 
bool operator> (const SemanticVersion &_other) const
 Greater than comparison operator. More...
 
bool operator>= (const SemanticVersion &_other) const
 Greater than or equal comparison operator. More...
 
bool Parse (const std::string &_versionStr)
 Parse a version string and set the major, minor, patch numbers, and prerelease and build strings. More...
 
unsigned int Patch () const
 Get the patch number. More...
 
std::string Prerelease () const
 Get the prerelease string. More...
 
void replaceAll (std::string &_result, const std::string &_orig, const std::string &_key, const std::string &_replacement)
 Replace all occurances of _key with _replacement. More...
 
std::string replaceAll (const std::string &_orig, const std::string &_key, const std::string &_replacement)
 Replace all occurances of _key with _replacement. More...
 
std::vector< ignition::fuel_tools::ServerConfig > Servers () const
 Get all the Ignition Fuel servers. More...
 
void SetWindowSize (unsigned int _n)
 Set window size. More...
 
std::vector< std::string > split (const std::string &_str, const std::string &_delim)
 Splits a string into tokens. More...
 
void Start (bool _fetchImmediately=false)
 Start the model database. More...
 
std::string unique_file_path (const std::string &_pathAndName, const std::string &_extension)
 Generates a path for a file which doesn't collide with existing files, by appending numbers to it (i.e. More...
 
void Update (T _val)
 Update value of filter. More...
 
std::string Version () const
 Returns the version as a string. More...
 
template<typename T , typename Func , typename... Args>
auto weakBind (Func _func, boost::shared_ptr< T > _ptr, Args... _args) -> decltype(details::makeWeakBinder(boost::bind(_func, _ptr.get(), _args...), boost::weak_ptr< T >(_ptr)))
 

Variables

static std::string PixelFormatNames []
 String names for the pixel formats. More...
 

Friends

std::ostream & operator<< (std::ostream &_out, const SemanticVersion &_v)
 Stream insertion operator. More...
 

Detailed Description

Classes and functions used by multiple modules.

Bind parameters to a function object and return a call wrapper.

This function does not keep an owning pointer to the first shared_ptr given in parameter. When the wrapper is called and if the pointer has expired, the function object is not called and no error is reported. If the pointer is valid, the wrapper takes ownership of the pointer and calls the function object.

Parameters
[in]_funcWrapped function object
[in]_ptrOwning pointer to bind as the first argument of the function object.
[in]_argsArguments to bind to the function object

Macro Definition Documentation

◆ gzdbg

#define gzdbg   (gazebo::common::Console::dbg(__FILE__, __LINE__))

Output a debug message.

◆ gzerr

◆ gzlog

Output a message to a log file.

◆ gzLogDirectory

#define gzLogDirectory ( )    (gazebo::common::Console::log.GetLogDirectory())

Get the full path of the directory where the log files are stored.

Returns
Full path of the directory

◆ gzLogInit

#define gzLogInit (   _prefix,
  _str 
)    (gazebo::common::Console::log.Init(_prefix, _str))

Initialize log file with filename given by _str.

If called twice, it will close currently in use and open a new log file.

Parameters
[in]_prefixPrefix added to the directory where the log file will be created.
[in]_strName of log file for gzlog messages.

◆ gzmsg

Output a message.

Referenced by PluginT< ModelPlugin >::LoadParam().

◆ gzthrow

#define gzthrow (   msg)
Value:
{std::ostringstream throwStream;\
throwStream << msg << std::endl << std::flush;\
throw gazebo::common::Exception(__FILE__, __LINE__, throwStream.str()); }
Class for generating exceptions.
Definition: Exception.hh:45

This macro logs an error to the throw stream and throws an exception that contains the file name and line number.

Referenced by TopicManager::Advertise(), CallbackHelperT< M >::GetMsgType(), and SubscribeOptions::Init().

◆ gzwarn

Enumeration Type Documentation

◆ PluginType

enum PluginType

Used to specify the type of plugin.

Enumerator
WORLD_PLUGIN 

A World plugin.

MODEL_PLUGIN 

A Model plugin.

SENSOR_PLUGIN 

A Sensor plugin.

SYSTEM_PLUGIN 

A System plugin.

VISUAL_PLUGIN 

A Visual plugin.

GUI_PLUGIN 

A GUI plugin.

Function Documentation

◆ MovingWindowFilter()

Constructor.

◆ SemanticVersion() [1/4]

Default constructor.

Use the Parse function to populate an instance with version information.

◆ SemanticVersion() [2/4]

SemanticVersion ( const std::string &  _v)
explicit

Constructor.

Parameters
[in]_vthe string version. ex: "0.3.2"

◆ SemanticVersion() [3/4]

SemanticVersion ( const SemanticVersion _copy)

Copy constructor.

Parameters
[in]_copythe other version

◆ SemanticVersion() [4/4]

SemanticVersion ( const unsigned int  _major,
const unsigned int  _minor = 0,
const unsigned int  _patch = 0,
const std::string &  _prerelease = "",
const std::string &  _build = "" 
)

Constructor.

Parameters
[in]_majorThe major number
[in]_minorThe minor number
[in]_patchThe patch number
[in]_prereleaseThe prerelease string
[in]_buildThe build metadata string

◆ ~MovingWindowFilter()

~MovingWindowFilter ( )
virtual

Destructor.

References MovingWindowFilter< T >::dataPtr.

◆ ~SemanticVersion()

Destructor.

◆ absPath()

std::string gazebo::common::absPath ( const std::string &  _path)

Get the absolute path of a provided path.

Parameters
[in]_pathRelative or absolute path.
Returns
Absolute path

◆ add_search_path_suffix()

void gazebo::common::add_search_path_suffix ( const std::string &  _suffix)

add path sufix to common::SystemPaths

Parameters
[in]_suffixThe suffix to add.

◆ Build()

std::string Build ( ) const

Get the build metadata string.

Build meta data is not used when determining precedence.

Returns
Build metadata string, empty if a build metadata string was not specified.

◆ CachedFilePath()

std::string CachedFilePath ( const std::string &  _uri)

Get the full local path to a cached file based on its URI.

Parameters
[in]_uriThe file's URI
Returns
Local path to the file

◆ copyDir()

bool gazebo::common::copyDir ( const boost::filesystem::path &  _source,
const boost::filesystem::path &  _destination 
)

Copy a directory, overwrite the destination directory if exists.

Parameters
[in]_sourcePath to an existing directory to copy from.
[in]_destinationPath to the destination directory.
Returns
True on success.

◆ copyFile()

bool gazebo::common::copyFile ( const std::string &  _existingFilename,
const std::string &  _newFilename 
)

Copy a file.

Parameters
[in]_existingFilenamePath to an existing file.
[in]_newFilenamePath of the new file.
Returns
True on success.

◆ cwd()

std::string gazebo::common::cwd ( )

Get the current working directory.

Returns
Name of the current directory

◆ DelaunayTriangulation()

static bool DelaunayTriangulation ( const std::vector< ignition::math::Vector2d > &  _vertices,
const std::vector< ignition::math::Vector2i > &  _edges,
SubMesh _submesh 
)
static

Perform delaunay triangulation on input vertices.

Parameters
[in]_verticesA list of all vertices
[in]_edgesA list of edges. Each edge is made of 2 vertex indices from _vertices
[out]_submeshA submesh that will be populated with the resulting triangles.
Returns
True on success.

◆ DownloadDependencies()

void DownloadDependencies ( const std::string &  _path)

Download all dependencies for a give model path.

Look's in the model's manifest file (_path/model.config) for all models listed in the <depend> block, and downloads the models if necessary.

Parameters
[in]_pathPath to a model.

◆ exists()

bool gazebo::common::exists ( const std::string &  _path)

Returns true if _path is a file or directory.

Parameters
[in]_pathPath to check.
Returns
True if _path is a file or directory

◆ find_file() [1/2]

std::string gazebo::common::find_file ( const std::string &  _file)

search for file in common::SystemPaths

Parameters
[in]_fileName of the file to find.
Returns
The path containing the file.

◆ find_file() [2/2]

std::string gazebo::common::find_file ( const std::string &  _file,
bool  _searchLocalPath 
)

search for file in common::SystemPaths

Parameters
[in]_fileName of the file to find.
[in]_searchLocalPathTrue to search in the current working directory.
Returns
The path containing the file.

◆ find_file_path()

std::string gazebo::common::find_file_path ( const std::string &  _file)

search for a file in common::SystemPaths

Parameters
[in]_filethe file name to look for.
Returns
The path containing the file.

◆ Fini()

void Fini ( )

Finalize the model database.

◆ Get()

T Get ( )

Get filtered result.

Returns
latest filtered value

References MovingWindowFilter< T >::dataPtr.

◆ get_sha1()

std::string get_sha1 ( const T &  _buffer)

Compute the SHA1 hash of an array of bytes.

Parameters
[in]_bufferInput sequence. The permitted data types for this function are std::string and any STL container.
Returns
The string representation (40 character) of the SHA1 hash.

◆ GetDBConfig()

std::string GetDBConfig ( const std::string &  _uri)

Return the database.config file as a string.

Returns
The database config file from the model database.

◆ getEnv()

const char* gazebo::common::getEnv ( const char *  _name)

Cross platform retrieval of an environment variable.

Parameters
[in]_nameName of the environment variable to get.
Returns
Environment variable contents, or nullptr on error.

◆ GetModelConfig()

std::string GetModelConfig ( const std::string &  _uri)

Return the model.config file as a string.

Returns
The model config file from the model database.

◆ GetModelFile()

std::string GetModelFile ( const std::string &  _uri)

Get a model's SDF file based on a URI.

Get a model file based on a URI. If the model is on a remote server, then the model fetched and installed locally.

Parameters
[in]_uriThe URI of the model
Returns
The full path and filename to the SDF file

◆ GetModelName()

std::string GetModelName ( const std::string &  _uri)

Get the name of a model based on a URI.

The URI must be fully qualified: http://gazebosim.org/gazebo_models/ground_plane or model://gazebo_models

Parameters
[in]_urithe model uri
Returns
the model's name.

◆ GetModelPath()

std::string GetModelPath ( const std::string &  _uri,
bool  _forceDownload = false 
)

Get the local path to a model.

Get the path to a model based on a URI. If the model is on a remote server, then the model fetched and installed locally.

Parameters
[in]_urithe model uri
[in]_forceDownloadTrue to skip searching local paths.
Returns
path to a model directory

◆ GetModels() [1/2]

std::map<std::string, std::string> GetModels ( )

Returns the dictionary of all the model names.

This is a blocking call. Which means it will wait for the ModelDatabase to download the model list.

Returns
a map of model names, indexed by their full URI.

◆ GetModels() [2/2]

event::ConnectionPtr GetModels ( boost::function< void(const std::map< std::string, std::string > &)>  _func)

Get the dictionary of all model names via a callback.

This is the non-blocking version of ModelDatabase::GetModels

Parameters
[in]_funcCallback function that receives the list of models.
Returns
A boost shared pointer. This pointer must remain valid in order to receive the callback.

◆ GetURI()

std::string GetURI ( )

Returns the the global model database URI.

Returns
the URI.

◆ GetWindowFilled()

bool GetWindowFilled ( ) const

Get whether the window has been filled.

Returns
True if the window has been filled.

References MovingWindowFilter< T >::dataPtr.

◆ GetWindowSize()

unsigned int GetWindowSize ( ) const

Get the window size.

Returns
The size of the moving window.

References MovingWindowFilter< T >::dataPtr.

◆ HasModel()

bool HasModel ( const std::string &  _modelName)

Returns true if the model exists on the database.

Parameters
[in]_modelNameURI of the model (eg: model://my_model_name).
Returns
True if the model was found.

◆ isDirectory()

bool gazebo::common::isDirectory ( const std::string &  _path)

Check if the given path is a directory.

Parameters
[in]_pathPath to a directory.
Returns
True if _path is a directory.

◆ isFile()

bool gazebo::common::isFile ( const std::string &  _path)

Check if the given path is a file.

Parameters
[in]_pathPath to a file.
Returns
True if _path is a file.

◆ load()

void gazebo::common::load ( )

Load the common library.

◆ Major()

unsigned int Major ( ) const

Get the major number.

Returns
The major number

◆ Minor()

unsigned int Minor ( ) const

Get the minor number.

Returns
The minor number

◆ ModelFile()

std::string ModelFile ( const std::string &  _uri)

Get a model's SDF file based on a URI.

Get a model file based on a URI. If the model is on a remote server, then the model is fetched and installed locally.

Parameters
[in]_uriThe URI of the model.
Returns
The full path and filename to the SDF file.

◆ ModelPath()

std::string ModelPath ( const std::string &  _uri,
const bool  _forceDownload = false 
)

Get the local path to a model.

Get the path to a model based on a URI. If the model is on a remote server, then the model fetched and installed locally.

Parameters
[in]_urithe model uri
[in]_forceDownloadTrue to skip searching local cache.
Returns
Local path to a model directory

◆ Models() [1/2]

virtual void Models ( const ignition::fuel_tools::ServerConfig &  _server,
std::function< void(const std::vector< ignition::fuel_tools::ModelIdentifier > &)> &  _func 
)
virtual

Get the list of all models via a callback.

This is a non-blocking function. Your callback will be executed from a separate thread.

Parameters
[in]_serverThe Ignition Fuel server.
[in]_funcCallback function that receives the list of models. The parameter of the callback is a vector, where each element is the unique identifier of a model.

◆ Models() [2/2]

virtual std::vector<ignition::fuel_tools::ModelIdentifier> Models ( const ignition::fuel_tools::ServerConfig &  _server) const
virtual

Get the list of all models.

This is a blocking function.

Parameters
[in]_serverThe Ignition Fuel server.
Returns
The list of models. The returned vector contains elements which uniquely identify models.

◆ moveFile()

bool gazebo::common::moveFile ( const std::string &  _existingFilename,
const std::string &  _newFilename 
)

Move a file.

Parameters
[in]_existingFilenameFull path to an existing file.
[in]_newFilenameFull path of the new file.
Returns
True on success.

◆ operator!=()

bool operator!= ( const SemanticVersion _other) const

Inequality comparison operator.

Parameters
[in]_otherThe other version to compare to
Returns
True if _other version is different

◆ operator<()

bool operator< ( const SemanticVersion _other) const

Less than comparison operator.

Parameters
[in]_otherThe other version to compare to
Returns
True if _other version is newer

◆ operator<=()

bool operator<= ( const SemanticVersion _other) const

Less than or equal comparison operator.

Parameters
[in]_otherThe other version to compare to
Returns
True if _other version is older or equal

◆ operator=()

SemanticVersion& operator= ( const SemanticVersion _other)

Assignment operator.

Parameters
[in]_otherThe version to assign from.
Returns
The reference to this instance

◆ operator==()

bool operator== ( const SemanticVersion _other) const

Equality comparison operator.

Parameters
[in]_otherThe other version to compare to
Returns
True if _other version is the same

◆ operator>()

bool operator> ( const SemanticVersion _other) const

Greater than comparison operator.

Parameters
[in]_otherThe other version to compare to
Returns
True if _other version is older

◆ operator>=()

bool operator>= ( const SemanticVersion _other) const

Greater than or equal comparison operator.

Parameters
[in]_otherThe other version to compare to
Returns
True if _other version is newer or the same

◆ Parse()

bool Parse ( const std::string &  _versionStr)

Parse a version string and set the major, minor, patch numbers, and prerelease and build strings.

Parameters
[in]_versionStrThe version string, such as "1.2.3-pr+123" True on success.

◆ Patch()

unsigned int Patch ( ) const

Get the patch number.

Returns
The patch number

◆ Prerelease()

std::string Prerelease ( ) const

Get the prerelease string.

Returns
Prelrease string, empty if a prerelease string was not specified.

◆ replaceAll() [1/2]

void gazebo::common::replaceAll ( std::string &  _result,
const std::string &  _orig,
const std::string &  _key,
const std::string &  _replacement 
)

Replace all occurances of _key with _replacement.

Parameters
[out]_resultThe new string that has had _key replaced with _replacement.
[in]_origOriginal string.
[in]_keyString to replace.
[in]_replacementThe string that replaces _key.
See also
std::string replaceAll(const std::string &_orig, const std::string &_key, const std::string &_replacement)

◆ replaceAll() [2/2]

std::string gazebo::common::replaceAll ( const std::string &  _orig,
const std::string &  _key,
const std::string &  _replacement 
)

Replace all occurances of _key with _replacement.

Parameters
[in]_origOriginal string.
[in]_keyString to replace.
[in]_replacementThe string that replaces _key.
Returns
The new string that has had _key replaced with _replacement.
See also
void common::replaceAll(std::string &_result, const std::string &_orig, const std::string &_key, const std::string &_replacement)

◆ Servers()

std::vector<ignition::fuel_tools::ServerConfig> Servers ( ) const

Get all the Ignition Fuel servers.

Returns
A collection of Ignition Fuel servers.

◆ SetWindowSize()

void SetWindowSize ( unsigned int  _n)

Set window size.

Parameters
[in]_nnew desired window size

References MovingWindowFilter< T >::dataPtr.

◆ split()

std::vector<std::string> gazebo::common::split ( const std::string &  _str,
const std::string &  _delim 
)

Splits a string into tokens.

Parameters
[in]_strInput string.
[in]_delimToken delimiter.
Returns
Vector of tokens.

◆ Start()

void Start ( bool  _fetchImmediately = false)

Start the model database.

Parameters
[in]_fetchImmediatelyTrue to fetch the models without waiting.

◆ unique_file_path()

std::string gazebo::common::unique_file_path ( const std::string &  _pathAndName,
const std::string &  _extension 
)

Generates a path for a file which doesn't collide with existing files, by appending numbers to it (i.e.

(0), (1), ...)

Parameters
[in]_pathAndNameFull absolute path and file name up to the file extension.
[in]_extensionFile extension, such as "pdf".
Returns
Full path with name and extension, which doesn't collide with existing files

◆ Update()

void Update ( _val)

Update value of filter.

Parameters
[in]_valnew raw value

References MovingWindowFilter< T >::dataPtr.

◆ Version()

std::string Version ( ) const

Returns the version as a string.

Returns
The semantic version string

◆ weakBind()

auto gazebo::common::weakBind ( Func  _func,
boost::shared_ptr< T >  _ptr,
Args...  _args 
) -> decltype(details::makeWeakBinder( boost::bind(_func, _ptr.get(), _args...), boost::weak_ptr<T>(_ptr)))

Variable Documentation

◆ PixelFormatNames

std::string PixelFormatNames[]
static
Initial value:
=
{
"UNKNOWN_PIXEL_FORMAT",
"L_INT8",
"L_INT16",
"RGB_INT8",
"RGBA_INT8",
"BGRA_INT8",
"RGB_INT16",
"RGB_INT32",
"BGR_INT8",
"BGR_INT16",
"BGR_INT32",
"R_FLOAT16",
"RGB_FLOAT16",
"R_FLOAT32",
"RGB_FLOAT32",
"BAYER_RGGB8",
"BAYER_RGGR8",
"BAYER_GBRG8",
"BAYER_GRBG8"
}

String names for the pixel formats.

See also
Image::PixelFormat.

Friends

◆ operator<<

std::ostream& operator<< ( std::ostream &  _out,
const SemanticVersion _v 
)
friend

Stream insertion operator.

Parameters
_outoutput stream
_vSemantic version to output
Returns
the stream