Ignition Gazebo

API Reference

5.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 #include <ignition/msgs/light.pb.h>
27 
28 #include "sdf/Physics.hh"
29 
30 #include <map>
31 #include <string>
32 #include <memory>
33 
34 namespace ignition {
35 
36 namespace gazebo {
37 
38 class PlotComponentPrivate;
39 
43 {
48  public: PlotComponent(const std::string &_type,
50  ComponentTypeId _typeId);
51 
53  public: ~PlotComponent();
54 
58  public: void RegisterChart(std::string _attribute, int _chart);
59 
63  public: void UnRegisterChart(std::string _attribute, int _chart);
64 
68  public: bool HasCharts();
69 
74  public: void SetAttributeValue(std::string _attribute, const double &_value);
75 
79  Data() const;
80 
84 
87  public: ComponentTypeId TypeId();
88 
91 };
92 
93 class PlottingPrivate;
94 
98 {
99  Q_OBJECT
101  public: Plotting();
102 
104  public: ~Plotting();
105 
106  // Documentation inherited
107  public: void LoadConfig(const tinyxml2::XMLElement *) override;
108 
109  // Documentation inherited
110  public: void Update(const ignition::gazebo::UpdateInfo &_info,
112 
116  public: void SetData(std::string _Id,
117  const ignition::math::Vector3d &_vector);
118 
122  public: void SetData(std::string _Id,
123  const msgs::Light &_light);
124 
128  public: void SetData(std::string _Id,
129  const ignition::math::Pose3d &_pose);
130 
135  public: void SetData(std::string _Id, const sdf::Physics &_physics);
136 
141  public: void SetData(std::string _Id, const double &_value);
142 
150  public slots: void RegisterChartToComponent(uint64_t _entity,
151  uint64_t _typeId,
152  std::string _type,
153  std::string _attribute,
154  int _chart);
155 
162  public slots: void UnRegisterChartFromComponent(uint64_t _entity,
163  uint64_t _typeId,
164  std::string _attribute,
165  int _chart);
166 
170  public slots: std::string ComponentName(const uint64_t &_typeId);
171 
173  private: std::unique_ptr<PlottingPrivate> dataPtr;
174 };
175 }
176 }
177 
178 #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:42
Physics data plotting handler that keeps track of the registered components, update them and update t...
Definition: Plotting.hh:97
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:65
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
Component< sdf::Physics, class PhysicsTag, serializers::PhysicsSerializer > Physics
A component type that contains the physics properties of the World entity.
Definition: include/ignition/gazebo/components/Physics.hh:50
Entity Entity()
Get the Component entity ID.