Gazebo Gui

API Reference

6.8.0
NavSatMap.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 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 
18 #ifndef GZ_GUI_PLUGINS_IMAGEDISPLAY_HH_
19 #define GZ_GUI_PLUGINS_IMAGEDISPLAY_HH_
20 
21 #include <memory>
22 #ifdef _MSC_VER
23 #pragma warning(push, 0)
24 #endif
25 #include <gz/msgs/navsat.pb.h>
26 #ifdef _MSC_VER
27 #pragma warning(pop)
28 #endif
29 
30 #include "gz/gui/Plugin.hh"
31 
32 namespace ignition
33 {
34 namespace gui
35 {
36 namespace plugins
37 {
38  class NavSatMapPrivate;
39 
48  class NavSatMap : public Plugin
49  {
50  Q_OBJECT
51 
53  Q_PROPERTY(
55  READ TopicList
56  WRITE SetTopicList
57  NOTIFY TopicListChanged
58  )
59 
60 
61  public: NavSatMap();
62 
64  public: virtual ~NavSatMap();
65 
66  // Documentation inherited
67  public: virtual void LoadConfig(const tinyxml2::XMLElement *_pluginElem);
68 
70  public slots: void OnRefresh();
71 
73  public slots: void OnTopic(const QString _topic);
74 
77  public: Q_INVOKABLE QStringList TopicList() const;
78 
81  public: Q_INVOKABLE void SetTopicList(const QStringList &_topicList);
82 
84  signals: void TopicListChanged();
85 
89  signals: void newMessage(double _latitudeDeg, double _longitudeDeg);
90 
92  private slots: void ProcessMessage();
93 
96  private: void OnMessage(const gz::msgs::NavSat &_msg);
97 
100  private: std::unique_ptr<NavSatMapPrivate> dataPtr;
101  };
102 }
103 }
104 }
105 
106 #endif
void TopicListChanged()
Notify that topic list has changed.
Q_INVOKABLE QStringList TopicList() const
Get the list of topics publishing NavSat messages.
void newMessage(double _latitudeDeg, double _longitudeDeg)
Notify that a new message has been received.
Base class for Gazebo GUI plugins.
Definition: gz/gui/Plugin.hh:54
virtual void LoadConfig(const tinyxml2::XMLElement *_pluginElem)
Load the plugin with a configuration file. Override this on custom plugins to handle custom configura...
void OnRefresh()
Callback when refresh button is pressed.
QStringList topicList
Topic list.
Definition: NavSatMap.hh:58
STL namespace.
Definition: gz/gui/Application.hh:35
Q_INVOKABLE void SetTopicList(const QStringList &_topicList)
Set the topic list.
Display NavSat messages coming through a Gazebo Transport topic on top of a map.
Definition: NavSatMap.hh:48
void OnTopic(const QString _topic)
Callback when a new topic is chosen on the combo box.