|
| Root () |
| Default constructor. More...
|
|
const sdf::Actor * | Actor () const |
| Get a pointer to the actor object if it exists. More...
|
|
Errors | AddWorld (const World &_world) |
| Add a world to the root. More...
|
|
void | ClearWorlds () |
| Remove all worlds. More...
|
|
sdf::Root | Clone () const |
| Deep copy this Root object and return the new Root object. More...
|
|
sdf::ElementPtr | Element () const |
| Get a pointer to the SDF element that was generated during load. More...
|
|
const sdf::Light * | Light () const |
| Get a pointer to the light object if it exists. More...
|
|
Errors | Load (const SDFPtr _sdf) |
| Parse the given SDF pointer, and generate objects based on types specified in the SDF file. More...
|
|
Errors | Load (const SDFPtr _sdf, const ParserConfig &_config) |
| Parse the given SDF pointer, and generate objects based on types specified in the SDF file. More...
|
|
Errors | Load (const std::string &_filename) |
| Parse the given SDF file, and generate objects based on types specified in the SDF file. More...
|
|
Errors | Load (const std::string &_filename, const ParserConfig &_config) |
| Parse the given SDF file, and generate objects based on types specified in the SDF file. More...
|
|
Errors | LoadSdfString (const std::string &_sdf) |
| Parse the given SDF string, and generate objects based on types specified in the SDF file. More...
|
|
Errors | LoadSdfString (const std::string &_sdf, const ParserConfig &_config) |
| Parse the given SDF string, and generate objects based on types specified in the SDF file. More...
|
|
const sdf::Model * | Model () const |
| Get a pointer to the model object if it exists. More...
|
|
void | SetActor (const sdf::Actor &_actor) |
| Set the actor object. More...
|
|
void | SetLight (const sdf::Light &_light) |
| Set the light object. More...
|
|
void | SetModel (const sdf::Model &_model) |
| Set the model object. More...
|
|
void | SetVersion (const std::string &_version) |
| Set the SDF version string. More...
|
|
sdf::ElementPtr | ToElement (const OutputConfig &_config=OutputConfig::GlobalConfig()) const |
| Create and return an SDF element filled with data from this root. More...
|
|
Errors | UpdateGraphs () |
| Recreate the frame and pose graphs for the worlds and model that are children of this Root object. More...
|
|
std::string | Version () const |
| Get the SDF version specified in the parsed file or SDF pointer. More...
|
|
World * | WorldByIndex (const uint64_t _index) |
| Get a mutable world based on an index. More...
|
|
const World * | WorldByIndex (const uint64_t _index) const |
| Get a world based on an index. More...
|
|
World * | WorldByName (const std::string &_name) |
| Get a world based on a name. More...
|
|
const World * | WorldByName (const std::string &_name) const |
| Get a world based on a name. More...
|
|
uint64_t | WorldCount () const |
| Get the number of worlds. More...
|
|
bool | WorldNameExists (const std::string &_name) const |
| Get whether a world name exists. More...
|
|
Errors | WorldNamesFromFile (const std::string &_filename, std::vector< std::string > &_worldNames) |
| Get the name of the world without loading the entire world Users shouldn't normally need to use this API. More...
|
|
Root class that acts as an entry point to the SDF document model.
Multiple worlds can exist in a single SDF file. A user of multiple worlds could run parallel instances of simulation, or offer selection of a world at runtime.
Usage
In this example, a root object is loaded from a file specified in the first command line argument to a program.
if (errors.empty())
{
std::cerr << "Valid SDF file.\n";
return 0;
}
else
{
std::cerr << "Errors encountered: \n";
for (auto const &e : errors)
{
std::cout << e << std::endl;
}
}
Root class that acts as an entry point to the SDF document model.
Definition: Root.hh:58
Errors Load(const std::string &_filename)
Parse the given SDF file, and generate objects based on types specified in the SDF file.
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:80