trianglemesh_display.h
Go to the documentation of this file.
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Robot Operating System code by the University of Osnabrück
5  * Copyright (c) 2015, University of Osnabrück
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * 1. Redistributions of source code must retain the above
13  * copyright notice, this list of conditions and the following
14  * disclaimer.
15  *
16  * 2. Redistributions in binary form must reproduce the above
17  * copyright notice, this list of conditions and the following
18  * disclaimer in the documentation and/or other materials provided
19  * with the distribution.
20  *
21  * 3. Neither the name of the copyright holder nor the names of its
22  * contributors may be used to endorse or promote products derived
23  * from this software without specific prior written permission.
24  *
25  *
26  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
30  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
33  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
34  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
35  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
36  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37  *
38  *
39  *
40  * trianglemesh_display.h
41  *
42  *
43  * authors:
44  *
45  * Sebastian Pütz <spuetz@uni-osnabrueck.de>
46  * Henning Deeken <hdeeken@uni-osnabrueck.de>
47  * Marcel Mrozinski
48  * Nils Oesting
49  */
50 
51 #ifndef TRIANGLEMESH_DISPLAY_H
52 #define TRIANGLEMESH_DISPLAY_H
53 
54 #include <rviz/display.h>
55 
56 #ifndef Q_MOC_RUN
59 #include <message_filters/cache.h>
60 #include <tf2_ros/message_filter.h>
61 #include <boost/circular_buffer.hpp>
62 #include "trianglemesh_visual.h"
63 #endif
64 
65 namespace rviz
66 {
67 // Forward declaration
68 class BoolProperty;
69 class ColorProperty;
70 class FloatProperty;
71 class IntProperty;
72 class RosTopicProperty;
73 class EnumProperty;
74 
75 } // End namespace rviz
76 
77 namespace rviz_mesh_plugin
78 {
79 // Forward declaration
80 class TriangleMeshVisual;
81 
87 {
88  Q_OBJECT
89 public:
91  static size_t displayCounter;
92 
97 
102 
103 protected:
107  void onInitialize();
108 
112  void reset();
113 
117  void subscribe();
118 
122  void unsubscribe();
123 
127  void onEnable();
128 
132  void onDisable();
133 
137  void fixedFrameChanged();
138 
143  void incomingMessage(const mesh_msgs::TriangleMeshStamped::ConstPtr& meshMsg);
144 
145 private Q_SLOTS:
146 
150  void updateMesh();
151 
155  void updateMeshBufferSize();
156 
160  void updateTopic();
161 
165  void updateSynchronizer();
166 
167 private:
172  void processMessage(const mesh_msgs::TriangleMeshStamped::ConstPtr& meshMsg);
173 
176 
179 
182 
185 
187  boost::circular_buffer<boost::shared_ptr<TriangleMeshVisual> > m_meshVisuals;
188 
191 
193  size_t m_displayID;
194 
197 
200 
203 
206 
209 
212 
215 
218 
221 
224 
227 
230 
233 
236 };
237 } // End namespace rviz_mesh_plugin
238 
239 #endif
rviz_mesh_plugin::TriangleMeshDisplay::subscribe
void subscribe()
Set the topics to subscribe.
Definition: trianglemesh_display.cpp:254
rviz::RosTopicProperty
rviz_mesh_plugin::TriangleMeshDisplay::m_scalingFactor
rviz::FloatProperty * m_scalingFactor
Property to set the size of the normals.
Definition: trianglemesh_display.h:220
rviz_mesh_plugin::TriangleMeshDisplay::m_meshTopic
rviz::RosTopicProperty * m_meshTopic
Property to handle topic for meshMsg.
Definition: trianglemesh_display.h:196
tf2_ros::MessageFilter< mesh_msgs::TriangleMeshStamped >
rviz_mesh_plugin::TriangleMeshDisplay::m_normalsAlpha
rviz::FloatProperty * m_normalsAlpha
Property to set the transparency of the normals.
Definition: trianglemesh_display.h:226
rviz_mesh_plugin::TriangleMeshDisplay::m_facesAlpha
rviz::FloatProperty * m_facesAlpha
Property to set faces transparency.
Definition: trianglemesh_display.h:211
rviz_mesh_plugin::TriangleMeshDisplay::onInitialize
void onInitialize()
Initialises all nessessary things to get started.
Definition: trianglemesh_display.cpp:218
rviz_mesh_plugin::TriangleMeshDisplay::m_displayID
size_t m_displayID
DisplayID.
Definition: trianglemesh_display.h:193
rviz::BoolProperty
message_filters::Cache< mesh_msgs::TriangleMeshStamped >
trianglemesh_visual.h
rviz_mesh_plugin::TriangleMeshDisplay::updateTopic
void updateTopic()
Updates the subscribed topic.
Definition: trianglemesh_display.cpp:246
rviz_mesh_plugin::TriangleMeshDisplay::onEnable
void onEnable()
Calls subscribe() if display is enabled.
Definition: trianglemesh_display.cpp:302
rviz_mesh_plugin::TriangleMeshDisplay::m_tfMeshFilter
tf2_ros::MessageFilter< mesh_msgs::TriangleMeshStamped > * m_tfMeshFilter
Messagefilter for meshMsg.
Definition: trianglemesh_display.h:178
time_synchronizer.h
rviz_mesh_plugin::TriangleMeshDisplay::m_normalsColor
rviz::ColorProperty * m_normalsColor
Property to set the color of the normals.
Definition: trianglemesh_display.h:223
rviz_mesh_plugin::TriangleMeshDisplay::m_synchronizer
message_filters::Cache< mesh_msgs::TriangleMeshStamped > * m_synchronizer
Synchronizer for meshMsgs.
Definition: trianglemesh_display.h:181
display.h
rviz_mesh_plugin::TriangleMeshDisplay::m_facesTriangleColors
rviz::BoolProperty * m_facesTriangleColors
Property to use the triangle colors.
Definition: trianglemesh_display.h:217
rviz_mesh_plugin::TriangleMeshDisplay::reset
void reset()
Clears whole stored data.
Definition: trianglemesh_display.cpp:238
rviz::ColorProperty
message_filters::Subscriber< mesh_msgs::TriangleMeshStamped >
rviz_mesh_plugin::TriangleMeshDisplay::updateMeshBufferSize
void updateMeshBufferSize()
Sets capacity of trianglemesh_visual.
Definition: trianglemesh_display.cpp:326
rviz::Display
rviz::EnumProperty
rviz::FloatProperty
rviz_mesh_plugin::TriangleMeshDisplay::incomingMessage
void incomingMessage(const mesh_msgs::TriangleMeshStamped::ConstPtr &meshMsg)
Tests if messages are valid, calls processMessage().
Definition: trianglemesh_display.cpp:319
rviz_mesh_plugin::TriangleMeshDisplay::m_meshSubscriber
message_filters::Subscriber< mesh_msgs::TriangleMeshStamped > m_meshSubscriber
Subscriber for meshMsg.
Definition: trianglemesh_display.h:175
rviz_mesh_plugin::TriangleMeshDisplay::m_meshVisuals
boost::circular_buffer< boost::shared_ptr< TriangleMeshVisual > > m_meshVisuals
Shared pointer to store the created objects of trianglemesh_visual.
Definition: trianglemesh_display.h:187
rviz_mesh_plugin::TriangleMeshDisplay::m_displayType
rviz::EnumProperty * m_displayType
Property to select the display type.
Definition: trianglemesh_display.h:229
rviz_mesh_plugin::TriangleMeshDisplay::m_messagesReceived
uint32_t m_messagesReceived
Counter for the received messages.
Definition: trianglemesh_display.h:184
rviz_mesh_plugin::TriangleMeshDisplay::updateMesh
void updateMesh()
Updates material for each mesh displayed by trianglemesh_visual.
Definition: trianglemesh_display.cpp:332
message_filter.h
rviz_mesh_plugin::TriangleMeshDisplay::m_meshBufferSize
rviz::IntProperty * m_meshBufferSize
Property to set meshBufferSize.
Definition: trianglemesh_display.h:199
rviz
subscriber.h
cache.h
rviz_mesh_plugin::TriangleMeshDisplay::m_wireframeColor
rviz::ColorProperty * m_wireframeColor
Property to set wireframe color.
Definition: trianglemesh_display.h:202
rviz_mesh_plugin::TriangleMeshDisplay::updateSynchronizer
void updateSynchronizer()
Updates the topic synchronizer.
rviz_mesh_plugin::TriangleMeshDisplay::processMessage
void processMessage(const mesh_msgs::TriangleMeshStamped::ConstPtr &meshMsg)
Sets data for trianglemesh_visual and updates the mesh.
Definition: trianglemesh_display.cpp:374
rviz_mesh_plugin::TriangleMeshDisplay::~TriangleMeshDisplay
~TriangleMeshDisplay()
Destructor.
Definition: trianglemesh_display.cpp:212
rviz_mesh_plugin::TriangleMeshDisplay::m_facesColor
rviz::ColorProperty * m_facesColor
Property to set faces color.
Definition: trianglemesh_display.h:208
rviz_mesh_plugin::TriangleMeshDisplay::displayCounter
static size_t displayCounter
Counter for the number of displays.
Definition: trianglemesh_display.h:91
rviz_mesh_plugin::TriangleMeshDisplay::m_showNormals
rviz::BoolProperty * m_showNormals
Property to select the normals.
Definition: trianglemesh_display.h:235
rviz_mesh_plugin::TriangleMeshDisplay::m_wireframeAlpha
rviz::FloatProperty * m_wireframeAlpha
Property to set wireframe transparency.
Definition: trianglemesh_display.h:205
rviz_mesh_plugin
Definition: face_selection_tool.h:117
rviz_mesh_plugin::TriangleMeshDisplay
TriangleMeshDisplay.
Definition: trianglemesh_display.h:86
rviz_mesh_plugin::TriangleMeshDisplay::onDisable
void onDisable()
Calls unsubscribe() and reset() if display is disabled.
Definition: trianglemesh_display.cpp:307
rviz_mesh_plugin::TriangleMeshDisplay::unsubscribe
void unsubscribe()
Unsubscribes all topics.
Definition: trianglemesh_display.cpp:291
rviz_mesh_plugin::TriangleMeshDisplay::m_facesVertexColors
rviz::BoolProperty * m_facesVertexColors
Property to use the vertex colors.
Definition: trianglemesh_display.h:214
rviz_mesh_plugin::TriangleMeshDisplay::m_meshCounter
size_t m_meshCounter
Counter for the meshes.
Definition: trianglemesh_display.h:190
rviz_mesh_plugin::TriangleMeshDisplay::m_showWireframe
rviz::BoolProperty * m_showWireframe
Property to select the wireframe.
Definition: trianglemesh_display.h:232
rviz_mesh_plugin::TriangleMeshDisplay::fixedFrameChanged
void fixedFrameChanged()
Sets the fixed frame.
Definition: trianglemesh_display.cpp:313
rviz::IntProperty
rviz_mesh_plugin::TriangleMeshDisplay::TriangleMeshDisplay
TriangleMeshDisplay()
Constructor.
Definition: trianglemesh_display.cpp:79


rviz_mesh_plugin
Author(s): Sebastian Pütz , Henning Deeken , Marcel Mrozinski , Kristin Schmidt , Jan Philipp Vogtherr
autogenerated on Fri Feb 12 2021 04:03:57