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. Prefer using GZ_SIM_RENDER_ENG...
Definition: gz/sim/Util.hh:310
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:58
bool RemoveComponent(const Entity _entity, const ComponentKey &_key)
Remove a component from an entity based on a key.
This library is part of the Gazebo project.
STL class.
The EntityComponentManager constructs, deletes, and returns components and entities....
Definition: gz/sim/EntityComponentManager.hh:66
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:242
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::string topicFromScopedName(const Entity &_entity, const EntityComponentManager &_ecm, bool _excludeWorld=true)
Helper function that returns a valid Ignition Transport topic consisting of the scoped name for the p...
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...
const std::string kResourcePathEnvGzSim
Environment variable holding resource paths.
Definition: gz/sim/Util.hh:294
const std::string kRenderPluginPathEnvGzSim
Environment variable holding paths to custom rendering engine plugins.
Definition: gz/sim/Util.hh:313
Pose3< double > Pose3d
ComponentTypeT * CreateComponent(const Entity _entity, const ComponentTypeT &_data)
Create a component of a particular type. This will copy the _data parameter.
const std::string kServerConfigPathEnv
Environment variable holding server config paths. Prefer using GZ_SIM_SERVER_CONFIG_PATH for compatib...
Definition: gz/sim/Util.hh:303
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:61
ComponentTypeId entityTypeId(const Entity &_entity, const EntityComponentManager &_ecm)
Generally, each entity will be of some specific high-level type, such as World, Sensor,...
const std::string kServerConfigPathEnvGzSim
Environment variable holding server config paths.
Definition: gz/sim/Util.hh:305
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. Prefer using GZ_SIM_RESOURCE_PATH for compatibility with...
Definition: gz/sim/Util.hh:292
std::optional< math::Vector3d > sphericalCoordinates(Entity _entity, const EntityComponentManager &_ecm)
Get the spherical coordinates for an entity.
const std::string kSdfPathEnv
Environment variable used by SDFormat to find URIs inside <include>
Definition: gz/sim/Util.hh:298
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:90
std::string resolveSdfWorldFile(const std::string &_sdfFilename, const std::string &_fuelResourceCache="")
Convert an SDF world filename string, such as "shapes.sdf", to full system file path....