MultiRobotInfoDisplay.h
Go to the documentation of this file.
1 
5 #ifndef MULTI_ROBOT_INFO_DISPLAY_H
6 #define MULTI_ROBOT_INFO_DISPLAY_H
7 
8 #ifndef Q_MOC_RUN
10 #endif
11 
13 #include <geometry_msgs/PoseWithCovariance.h>
14 #include <memory>
15 #include <tuw_multi_robot_msgs/RobotInfo.h>
16 
17 namespace Ogre
18 {
19 class SceneNode;
20 }
21 
22 namespace rviz
23 {
24 class ColorProperty;
25 class FloatProperty;
26 class IntProperty;
27 }
28 
29 class QString;
30 
31 // All the source in this plugin is in its own namespace. This is not
32 // required but is good practice.
33 namespace tuw_multi_robot_rviz
34 {
35 
36 class MultiRobotInfoVisual;
37 
38 // Here we declare our new subclass of rviz::Display. Every display
39 // which can be listed in the "Displays" panel is a subclass of
40 // rviz::Display.
41 class MultiRobotInfoDisplay: public rviz::MessageFilterDisplay<tuw_multi_robot_msgs::RobotInfo>
42 {
43 Q_OBJECT
44 public:
45  // Constructor. pluginlib::ClassLoader creates instances by calling
46  // the default constructor, so make sure you have one.
48  virtual ~MultiRobotInfoDisplay();
49 
50  void callbackRobotInfo(const tuw_multi_robot_msgs::RobotInfoConstPtr &msg );
51  // Overrides of protected virtual functions from Display. As much
52  // as possible, when Displays are not enabled, they should not be
53  // subscribed to incoming data and should not show anything in the
54  // 3D view. These functions are where these connections are made
55  // and broken.
56 protected:
57  virtual void onInitialize();
58 
59  // A helper to clear this display back to the initial state.
60  virtual void reset();
61 
62 
63  // These Qt slots get connected to signals indicating changes in the user-editable properties.
64 private Q_SLOTS:
65  void updateScalePose();
66  void updateColorPose();
67  void updateBoolProperty();
68  void onKeepAliveChanged();
69  void onKeepMeasurementsChanged();
70 
71  // Function to handle an incoming ROS message.
72 private:
73  void processMessage(const tuw_multi_robot_msgs::RobotInfoConstPtr &msg );
74 
75  // Storage of the visual
76  std::shared_ptr<MultiRobotInfoVisual> visual_ = nullptr;
77 
78  // User-editable property variables.
79  std::shared_ptr<rviz::Property> robot_bool_properties_;
80  std::shared_ptr<rviz::IntProperty> keep_measurements_;
81  std::shared_ptr<rviz::IntProperty> keep_alive_;
82  std::shared_ptr<rviz::FloatProperty> property_scale_pose_;
83  std::shared_ptr<rviz::ColorProperty> property_color_pose_;
84  std::map<std::string, std::shared_ptr<rviz::BoolProperty>> bool_properties_;
87 };
88 
89 } // end namespace tuw_pose_rviz
90 
91 #endif // POSE_WITH_COVARIANCE_DISPLAY_H
92 // %EndTag(FULL_SOURCE)%
std::map< std::string, std::shared_ptr< rviz::BoolProperty > > bool_properties_
std::shared_ptr< rviz::IntProperty > keep_alive_
std::shared_ptr< rviz::ColorProperty > property_color_pose_
std::shared_ptr< rviz::IntProperty > keep_measurements_
std::shared_ptr< rviz::Property > robot_bool_properties_
std::shared_ptr< rviz::FloatProperty > property_scale_pose_


tuw_multi_robot_rviz
Author(s): Benjamin Binder
autogenerated on Mon Jun 10 2019 15:42:40