17 #ifndef _MODEL_CREATOR_HH_
18 #define _MODEL_CREATOR_HH_
24 #include <boost/unordered/unordered_map.hpp>
81 public:
void SetModelName(
const std::string &_modelName);
85 public: std::string GetModelName()
const;
88 public:
void FinishModel();
94 public: std::string AddBox(
102 public: std::string AddSphere(
double _radius = 0.5,
110 public: std::string AddCylinder(
double _radius = 0.5,
118 public: std::string AddCustom(
const std::string &_name,
129 public:
void RemovePart(
const std::string &_partName);
133 public:
void SetStatic(
bool _static);
137 public:
void SetAutoDisable(
bool _auto);
141 public:
void SaveToSDF(
const std::string &_savePath);
144 public:
void Reset();
155 public:
void AddPart(PartType _type);
158 public:
void GenerateSDF();
185 private:
virtual void CreateTheEntity();
188 private:
bool Init();
192 private: std::string CreateModel();
196 private: std::string GetTemplateSDFString();
200 private slots:
void OnDelete(
const std::string &_name=
"");
203 Q_SIGNALS:
void PartAdded();
206 private: sdf::SDFPtr modelSDF;
209 private: sdf::SDFPtr modelTemplateSDF;
212 private: std::string modelName;
224 private:
bool isStatic;
227 private:
bool autoDisable;
230 private: std::vector<event::ConnectionPtr> connections;
233 private:
int boxCounter;
236 private:
int cylinderCounter;
239 private:
int sphereCounter;
242 private:
int customCounter;
245 private:
int modelCounter;
248 private: PartType addPartType;
251 private: boost::unordered_map<std::string, PartData *> allParts;
308 public: std::vector<rendering::VisualPtr>
visuals;
Box.
Definition: ModelCreator.hh:64
Generic description of a mouse event.
Definition: MouseEvent.hh:32
std::vector< physics::CollisionPtr > collisions
Name of part.
Definition: ModelCreator.hh:326
std::string topicName
Sensor topic name.
Definition: ModelCreator.hh:295
Encapsulates a position and rotation in three space.
Definition: Pose.hh:40
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:43
bool visualize
True to visualize sensor.
Definition: ModelCreator.hh:289
bool selfCollide
True to allow self collision.
Definition: ModelCreator.hh:314
Generic description of a keyboard event.
Definition: KeyEvent.hh:31
Forward declarations for transport.
math::Pose pose
Pose of part.
Definition: ModelCreator.hh:320
std::string type
Type of sensor.
Definition: ModelCreator.hh:283
bool kinematic
True to make part kinematic.
Definition: ModelCreator.hh:317
Sphere.
Definition: ModelCreator.hh:66
default namespace for gazebo
PartType
Definition: ModelCreator.hh:59
std::vector< rendering::VisualPtr > visuals
Visuals of the part.
Definition: ModelCreator.hh:308
static const Vector3 One
math::Vector3(1, 1, 1)
Definition: Vector3.hh:49
Create and manage 3D visuals of a model with parts and joints.
Definition: ModelCreator.hh:53
none
Definition: ModelCreator.hh:62
Joint visualization.
Definition: JointMaker.hh:46
math::Vector3 pose
Pose of sensor.
Definition: ModelCreator.hh:286
JointType
Definition: JointMaker.hh:52
A class for inertial information about a link.
Definition: Inertial.hh:39
bool alwaysOn
True to set sensor to be always on.
Definition: ModelCreator.hh:292
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:52
std::string name
Name of sensor.
Definition: ModelCreator.hh:280
std::string name
Name of part.
Definition: ModelCreator.hh:305
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
Helper class to store sensor data.
Definition: ModelCreator.hh:277
boost::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:100
static const Pose Zero
math::Pose(0, 0, 0, 0, 0, 0)
Definition: Pose.hh:43
physics::Inertial * inertial
Name of part.
Definition: ModelCreator.hh:323
Cylinder.
Definition: ModelCreator.hh:68
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:44
SensorData * sensorData
Sensor data.
Definition: ModelCreator.hh:329
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48
bool gravity
True to enable gravity on part.
Definition: ModelCreator.hh:311
Helper class to store part data.
Definition: ModelCreator.hh:300