Ignition Gazebo

API Reference

Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
20 #include <string>
21 #include <vector>
23 #include <ignition/math/Pose3.hh>
24 #include "ignition/gazebo/config.hh"
27 #include "ignition/gazebo/Export.hh"
28 #include "ignition/gazebo/Types.hh"
30 namespace ignition
31 {
32  namespace gazebo
33  {
34  // Inline bracket to help doxygen filtering.
36  //
41  math::Pose3d IGNITION_GAZEBO_VISIBLE worldPose(const Entity &_entity,
42  const EntityComponentManager &_ecm);
50  std::string IGNITION_GAZEBO_VISIBLE scopedName(const Entity &_entity,
51  const EntityComponentManager &_ecm, const std::string &_delim = "/",
52  bool _includePrefix = true);
74  ComponentTypeId IGNITION_GAZEBO_VISIBLE entityTypeId(const Entity &_entity,
75  const EntityComponentManager &_ecm);
94  std::string IGNITION_GAZEBO_VISIBLE entityTypeStr(const Entity &_entity,
95  const EntityComponentManager &_ecm);
101  Entity IGNITION_GAZEBO_VISIBLE worldEntity(const Entity &_entity,
102  const EntityComponentManager &_ecm);
109  std::string IGNITION_GAZEBO_VISIBLE removeParentScope(
110  const std::string &_name, const std::string &_delim);
120  std::string IGNITION_GAZEBO_VISIBLE asFullPath(const std::string &_uri,
121  const std::string &_filePath);
125  std::vector<std::string> IGNITION_GAZEBO_VISIBLE resourcePaths();
131  void IGNITION_GAZEBO_VISIBLE addResourcePaths(
132  const std::vector<std::string> &_paths = {});
139  ignition::gazebo::Entity IGNITION_GAZEBO_VISIBLE topLevelModel(
140  const Entity &_entity,
141  const EntityComponentManager &_ecm);
155  std::string IGNITION_GAZEBO_VISIBLE validTopic(
156  const std::vector<std::string> &_topics);
173  std::string IGNITION_GAZEBO_VISIBLE topicFromScopedName(
174  const Entity &_entity,
175  const EntityComponentManager &_ecm,
176  bool _excludeWorld = true);
179  const std::string kResourcePathEnv{"IGN_GAZEBO_RESOURCE_PATH"};
183  const std::string kSdfPathEnv{"SDF_PATH"};
186  const std::string kServerConfigPathEnv{"IGN_GAZEBO_SERVER_CONFIG_PATH"};
190  const std::string kRenderPluginPathEnv{"IGN_GAZEBO_RENDER_ENGINE_PATH"};
192  }
193  }
194 }
195 #endif
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 ...
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...
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::vector< std::string > resourcePaths()
Get resource paths based on latest environment variables.
const std::string kRenderPluginPathEnv
Environment variable holding paths to custom rendering engine plugins.
Definition: Util.hh:190
ComponentTypeId entityTypeId(const Entity &_entity, const EntityComponentManager &_ecm)
Generally, each entity will be of some specific high-level type, such as World, Sensor, Collision, etc, and one type only. The entity type is usually marked by having some component that represents that type, such as components::Visual.
const std::string kServerConfigPathEnv
Environment variable holding server config paths.
Definition: Util.hh:186
STL class.
std::string entityTypeStr(const Entity &_entity, const EntityComponentManager &_ecm)
Generally, each entity will be of some specific high-level type, such as "world", "sensor"...
Pose3< double > Pose3d
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.
uint64_t ComponentTypeId
A unique identifier for a component type. A component type must be derived from components::BaseCompo...
Definition: Types.hh:86
STL class.
Entity worldEntity(const Entity &_entity, const EntityComponentManager &_ecm)
Get the world to which the given entity belongs.
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...
Entity topLevelModel(const Entity &_entity, const EntityComponentManager &_ecm)
Get the top level model of an entity.
const std::string kResourcePathEnv
Environment variable holding resource paths.
Definition: Util.hh:179
const std::string kSdfPathEnv
Environment variable used by SDFormat to find URIs inside <include>
Definition: Util.hh:183
This library is part of the Ignition Robotics project.
uint64_t Entity
An Entity identifies a single object in simulation such as a model, link, or light. At its core, an Entity is just an identifier.
Definition: Entity.hh:59
void addResourcePaths(const std::vector< std::string > &_paths={})
Add resource paths based on latest environment variables. This will update the SDF and Ignition envir...