Public Member Functions | List of all members
gazebo::physics::PresetManager Class Reference

Class to manage preset physics profiles. More...

#include <gazebo/physics/PresetManager.hh>

Public Member Functions

 PresetManager (PhysicsEnginePtr _physicsEngine, const sdf::ElementPtr _sdf)
 Constructor. More...
 
 ~PresetManager ()
 Destructor. More...
 
std::vector< std::string > AllProfiles () const
 Get the name of all profiles. More...
 
bool CreateProfile (const std::string &_name)
 Create a new profile. More...
 
std::string CreateProfile (const sdf::ElementPtr _sdf)
 Create a new profile from SDF. More...
 
bool CurrentProfile (const std::string &_name)
 Set the current profile. More...
 
std::string CurrentProfile () const
 Get the name of the current profile. More...
 
void GenerateSDFFromPreset (const std::string &_name, sdf::ElementPtr &_elem) const
 Generate an SDF element from an Preset object. More...
 
bool GetCurrentProfileParam (const std::string &_key, boost::any &_value)
 Get a parameter for the current profile. More...
 
bool GetProfileParam (const std::string &_name, const std::string &_key, boost::any &_value) const
 Get a parameter for a certain profile. More...
 
bool HasProfile (const std::string &_name) const
 Determine if we have a profile. More...
 
sdf::ElementPtr ProfileSDF (const std::string &_name) const
 Get the SDF for a profile. More...
 
bool ProfileSDF (const std::string &_name, const sdf::ElementPtr _sdf)
 Set the SDF for a profile. More...
 
void RemoveProfile (const std::string &_name)
 Remove a profile. More...
 
bool SetCurrentProfileParam (const std::string &_key, const boost::any &_value)
 Set a parameter for the current profile. More...
 
bool SetProfileParam (const std::string &_profileName, const std::string &_key, const boost::any &_value)
 Set a parameter for a certain profile. More...
 

Detailed Description

Class to manage preset physics profiles.

Constructor & Destructor Documentation

gazebo::physics::PresetManager::PresetManager ( PhysicsEnginePtr  _physicsEngine,
const sdf::ElementPtr  _sdf 
)

Constructor.

Parameters
[in]_physicsEnginePointer to the world physics engine.
[in]_sdfPointer to the world SDF element.
gazebo::physics::PresetManager::~PresetManager ( )

Destructor.

Member Function Documentation

std::vector<std::string> gazebo::physics::PresetManager::AllProfiles ( ) const

Get the name of all profiles.

Returns
A vector containing all profile names.
bool gazebo::physics::PresetManager::CreateProfile ( const std::string &  _name)

Create a new profile.

A profile created in this way will store all of the current parameter values of the physics engine.

Parameters
[in]_nameThe name of the new profile.
Returns
True if the profile was successfully created.
std::string gazebo::physics::PresetManager::CreateProfile ( const sdf::ElementPtr  _sdf)

Create a new profile from SDF.

SDF determines the profile name

Parameters
[in]_sdfPointer to a physics SDF element.
Returns
The name of the new profile, read from SDF. If the profile was not successfully created, return the empty string, which is an invalid profile name.
bool gazebo::physics::PresetManager::CurrentProfile ( const std::string &  _name)

Set the current profile.

Parameters
[in]_nameThe name of the new current profile.
Returns
True if the profile switch was successful.
std::string gazebo::physics::PresetManager::CurrentProfile ( ) const

Get the name of the current profile.

Returns
The name of the current profile.
void gazebo::physics::PresetManager::GenerateSDFFromPreset ( const std::string &  _name,
sdf::ElementPtr &  _elem 
) const

Generate an SDF element from an Preset object.

Parameters
[in]_nameThe name of the profile to copy.
[out]_elemThe SDF physics element for the profile.
bool gazebo::physics::PresetManager::GetCurrentProfileParam ( const std::string &  _key,
boost::any &  _value 
)

Get a parameter for the current profile.

Parameters
[in]_keyThe key of the accessed parameter.
[out]_valueThe value of the accessed parameter.
Returns
True if the parameter existed in profile "_name".
bool gazebo::physics::PresetManager::GetProfileParam ( const std::string &  _name,
const std::string &  _key,
boost::any &  _value 
) const

Get a parameter for a certain profile.

Parameters
[in]_nameThe name of the accessed profile.
[in]_keyThe key of the accessed parameter.
[out]_valueThe value of the accessed parameter.
Returns
True if the parameter existed in profile "_name".
bool gazebo::physics::PresetManager::HasProfile ( const std::string &  _name) const

Determine if we have a profile.

Parameters
[in]_nameThe name of the profile to find.
Returns
True if we have the profile, false otherwise
sdf::ElementPtr gazebo::physics::PresetManager::ProfileSDF ( const std::string &  _name) const

Get the SDF for a profile.

Parameters
[in]_nameThe name of the profile to be accessed.
Returns
Pointer to the SDF physics element representing the profile. Can be NULL if no profile was found.
bool gazebo::physics::PresetManager::ProfileSDF ( const std::string &  _name,
const sdf::ElementPtr  _sdf 
)

Set the SDF for a profile.

Parameters
[in]_nameThe name of the profile to set.
[in]_sdfThe new SDF physics element for the profile.
Returns
True if setting the new SDF element was successful.
void gazebo::physics::PresetManager::RemoveProfile ( const std::string &  _name)

Remove a profile.

Parameters
[in]_nameThe name of the profile to remove.
bool gazebo::physics::PresetManager::SetCurrentProfileParam ( const std::string &  _key,
const boost::any &  _value 
)

Set a parameter for the current profile.

Parameters
[in]_keyThe key of the parameter to be set.
[in]_valueThe value of the parameter to be set.
Returns
True if setting the parameter was successful.
bool gazebo::physics::PresetManager::SetProfileParam ( const std::string &  _profileName,
const std::string &  _key,
const boost::any &  _value 
)

Set a parameter for a certain profile.

Parameters
[in]_profileNameThe name of the profile to change.
[in]_keyThe key of the parameter to change.
[in]_valueThe value of the parameter to change.
Returns
True if setting the parameter was successful.

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