Ignition Gazebo

API Reference

6.6.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>
27 #include <ignition/msgs/light.pb.h>
28 
29 #include "sdf/Physics.hh"
30 
31 #include <map>
32 #include <string>
33 #include <memory>
34 
35 namespace ignition {
36 
37 namespace gazebo {
38 
39 class PlotComponentPrivate;
40 
44 {
49  public: PlotComponent(const std::string &_type,
51  ComponentTypeId _typeId);
52 
54  public: ~PlotComponent();
55 
59  public: void RegisterChart(std::string _attribute, int _chart);
60 
64  public: void UnRegisterChart(std::string _attribute, int _chart);
65 
69  public: bool HasCharts();
70 
75  public: void SetAttributeValue(std::string _attribute, const double &_value);
76 
80  Data() const;
81 
85 
88  public: ComponentTypeId TypeId();
89 
92 };
93 
94 class PlottingPrivate;
95 
99 {
100  Q_OBJECT
102  public: Plotting();
103 
105  public: ~Plotting();
106 
107  // Documentation inherited
108  public: void LoadConfig(const tinyxml2::XMLElement *) override;
109 
110  // Documentation inherited
111  public: void Update(const ignition::gazebo::UpdateInfo &_info,
113 
117  public: void SetData(std::string _Id,
118  const ignition::math::Vector3d &_vector);
119 
123  public: void SetData(std::string _Id,
124  const msgs::Light &_light);
125 
129  public: void SetData(std::string _Id,
130  const ignition::math::Pose3d &_pose);
131 
136  public: void SetData(std::string _Id, const math::SphericalCoordinates &_sc);
137 
142  public: void SetData(std::string _Id, const sdf::Physics &_physics);
143 
148  public: void SetData(std::string _Id, const double &_value);
149 
157  public slots: void RegisterChartToComponent(uint64_t _entity,
158  uint64_t _typeId,
159  std::string _type,
160  std::string _attribute,
161  int _chart);
162 
169  public slots: void UnRegisterChartFromComponent(uint64_t _entity,
170  uint64_t _typeId,
171  std::string _attribute,
172  int _chart);
173 
177  public slots: std::string ComponentName(const uint64_t &_typeId);
178 
180  private: std::unique_ptr<PlottingPrivate> dataPtr;
181 };
182 }
183 }
184 
185 #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:43
Physics data plotting handler that keeps track of the registered components, update them and update t...
Definition: Plotting.hh:98
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: include/ignition/gazebo/Types.hh:38
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:66
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: include/ignition/gazebo/Types.hh:90
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.