17 #ifndef GAZEBO_PHYSICS_POPULATION_HH_
18 #define GAZEBO_PHYSICS_POPULATION_HH_
22 #include <ignition/math/Pose3.hh>
23 #include <ignition/math/Vector3.hh>
24 #include <boost/shared_ptr.hpp>
25 #include <boost/scoped_ptr.hpp>
39 class PopulationPrivate;
45 public: ignition::math::Vector3d
size;
54 public: ignition::math::Vector3d
step;
57 public: ignition::math::Pose3d
pose;
90 public:
Population(sdf::ElementPtr _sdf, boost::shared_ptr<World> _world);
104 private:
bool PopulateOne(
const sdf::ElementPtr _population);
112 private:
template<
typename T>
bool ValueFromSdf(
113 const sdf::ElementPtr &_sdfElement,
const std::string &_element,
116 if (_sdfElement->HasElement(_element))
118 _value = _sdfElement->Get<T>(_element);
121 gzerr <<
"Unable to find <" << _element <<
"> inside the population tag"
132 private:
bool ElementFromSdf(
const sdf::ElementPtr &_sdfElement,
133 const std::string &_element, sdf::ElementPtr &_value);
143 private:
bool ParseSdf(sdf::ElementPtr _population,
144 PopulationParams &_params);
153 private:
void CreatePosesBoxRandom(
const PopulationParams &_populParams,
154 std::vector<ignition::math::Vector3d> &_poses);
164 private:
void CreatePosesBoxUniform(
const PopulationParams &_populParams,
165 std::vector<ignition::math::Vector3d> &_poses);
177 private:
void CreatePosesBoxGrid(
const PopulationParams &_populParams,
178 std::vector<ignition::math::Vector3d> &_poses);
187 private:
void CreatePosesBoxLinearX(
const PopulationParams &_populParams,
188 std::vector<ignition::math::Vector3d> &_poses);
197 private:
void CreatePosesBoxLinearY(
const PopulationParams &_populParams,
198 std::vector<ignition::math::Vector3d> &_poses);
207 private:
void CreatePosesBoxLinearZ(
const PopulationParams &_populParams,
208 std::vector<ignition::math::Vector3d> &_poses);
220 private:
void CreatePosesCylinderRandom(
221 const PopulationParams &_populParams,
222 std::vector<ignition::math::Vector3d> &_poses);
235 private:
void CreatePosesCylinderUniform(
236 const PopulationParams &_populParams,
237 std::vector<ignition::math::Vector3d> &_poses);
241 private: boost::scoped_ptr<PopulationPrivate> dataPtr;