Ignition Gazebo

API Reference

4.1.0
Plotting.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 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 */
17 #ifndef IGNITION_GUI_PLUGINS_PLOTTING_HH_
18 #define IGNITION_GUI_PLUGINS_PLOTTING_HH_
19 
20 #include <ignition/gui/qt.h>
21 #include <ignition/gui/Application.hh>
22 #include <ignition/gui/PlottingInterface.hh>
24 #include <ignition/math/Vector3.hh>
25 #include <ignition/math/Pose3.hh>
26 
27 #include <map>
28 #include <string>
29 #include <memory>
30 
31 namespace ignition {
32 
33 namespace gazebo {
34 
35 class PlotComponentPrivate;
36 
40 {
45  public: PlotComponent(const std::string &_type,
47  ComponentTypeId _typeId);
48 
50  public: ~PlotComponent();
51 
55  public: void RegisterChart(std::string _attribute, int _chart);
56 
60  public: void UnRegisterChart(std::string _attribute, int _chart);
61 
65  public: bool HasCharts();
66 
71  public: void SetAttributeValue(std::string _attribute, const double &_value);
72 
76  Data() const;
77 
81 
84  public: ComponentTypeId TypeId();
85 
88 };
89 
90 class PlottingPrivate;
91 
95 {
96  Q_OBJECT
98  public: Plotting();
99 
101  public: ~Plotting();
102 
103  // Documentation inherited
104  public: void LoadConfig(const tinyxml2::XMLElement *) override;
105 
106  // Documentation inherited
107  public: void Update(const ignition::gazebo::UpdateInfo &_info,
109 
113  public: void SetData(std::string _Id,
114  const ignition::math::Vector3d &_vector);
115 
119  public: void SetData(std::string _Id,
120  const ignition::math::Pose3d &_pose);
121 
126  public: void SetData(std::string _Id, const double &_value);
127 
135  public slots: void RegisterChartToComponent(uint64_t _entity,
136  uint64_t _typeId,
137  std::string _type,
138  std::string _attribute,
139  int _chart);
140 
147  public slots: void UnRegisterChartFromComponent(uint64_t _entity,
148  uint64_t _typeId,
149  std::string _attribute,
150  int _chart);
151 
155  public slots: std::string ComponentName(const uint64_t &_typeId);
156 
158  private: std::unique_ptr<PlottingPrivate> dataPtr;
159 };
160 }
161 }
162 
163 #endif
ComponentTypeId TypeId()
Get the Component type ID.
A container of the component data that keeps track of the registered attributes and update their valu...
Definition: Plotting.hh:39
Physics data plotting handler that keeps track of the registered components, update them and update t...
Definition: Plotting.hh:94
PlotComponent(const std::string &_type, Entity _entity, ComponentTypeId _typeId)
Constructor.
void RegisterChart(std::string _attribute, int _chart)
Add a registered chart to the attribute.
STL class.
Information passed to systems on the update callback.
Definition: Types.hh:36
void UnRegisterChart(std::string _attribute, int _chart)
Remove a registered chart from the attribute.
void SetAttributeValue(std::string _attribute, const double &_value)
Set a value of specefic component attribute.
STL class.
The EntityComponentManager constructs, deletes, and returns components and entities. A component can be of any class which inherits from components::BaseComponent.
Definition: EntityComponentManager.hh:64
std::map< std::string, std::shared_ptr< ignition::gui::PlotData > > Data() const
Get all attributes of the component.
uint64_t ComponentTypeId
A unique identifier for a component type. A component type must be derived from components::BaseCompo...
Definition: Types.hh:86
This library is part of the Ignition Robotics project.
bool HasCharts()
Check if any of the component attributes has any chart.
Base class for a GUI System.
Definition: GuiSystem.hh:44
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
Entity Entity()
Get the Component entity ID.