Class to manage preset physics profiles.
More...
#include <gazebo/physics/PresetManager.hh>
Class to manage preset physics profiles.
gazebo::physics::PresetManager::PresetManager |
( |
PhysicsEnginePtr |
_physicsEngine, |
|
|
const sdf::ElementPtr |
_sdf |
|
) |
| |
Constructor.
- Parameters
-
[in] | _physicsEngine | Pointer to the world physics engine. |
[in] | _sdf | Pointer to the world SDF element. |
gazebo::physics::PresetManager::~PresetManager |
( |
| ) |
|
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] | _name | The 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] | _sdf | Pointer 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] | _name | The 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] | _name | The name of the profile to copy. |
[out] | _elem | The 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] | _key | The key of the accessed parameter. |
[out] | _value | The 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] | _name | The name of the accessed profile. |
[in] | _key | The key of the accessed parameter. |
[out] | _value | The 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] | _name | The 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] | _name | The 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] | _name | The name of the profile to set. |
[in] | _sdf | The 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] | _name | The 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] | _key | The key of the parameter to be set. |
[in] | _value | The 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] | _profileName | The name of the profile to change. |
[in] | _key | The key of the parameter to change. |
[in] | _value | The 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: