gz/sim/Util.hh
std::string validTopic(const std::vector< std::string > &_topics)
Helper function to generate a valid transport topic, given a list of topics ordered by preference....
const std::string kRenderPluginPathEnv
Environment variable holding paths to custom rendering engine plugins.
Definition: gz/sim/Util.hh:254
void addResourcePaths(const std::vector< std::string > &_paths={})
Add resource paths based on latest environment variables. This will update the SDF and Ignition envir...
uint64_t Entity
An Entity identifies a single object in simulation such as a model, link, or light....
Definition: gz/sim/Entity.hh:59
bool RemoveComponent(const Entity _entity, const ComponentKey &_key)
Remove a component from an entity based on a key.
This library is part of the Ignition Robotics project.
STL class.
The EntityComponentManager constructs, deletes, and returns components and entities....
Definition: gz/sim/EntityComponentManager.hh:65
bool enableComponent(EntityComponentManager &_ecm, Entity _entity, bool _enable=true)
Helper function to "enable" a component (i.e. create it if it doesn't exist) or "disable" a component...
Definition: gz/sim/Util.hh:203
Entity entityFromMsg(const EntityComponentManager &_ecm, const msgs::Entity &_msg)
Helper function to get an entity from an entity message. The returned entity is not guaranteed to exi...
std::string removeParentScope(const std::string &_name, const std::string &_delim)
Helper function to remove a parent scope from a given name. This removes the first name found before ...
STL class.
bool exists(const std::string &_path)
std::unordered_set< Entity > entitiesFromScopedName(const std::string &_scopedName, const EntityComponentManager &_ecm, Entity _relativeTo=kNullEntity, const std::string &_delim="::")
Helper function to get an entity given its scoped name. The scope may start at any level by default....
std::string asFullPath(const std::string &_uri, const std::string &_filePath)
Combine a URI and a file path into a full path. If the URI is already a full path or contains a schem...
Pose3< double > Pose3d
const std::string kServerConfigPathEnv
Environment variable holding server config paths.
Definition: gz/sim/Util.hh:250
std::vector< std::string > resourcePaths()
Get resource paths based on latest environment variables.
const Entity kNullEntity
Indicates a non-existant or invalid Entity.
Definition: gz/sim/Entity.hh:62
ComponentKey CreateComponent(const Entity _entity, const ComponentTypeT &_data)
Create a component of a particular type. This will copy the _data parameter.
ComponentTypeId entityTypeId(const Entity &_entity, const EntityComponentManager &_ecm)
Generally, each entity will be of some specific high-level type, such as World, Sensor,...
std::string scopedName(const Entity &_entity, const EntityComponentManager &_ecm, const std::string &_delim="/", bool _includePrefix=true)
Helper function to generate scoped name for an entity.
math::Pose3d worldPose(const Entity &_entity, const EntityComponentManager &_ecm)
Helper function to compute world pose of an entity.
const ComponentTypeT * Component(const Entity _entity) const
Get a component assigned to an entity based on a component type.
std::string entityTypeStr(const Entity &_entity, const EntityComponentManager &_ecm)
Generally, each entity will be of some specific high-level type, such as "world", "sensor",...
gz::sim::Entity topLevelModel(const Entity &_entity, const EntityComponentManager &_ecm)
Get the top level model of an entity.
Entity worldEntity(const Entity &_entity, const EntityComponentManager &_ecm)
Get the world to which the given entity belongs.
const std::string kResourcePathEnv
Environment variable holding resource paths.
Definition: gz/sim/Util.hh:243
const std::string kSdfPathEnv
Environment variable used by SDFormat to find URIs inside <include>
Definition: gz/sim/Util.hh:247
uint64_t ComponentTypeId
A unique identifier for a component type. A component type must be derived from components::BaseCompo...
Definition: include/gz/sim/Types.hh:87