18 #ifndef _GAZEBO_GUI_JOINTMAKER_HH_
19 #define _GAZEBO_GUI_JOINTMAKER_HH_
26 #include <ignition/math/Pose3.hh>
27 #include <ignition/math/Vector3.hh>
48 class recursive_mutex;
70 class JointMakerPrivate;
112 public:
void Reset();
115 public:
void EnableEventHandlers();
118 public:
void DisableEventHandlers();
122 public:
void AddJoint(
const std::string &_type);
126 public:
void AddJoint(
const JointType _type);
138 public: std::string CreateHotSpot(
JointData *_joint);
141 public:
void Update();
146 public:
void RemoveJoint(
const std::string &_jointName);
150 public:
void RemoveJointsByLink(
const std::string &_linkName);
156 public: std::vector<JointData *> JointDataByLink(
157 const std::string &_linkName)
const;
160 public:
void GenerateSDF();
164 public: sdf::ElementPtr SDF()
const;
169 public:
static unsigned int JointAxisCount(
175 public:
static std::string TypeAsString(
186 public:
static std::string JointMaterial(
const std::string &_type);
199 public:
unsigned int JointCount();
205 public:
void CreateJointFromSDF(sdf::ElementPtr _jointElem,
206 const std::string &_modelName =
"");
213 public:
void AddScopedLinkName(
const std::string &_name);
217 public slots:
void ShowJoints(
const bool _show);
222 public:
void SetSelected(
const std::string &_name,
const bool selected);
228 const bool selected);
232 public: std::map<std::string, std::string> LinkList()
const;
237 public slots:
void OnType(
const int _typeInt);
243 public slots:
void SetAxis(
const std::string &_axis,
244 const ignition::math::Vector3d &_value);
249 public:
void SetJointPose(
const ignition::math::Pose3d &_pose);
255 public:
void SetParentLink(
const std::string &_name);
261 public:
void SetChildLink(
const std::string &_name);
269 public:
void SetLinksRelativePose(
270 const ignition::math::Pose3d &_pose,
const bool _reset);
278 public:
void AlignLinks(
const bool _childToParent,
279 const std::string &_axis,
const std::string &_mode,
280 const bool _reverse);
283 public:
void FinalizeCreation();
313 private: ignition::math::Vector3d LinkWorldCentroid(
318 private:
void OpenInspector(
const std::string &_name);
323 private: std::string ScopedLinkName(
const std::string &_name);
327 private:
void ShowContextMenu(
const std::string &_joint);
330 private:
void DeselectAll();
335 private:
void OnSetSelectedEntity(
const std::string &_name,
336 const std::string &_mode);
342 private:
void OnSetSelectedJoint(
const std::string &_name,
343 const bool _selected);
347 private:
void OnLinkInserted(
const std::string &_linkName);
351 private:
void OnLinkRemoved(
const std::string &_linkName);
357 private:
JointData *CreateJointLine(
const std::string &_name,
364 const std::string &_name);
386 Q_SIGNALS:
void JointAdded();
390 Q_SIGNALS:
void EmitLinkInserted(
const std::string &_linkId);
394 Q_SIGNALS:
void EmitLinkRemoved(
const std::string &_linkId);
397 private slots:
void OnOpenInspector();
401 private slots:
void OnDelete();
404 public:
static std::map<JointMaker::JointType, std::string>
jointTypes;
410 public:
static std::map<JointMaker::JointType, std::string>
415 private: std::unique_ptr<JointMakerPrivate> dataPtr;
427 public:
void OpenInspector();
431 public:
void Update();
434 public:
void UpdateMsg();
476 public: std::vector<ignition::math::Vector3d>
axes;
488 private slots:
void OnOpenInspector();
492 private slots:
void OnApply();
Class for drawing lines that can change.
Definition: DynamicLines.hh:43
Generic description of a mouse event.
Definition: MouseEvent.hh:35
Ball joint.
Definition: JointMaker.hh:100
static std::map< JointMaker::JointType, std::string > jointMaterials
A map of joint type to its corresponding material.
Definition: JointMaker.hh:411
ignition::math::Pose3d childPose
Definition: JointMaker.hh:460
#define GZ_GUI_VISIBLE
Definition: system.hh:284
rendering::VisualPtr child
Child visual the joint is connected to.
Definition: JointMaker.hh:452
bool dirty
True if the joint needs update.
Definition: JointMaker.hh:479
GAZEBO_VISIBLE msgs::Joint::Type ConvertJointType(const std::string &_str)
Convert a string to a msgs::Joint::Type enum.
Generic description of a keyboard event.
Definition: KeyEvent.hh:32
Fixed joint.
Definition: JointMaker.hh:88
std::string name
Name of the joint.
Definition: JointMaker.hh:437
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:112
JointMaker::JointType type
Type of joint.
Definition: JointMaker.hh:473
static std::vector< ignition::math::Vector3d > unitVectors
Constant vector containing [UnitX, UnitY, UnitZ].
Definition: JointMaker.hh:407
JointInspector * inspector
Inspector for configuring joint properties.
Definition: JointMaker.hh:485
ignition::math::Pose3d parentPose
Definition: JointMaker.hh:456
rendering::VisualPtr parent
Parent visual the joint is connected to.
Definition: JointMaker.hh:449
Handles the creation of joints in the model editor.
Definition: JointMaker.hh:77
msgs::JointPtr jointMsg
Msg containing joint data.
Definition: JointMaker.hh:482
std::vector< ignition::math::Vector3d > axes
Last known axes values.
Definition: JointMaker.hh:476
JointType
Definition: JointMaker.hh:83
Ogre::BillboardSet * handles
Visual handle used to represent joint parent.
Definition: JointMaker.hh:470
Hinge2 joint.
Definition: JointMaker.hh:94
Screw joint.
Definition: JointMaker.hh:96
A class to inspect and modify joints.
Definition: JointInspector.hh:42
rendering::DynamicLines * line
Visual line used to represent joint connecting parent and child.
Definition: JointMaker.hh:467
static std::map< JointMaker::JointType, std::string > jointTypes
A map of joint type to its string value.
Definition: JointMaker.hh:404
Slider joint.
Definition: JointMaker.hh:90
boost::shared_ptr< Joint > JointPtr
Definition: PhysicsTypes.hh:108
rendering::JointVisualPtr jointVisual
Joint visual.
Definition: JointMaker.hh:443
std::shared_ptr< JointVisual > JointVisualPtr
Definition: RenderTypes.hh:140
rendering::VisualPtr visual
Visual of the dynamic line.
Definition: JointMaker.hh:440
ignition::math::Vector3d childScale
Definition: JointMaker.hh:464
Universal joint.
Definition: JointMaker.hh:98
Hinge joint.
Definition: JointMaker.hh:92
rendering::VisualPtr hotspot
Visual of the hotspot
Definition: JointMaker.hh:446
Helper class to store joint data.
Definition: JointMaker.hh:422
none
Definition: JointMaker.hh:86