#include <World.hh>
Public Member Functions | |
World () | |
Default constructor. | |
const Actor * | ActorByIndex (const uint64_t _index) const |
Get an actor based on an index. | |
Actor * | ActorByIndex (uint64_t _index) |
Get a mutable actor based on an index. | |
Actor * | ActorByName (const std::string &_name) |
Get a mutable actor based on a name. | |
const Actor * | ActorByName (const std::string &_name) const |
Get an actor based on a name. | |
uint64_t | ActorCount () const |
Get the number of actors. | |
bool | ActorNameExists (const std::string &_name) const |
Get whether an actor name exists. | |
bool | AddActor (const Actor &_actor) |
Add an actor to the world. | |
bool | AddFrame (const Frame &_frame) |
Add a frame object to the world. | |
bool | AddJoint (const Joint &_joint) |
Add a joint to the world. | |
bool | AddLight (const Light &_light) |
Add a light to the world. | |
bool | AddModel (const Model &_model) |
Add a model to the world. | |
bool | AddPhysics (const Physics &_physics) |
Add a physics object to the world. | |
void | AddPlugin (const Plugin &_plugin) |
Add a plugin to this object. | |
const sdf::Atmosphere * | Atmosphere () const |
Get a pointer to the atmosphere model associated with this world. | |
std::string | AudioDevice () const |
Get the audio device name. | |
void | ClearActors () |
Remove all actors. | |
void | ClearFrames () |
Remove all frames. | |
void | ClearJoints () |
Remove all joints. | |
void | ClearLights () |
Remove all lights. | |
void | ClearModels () |
Remove all models. | |
void | ClearPhysics () |
Remove all physics. | |
void | ClearPlugins () |
Remove all plugins. | |
sdf::ElementPtr | Element () const |
Get a pointer to the SDF element that was used during load. | |
const Frame * | FrameByIndex (const uint64_t _index) const |
Get an immediate (not nested) child explicit frame based on an index. | |
Frame * | FrameByIndex (uint64_t _index) |
Get a mutable immediate (not nested) child explicit frame based on an index. | |
Frame * | FrameByName (const std::string &_name) |
Get a mutable explicit frame based on a name. | |
const Frame * | FrameByName (const std::string &_name) const |
Get an explicit frame based on a name. | |
uint64_t | FrameCount () const |
Get the number of explicit frames that are immediate (not nested) children of this World object. | |
bool | FrameNameExists (const std::string &_name) const |
Get whether an explicit frame name exists. | |
gz::math::Vector3d | Gravity () const |
Get the acceleration due to gravity. | |
const sdf::Gui * | Gui () const |
Get a pointer to the Gui associated with this world. | |
std::shared_ptr< const InterfaceModel > | InterfaceModelByIndex (const uint64_t _index) const |
Get an immediate (not recursively nested) child interface model based on an index. | |
uint64_t | InterfaceModelCount () const |
Get the number of nested interface models that are immediate (not recursively nested) children of this World object. | |
const NestedInclude * | InterfaceModelNestedIncludeByIndex (const uint64_t _index) const |
Get the nested include information of an immediate (not recursively nested) child interface model based on an index. | |
Joint * | JointByIndex (uint64_t _index) |
Get a mutable joint based on an index. | |
const Joint * | JointByIndex (uint64_t _index) const |
Get a joint based on an index. | |
Joint * | JointByName (const std::string &_name) |
Get a mutable joint based on a name. | |
const Joint * | JointByName (const std::string &_name) const |
Get an joint based on a name. | |
uint64_t | JointCount () const |
Get the number of joints. | |
bool | JointNameExists (const std::string &_name) const |
Get whether a joint name exists. | |
const Light * | LightByIndex (const uint64_t _index) const |
Get a light based on an index. | |
Light * | LightByIndex (uint64_t _index) |
Get a mutable light based on an index. | |
uint64_t | LightCount () const |
Get the number of lights. | |
bool | LightNameExists (const std::string &_name) const |
Get whether a light name exists. | |
Errors | Load (ElementPtr _sdf) |
Load the world based on a element pointer. | |
Errors | Load (sdf::ElementPtr _sdf, const ParserConfig &_config) |
Load the world based on a element pointer. | |
gz::math::Vector3d | MagneticField () const |
Get the magnetic vector in Tesla, expressed in a coordinate frame defined by the SphericalCoordinates property. | |
const Model * | ModelByIndex (const uint64_t _index) const |
Get an immediate (not recursively nested) child model based on an index. | |
Model * | ModelByIndex (uint64_t _index) |
Get an immediate (not recursively nested) mutable child model based on an index. | |
Model * | ModelByName (const std::string &_name) |
Get a mutable model based on a name. | |
const Model * | ModelByName (const std::string &_name) const |
Get a model based on a name. | |
uint64_t | ModelCount () const |
Get the number of models that are immediate (not nested) children of this World object. | |
bool | ModelNameExists (const std::string &_name) const |
Get whether a model name exists. | |
std::string | Name () const |
Get the name of the world. | |
bool | NameExistsInFrameAttachedToGraph (const std::string &_name) const |
Check if a given name exists in the FrameAttachedTo graph at the scope of the world. | |
const Physics * | PhysicsByIndex (const uint64_t _index) const |
Get a physics profile based on an index. | |
Physics * | PhysicsByIndex (uint64_t _index) |
Get a mutable physics profile based on an index. | |
uint64_t | PhysicsCount () const |
Get the number of physics profiles. | |
const Physics * | PhysicsDefault () const |
Get the default physics profile. | |
bool | PhysicsNameExists (const std::string &_name) const |
Get whether a physics profile name exists. | |
sdf::Plugins & | Plugins () |
Get a mutable vector of plugins attached to this object. | |
const sdf::Plugins & | Plugins () const |
Get the plugins attached to this object. | |
void | ResolveAutoInertials (sdf::Errors &_errors, const ParserConfig &_config) |
Calculate and set the inertials for all the models in the world object. | |
const sdf::Scene * | Scene () const |
Get a pointer to the Scene associated with this world. | |
void | SetAtmosphere (const sdf::Atmosphere &_atmosphere) |
Set the atmosphere model associated with this world. | |
void | SetAudioDevice (const std::string &_device) |
Set the audio device name. | |
void | SetGravity (const gz::math::Vector3d &_gravity) |
Set the acceleration due to gravity. | |
void | SetGui (const sdf::Gui &_gui) |
Set the Gui parameters associated with this world. | |
void | SetMagneticField (const gz::math::Vector3d &_mag) |
Set the magnetic vector in Tesla, expressed in a coordinate frame defined by the SphericalCoordinate. | |
void | SetName (const std::string &_name) |
Set the name of the world. | |
void | SetScene (const sdf::Scene &_scene) |
Set the Scene parameters associated with this world. | |
void | SetSphericalCoordinates (const gz::math::SphericalCoordinates &_coord) |
Set the spherical coordinates for the world origin. | |
void | SetWindLinearVelocity (const gz::math::Vector3d &_wind) |
Set the wind linear velocity in the global/world coordinate frame. | |
const gz::math::SphericalCoordinates * | SphericalCoordinates () const |
Get the spherical coordinates for the world origin. | |
sdf::ElementPtr | ToElement (const OutputConfig &_config=OutputConfig::GlobalConfig()) const |
Create and return an SDF element filled with data from this world. | |
Errors | ValidateGraphs () const |
Check that the FrameAttachedToGraph and PoseRelativeToGraph are valid. | |
gz::math::Vector3d | WindLinearVelocity () const |
Get the wind linear velocity in the global/world coordinate frame. | |
sdf::SDF_VERSION_NAMESPACE::World::World | ( | ) |
Default constructor.
const Actor * sdf::SDF_VERSION_NAMESPACE::World::ActorByIndex | ( | const uint64_t | _index | ) | const |
Get an actor based on an index.
[in] | _index | Index of the actor. The index should be in the range [0..ActorCount()). |
Actor * sdf::SDF_VERSION_NAMESPACE::World::ActorByIndex | ( | uint64_t | _index | ) |
Get a mutable actor based on an index.
[in] | _index | Index of the actor. The index should be in the range [0..ActorCount()). |
Actor * sdf::SDF_VERSION_NAMESPACE::World::ActorByName | ( | const std::string & | _name | ) |
Get a mutable actor based on a name.
[in] | _name | Name of the actor. |
const Actor * sdf::SDF_VERSION_NAMESPACE::World::ActorByName | ( | const std::string & | _name | ) | const |
Get an actor based on a name.
[in] | _name | Name of the actor. |
uint64_t sdf::SDF_VERSION_NAMESPACE::World::ActorCount | ( | ) | const |
Get the number of actors.
bool sdf::SDF_VERSION_NAMESPACE::World::ActorNameExists | ( | const std::string & | _name | ) | const |
Get whether an actor name exists.
[in] | _name | Name of the actor to check. |
bool sdf::SDF_VERSION_NAMESPACE::World::AddActor | ( | const Actor & | _actor | ) |
Add an actor to the world.
[in] | _actor | Actor to add. |
bool sdf::SDF_VERSION_NAMESPACE::World::AddFrame | ( | const Frame & | _frame | ) |
Add a frame object to the world.
[in] | _frame | Frame to add. |
bool sdf::SDF_VERSION_NAMESPACE::World::AddJoint | ( | const Joint & | _joint | ) |
Add a joint to the world.
[in] | _joint | Joint to add. |
bool sdf::SDF_VERSION_NAMESPACE::World::AddLight | ( | const Light & | _light | ) |
Add a light to the world.
[in] | _light | Light to add. |
bool sdf::SDF_VERSION_NAMESPACE::World::AddModel | ( | const Model & | _model | ) |
Add a model to the world.
[in] | _model | Model to add. |
bool sdf::SDF_VERSION_NAMESPACE::World::AddPhysics | ( | const Physics & | _physics | ) |
Add a physics object to the world.
[in] | _physics | Physics to add. |
void sdf::SDF_VERSION_NAMESPACE::World::AddPlugin | ( | const Plugin & | _plugin | ) |
Add a plugin to this object.
[in] | _plugin | Plugin to add. |
const sdf::Atmosphere * sdf::SDF_VERSION_NAMESPACE::World::Atmosphere | ( | ) | const |
Get a pointer to the atmosphere model associated with this world.
A nullptr indicates that an atmosphere model has not been set.
std::string sdf::SDF_VERSION_NAMESPACE::World::AudioDevice | ( | ) | const |
Get the audio device name.
The audio device can be used to playback audio files. A value of "default" or an empty string indicates that the system's default audio device should be used.
void sdf::SDF_VERSION_NAMESPACE::World::ClearActors | ( | ) |
Remove all actors.
void sdf::SDF_VERSION_NAMESPACE::World::ClearFrames | ( | ) |
Remove all frames.
void sdf::SDF_VERSION_NAMESPACE::World::ClearJoints | ( | ) |
Remove all joints.
void sdf::SDF_VERSION_NAMESPACE::World::ClearLights | ( | ) |
Remove all lights.
void sdf::SDF_VERSION_NAMESPACE::World::ClearModels | ( | ) |
Remove all models.
void sdf::SDF_VERSION_NAMESPACE::World::ClearPhysics | ( | ) |
Remove all physics.
void sdf::SDF_VERSION_NAMESPACE::World::ClearPlugins | ( | ) |
Remove all plugins.
sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::World::Element | ( | ) | const |
const Frame * sdf::SDF_VERSION_NAMESPACE::World::FrameByIndex | ( | const uint64_t | _index | ) | const |
Get an immediate (not nested) child explicit frame based on an index.
[in] | _index | Index of the explicit frame. The index should be in the range [0..FrameCount()). |
Frame * sdf::SDF_VERSION_NAMESPACE::World::FrameByIndex | ( | uint64_t | _index | ) |
Get a mutable immediate (not nested) child explicit frame based on an index.
[in] | _index | Index of the explicit frame. The index should be in the range [0..FrameCount()). |
Frame * sdf::SDF_VERSION_NAMESPACE::World::FrameByName | ( | const std::string & | _name | ) |
Get a mutable explicit frame based on a name.
[in] | _name | Name of the explicit frame. To get a frame in a nested model, prefix the frame name with the sequence of nested models containing this frame, delimited by "::". |
const Frame * sdf::SDF_VERSION_NAMESPACE::World::FrameByName | ( | const std::string & | _name | ) | const |
Get an explicit frame based on a name.
[in] | _name | Name of the explicit frame. To get a frame in a nested model, prefix the frame name with the sequence of nested models containing this frame, delimited by "::". |
uint64_t sdf::SDF_VERSION_NAMESPACE::World::FrameCount | ( | ) | const |
Get the number of explicit frames that are immediate (not nested) children of this World object.
bool sdf::SDF_VERSION_NAMESPACE::World::FrameNameExists | ( | const std::string & | _name | ) | const |
Get whether an explicit frame name exists.
[in] | _name | Name of the explicit frame to check. To check for a frame in a nested model, prefix the frame name with the sequence of nested models containing this frame, delimited by "::". |
gz::math::Vector3d sdf::SDF_VERSION_NAMESPACE::World::Gravity | ( | ) | const |
Get the acceleration due to gravity.
The default value is Earth's standard gravity at sea level, which equals [0, 0, -9.80665] \((\frac{m}{s^2})\)
const sdf::Gui * sdf::SDF_VERSION_NAMESPACE::World::Gui | ( | ) | const |
std::shared_ptr< const InterfaceModel > sdf::SDF_VERSION_NAMESPACE::World::InterfaceModelByIndex | ( | const uint64_t | _index | ) | const |
Get an immediate (not recursively nested) child interface model based on an index.
[in] | _index | Index of the nested interface model. The index should be in the range [0..InterfaceModelCount()). |
uint64_t sdf::SDF_VERSION_NAMESPACE::World::InterfaceModelCount | ( | ) | const |
const NestedInclude * sdf::SDF_VERSION_NAMESPACE::World::InterfaceModelNestedIncludeByIndex | ( | const uint64_t | _index | ) | const |
Get the nested include information of an immediate (not recursively nested) child interface model based on an index.
[in] | _index | Index of the nested interface model. The index should be in the range [0..InterfaceModelCount()). |
Joint * sdf::SDF_VERSION_NAMESPACE::World::JointByIndex | ( | uint64_t | _index | ) |
Get a mutable joint based on an index.
[in] | _index | Index of the joint. The index should be in the range [0..JointCount()). |
const Joint * sdf::SDF_VERSION_NAMESPACE::World::JointByIndex | ( | uint64_t | _index | ) | const |
Get a joint based on an index.
[in] | _index | Index of the joint. The index should be in the range [0..JointCount()). |
Joint * sdf::SDF_VERSION_NAMESPACE::World::JointByName | ( | const std::string & | _name | ) |
Get a mutable joint based on a name.
[in] | _name | Name of the joint. To get a joint in a nested model, prefix the joint name with the sequence of nested models containing this joint, delimited by "::". |
const Joint * sdf::SDF_VERSION_NAMESPACE::World::JointByName | ( | const std::string & | _name | ) | const |
Get an joint based on a name.
[in] | _name | Name of the joint. To get a joint in a nested model, prefix the joint name with the sequence of nested models containing this joint, delimited by "::". |
uint64_t sdf::SDF_VERSION_NAMESPACE::World::JointCount | ( | ) | const |
Get the number of joints.
bool sdf::SDF_VERSION_NAMESPACE::World::JointNameExists | ( | const std::string & | _name | ) | const |
Get whether a joint name exists.
[in] | _name | Name of the joint to check. |
const Light * sdf::SDF_VERSION_NAMESPACE::World::LightByIndex | ( | const uint64_t | _index | ) | const |
Get a light based on an index.
[in] | _index | Index of the light. The index should be in the range [0..LightCount()). |
Light * sdf::SDF_VERSION_NAMESPACE::World::LightByIndex | ( | uint64_t | _index | ) |
Get a mutable light based on an index.
[in] | _index | Index of the light. The index should be in the range [0..LightCount()). |
uint64_t sdf::SDF_VERSION_NAMESPACE::World::LightCount | ( | ) | const |
Get the number of lights.
bool sdf::SDF_VERSION_NAMESPACE::World::LightNameExists | ( | const std::string & | _name | ) | const |
Get whether a light name exists.
[in] | _name | Name of the light to check. |
Errors sdf::SDF_VERSION_NAMESPACE::World::Load | ( | ElementPtr | _sdf | ) |
Errors sdf::SDF_VERSION_NAMESPACE::World::Load | ( | sdf::ElementPtr | _sdf, |
const ParserConfig & | _config | ||
) |
gz::math::Vector3d sdf::SDF_VERSION_NAMESPACE::World::MagneticField | ( | ) | const |
Get the magnetic vector in Tesla, expressed in a coordinate frame defined by the SphericalCoordinates property.
A spherical coordinate can be specified in SDF using the <spherical_coordinates> element.
const Model * sdf::SDF_VERSION_NAMESPACE::World::ModelByIndex | ( | const uint64_t | _index | ) | const |
Get an immediate (not recursively nested) child model based on an index.
[in] | _index | Index of the model. The index should be in the range [0..ModelCount()). |
Model * sdf::SDF_VERSION_NAMESPACE::World::ModelByIndex | ( | uint64_t | _index | ) |
Get an immediate (not recursively nested) mutable child model based on an index.
[in] | _index | Index of the model. The index should be in the range [0..ModelCount()). |
Model * sdf::SDF_VERSION_NAMESPACE::World::ModelByName | ( | const std::string & | _name | ) |
Get a mutable model based on a name.
[in] | _name | Name of the model. To get a model nested in other models, prefix the model name with the sequence of nested model names, delimited by "::". |
const Model * sdf::SDF_VERSION_NAMESPACE::World::ModelByName | ( | const std::string & | _name | ) | const |
Get a model based on a name.
[in] | _name | Name of the model. To get a model nested in other models, prefix the model name with the sequence of nested model names, delimited by "::". |
uint64_t sdf::SDF_VERSION_NAMESPACE::World::ModelCount | ( | ) | const |
Get the number of models that are immediate (not nested) children of this World object.
bool sdf::SDF_VERSION_NAMESPACE::World::ModelNameExists | ( | const std::string & | _name | ) | const |
Get whether a model name exists.
[in] | _name | Name of the model to check. To check for a model nested in other models, prefix the model name with the sequence of nested models containing this model, delimited by "::". |
std::string sdf::SDF_VERSION_NAMESPACE::World::Name | ( | ) | const |
Get the name of the world.
bool sdf::SDF_VERSION_NAMESPACE::World::NameExistsInFrameAttachedToGraph | ( | const std::string & | _name | ) | const |
Check if a given name exists in the FrameAttachedTo graph at the scope of the world.
[in] | _name | Name of the implicit or explicit frame to check. To check for a frame in a nested model, prefix the frame name with the sequence of nested models containing this frame, delimited by "::". |
const Physics * sdf::SDF_VERSION_NAMESPACE::World::PhysicsByIndex | ( | const uint64_t | _index | ) | const |
Get a physics profile based on an index.
[in] | _index | Index of the physics profile. The index should be in the range [0..PhysicsCount()). |
Physics * sdf::SDF_VERSION_NAMESPACE::World::PhysicsByIndex | ( | uint64_t | _index | ) |
Get a mutable physics profile based on an index.
[in] | _index | Index of the physics profile. The index should be in the range [0..PhysicsCount()). |
uint64_t sdf::SDF_VERSION_NAMESPACE::World::PhysicsCount | ( | ) | const |
Get the number of physics profiles.
const Physics * sdf::SDF_VERSION_NAMESPACE::World::PhysicsDefault | ( | ) | const |
Get the default physics profile.
bool sdf::SDF_VERSION_NAMESPACE::World::PhysicsNameExists | ( | const std::string & | _name | ) | const |
Get whether a physics profile name exists.
[in] | _name | Name of the physics profile to check. |
sdf::Plugins & sdf::SDF_VERSION_NAMESPACE::World::Plugins | ( | ) |
Get a mutable vector of plugins attached to this object.
const sdf::Plugins & sdf::SDF_VERSION_NAMESPACE::World::Plugins | ( | ) | const |
Get the plugins attached to this object.
void sdf::SDF_VERSION_NAMESPACE::World::ResolveAutoInertials | ( | sdf::Errors & | _errors, |
const ParserConfig & | _config | ||
) |
Calculate and set the inertials for all the models in the world object.
[out] | _errrors | A vector of Errors objects. Each errors contains an Error code and a message. An empty errors vector indicates no errors |
[in] | _config | Custom parser configuration |
const sdf::Scene * sdf::SDF_VERSION_NAMESPACE::World::Scene | ( | ) | const |
void sdf::SDF_VERSION_NAMESPACE::World::SetAtmosphere | ( | const sdf::Atmosphere & | _atmosphere | ) |
Set the atmosphere model associated with this world.
[in] | _atmosphere | The new atmosphere model for this world. |
void sdf::SDF_VERSION_NAMESPACE::World::SetAudioDevice | ( | const std::string & | _device | ) |
Set the audio device name.
See std::string AudioDevice() const for more information.
[in] | _device | The new audio device name. |
void sdf::SDF_VERSION_NAMESPACE::World::SetGravity | ( | const gz::math::Vector3d & | _gravity | ) |
Set the acceleration due to gravity.
Units are meters per second squared \((\frac{m}{s^2})\)
[in] | _gravity | The new gravity vector. |
void sdf::SDF_VERSION_NAMESPACE::World::SetGui | ( | const sdf::Gui & | _gui | ) |
void sdf::SDF_VERSION_NAMESPACE::World::SetMagneticField | ( | const gz::math::Vector3d & | _mag | ) |
Set the magnetic vector in Tesla, expressed in a coordinate frame defined by the SphericalCoordinate.
A spherical coordinate can be specified in SDF using the <spherical_coordinates> element.
[in] | _mag | The new magnetic field vector. |
void sdf::SDF_VERSION_NAMESPACE::World::SetName | ( | const std::string & | _name | ) |
Set the name of the world.
[in] | _name | Name of the world. |
void sdf::SDF_VERSION_NAMESPACE::World::SetScene | ( | const sdf::Scene & | _scene | ) |
void sdf::SDF_VERSION_NAMESPACE::World::SetSphericalCoordinates | ( | const gz::math::SphericalCoordinates & | _coord | ) |
Set the spherical coordinates for the world origin.
[in] | _coord | The new coordinates for the world origin. |
void sdf::SDF_VERSION_NAMESPACE::World::SetWindLinearVelocity | ( | const gz::math::Vector3d & | _wind | ) |
Set the wind linear velocity in the global/world coordinate frame.
Units are meters per second \((\frac{m}{s})\)
[in] | _wind | The new linear velocity of wind. |
const gz::math::SphericalCoordinates * sdf::SDF_VERSION_NAMESPACE::World::SphericalCoordinates | ( | ) | const |
Get the spherical coordinates for the world origin.
sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::World::ToElement | ( | const OutputConfig & | _config = OutputConfig::GlobalConfig() | ) | const |
Errors sdf::SDF_VERSION_NAMESPACE::World::ValidateGraphs | ( | ) | const |
gz::math::Vector3d sdf::SDF_VERSION_NAMESPACE::World::WindLinearVelocity | ( | ) | const |
Get the wind linear velocity in the global/world coordinate frame.
Units are meters per second \((\frac{m}{s})\)