Go to the documentation of this file.
54 #ifndef MESH_DISPLAY_HPP
55 #define MESH_DISPLAY_HPP
68 #include <QMessageBox>
69 #include <QApplication>
92 #include <OGRE/OgreManualObject.h>
93 #include <OGRE/OgreSceneNode.h>
94 #include <OGRE/OgreSceneManager.h>
95 #include <OGRE/OgreStringConverter.h>
96 #include <OGRE/OgreMaterialManager.h>
97 #include <OGRE/OgreColourValue.h>
108 class RosTopicProperty;
110 class StringProperty;
116 using std::shared_ptr;
118 using std::unique_ptr;
193 void addVertexCosts(std::string costlayer, vector<float>& vertexCosts);
206 void setMaterials(vector<Material>& materials, vector<TexCoords>& texCoords);
220 void setPose(Ogre::Vector3& position, Ogre::Quaternion& orientation);
299 void processMessage(
const mesh_msgs::MeshGeometryStamped::ConstPtr& meshMsg);
305 void incomingGeometry(
const mesh_msgs::MeshGeometryStamped::ConstPtr& meshMsg);
std::map< std::string, std::vector< float > > m_costCache
Cache for received vertex cost messages.
rviz::FloatProperty * m_costLowerLimit
Property for setting the lower limit of cost display.
ros::ServiceClient m_materialsClient
Client to request the materials.
ros::ServiceClient m_geometryClient
Client to request the geometry.
void updateVertexColorService()
Updates the vertex color service.
rviz::ColorProperty * m_facesColor
Property to set faces color.
void processMessage(const mesh_msgs::MeshGeometryStamped::ConstPtr &meshMsg)
Sets data for trianglemesh_visual and updates the mesh.
void addTexture(Texture &texture, uint32_t textureIndex)
Add a texture.
void updateVertexColorsTopic()
Updates the subscribed vertex colors topic.
void setVertexColors(vector< Color > &vertexColors)
Set the vertex colors.
void addVertexCosts(std::string costlayer, vector< float > &vertexCosts)
Adds a vertex costlayer.
void initialServiceCall()
initial service call for UUID & geometry
rviz::RosTopicProperty * m_meshTopic
Property to handle topic for meshMsg.
tf2_ros::MessageFilter< mesh_msgs::MeshGeometryStamped > * m_tfMeshFilter
Messagefilter for meshMsg.
std::shared_ptr< MeshVisual > addNewVisual()
adds a new visual to the ring buffer
rviz::StringProperty * m_materialServiceName
Property to handle service name for materials.
rviz::RosTopicProperty * m_vertexCostsTopic
Property to handle topic for vertex cost maps.
void setGeometry(shared_ptr< Geometry > geometry)
Set the geometry.
MeshDisplay()
Constructor.
~MeshDisplay()
Destructor.
message_filters::Subscriber< mesh_msgs::MeshVertexColorsStamped > m_vertexColorsSubscriber
Subscriber for vertex colors.
void setVertexNormals(vector< Normal > &vertexNormals)
Set the vertex normals.
void updateVertexCostsTopic()
Updates the subscribed vertex costs topic.
void updateMaterialAndTextureServices()
Updates the material and texture services.
rviz::FloatProperty * m_normalsAlpha
Property to set the transparency of the normals.
void updateMesh()
Updates the mesh.
void incomingGeometry(const mesh_msgs::MeshGeometryStamped::ConstPtr &meshMsg)
Handler for incoming geometry messages. Validate data and update mesh.
rviz::StringProperty * m_vertexColorServiceName
Property to handle service name for vertexColors.
ros::ServiceClient m_vertexColorClient
Client to request the vertex colors.
rviz::EnumProperty * m_costColorType
Property for selecting the color type for cost display.
void clearVertexCosts()
Clears the vertex costs.
std::queue< std::shared_ptr< MeshVisual > > m_visuals
Visual data.
rviz::FloatProperty * m_wireframeAlpha
Property to set wireframe transparency.
void updateNormalsSize()
Update the size of the mesh normals.
void onEnable()
RViz callback on enable.
void onInitialize()
RViz callback on initialize.
void updateWireframe()
Updates the mesh wireframe.
uint32_t m_messagesReceived
Counter for the received messages.
message_filters::Subscriber< mesh_msgs::MeshVertexCostsStamped > m_vertexCostsSubscriber
Subscriber for vertex costs.
message_filters::Subscriber< mesh_msgs::MeshGeometryStamped > m_meshSubscriber
Subscriber for meshMsg.
rviz::StringProperty * m_textureServiceName
Property to handle service name for textures.
rviz::EnumProperty * m_selectVertexCostMap
Property to select different types of vertex cost maps to be shown.
rviz::FloatProperty * m_facesAlpha
Property to set faces transparency.
void setPose(Ogre::Vector3 &position, Ogre::Quaternion &orientation)
Set geometrys pose.
void updateNormalsColor()
Update the color of the mesh normals.
void unsubscribe()
Unsubscribes all topics.
void setMaterials(vector< Material > &materials, vector< TexCoords > &texCoords)
Set the materials and texture coordinates.
void updateTopic()
Updates the subscribed topic.
rviz::BoolProperty * m_costUseCustomLimits
Property for using custom limits for cost display.
tf2_ros::MessageFilter< mesh_msgs::MeshVertexColorsStamped > * m_tfVertexColorsFilter
Messagefilter for vertex colors.
Display for showing the mesh in different modes.
bool m_ignoreMsgs
if set to true, ignore incoming messages and do not use services to request materials
ros::ServiceClient m_uuidClient
Client to request the UUID.
rviz::BoolProperty * m_showWireframe
Property to select the wireframe.
void requestMaterials(std::string uuid)
Requests materials from the specified service.
void requestVertexColors(std::string uuid)
Requests vertex colors from the specified service.
rviz::ColorProperty * m_wireframeColor
Property to set wireframe color.
ros::ServiceClient m_textureClient
Client to request the textures.
rviz::ColorProperty * m_normalsColor
Property to set the color of the normals.
message_filters::Cache< mesh_msgs::MeshVertexCostsStamped > * m_costsSynchronizer
Synchronizer for vertex costs.
void subscribe()
Set the topics to subscribe.
rviz::FloatProperty * m_scalingFactor
Property to set the size of the normals.
void updateVertexCosts()
Update the vertex costs.
message_filters::Cache< mesh_msgs::MeshVertexColorsStamped > * m_colorsSynchronizer
Synchronizer for vertex colors.
rviz::FloatProperty * m_costUpperLimit
Property for setting the upper limit of cost display.
rviz::IntProperty * m_bufferSize
Property to handle buffer size.
void incomingVertexColors(const mesh_msgs::MeshVertexColorsStamped::ConstPtr &colorsStamped)
Handler for incoming vertex color messages. Validate data and update mesh.
void updateNormals()
Update the mesh normals.
rviz::BoolProperty * m_showNormals
Property to select the normals.
std::string m_lastUuid
Uuid of the last received message.
rviz::EnumProperty * m_displayType
Property to select the display type.
void incomingVertexCosts(const mesh_msgs::MeshVertexCostsStamped::ConstPtr &costsStamped)
Handler for incoming vertex cost messages. Validate data and update mesh.
void updateBufferSize()
Updates the buffer size.
void ignoreIncomingMessages()
disables visualization of incoming messages
std::shared_ptr< MeshVisual > getLatestVisual()
delivers the latest mesh visual
rviz::RosTopicProperty * m_vertexColorsTopic
Property to handle topic for vertex colors.
tf2_ros::MessageFilter< mesh_msgs::MeshVertexCostsStamped > * m_tfVertexCostsFilter
Messagefilter for vertex costs.
void onDisable()
RViz callback on disable.
void cacheVertexCosts(std::string layer, const std::vector< float > &costs)
Cache function for vertex cost messages.
message_filters::Cache< mesh_msgs::MeshGeometryStamped > * m_meshSynchronizer
Synchronizer for meshMsgs.
rviz::BoolProperty * m_showTexturedFacesOnly
Property to only show textured faces when texturizing is enabled.
rviz_map_plugin
Author(s): Sebastian Pütz
, Kristin Schmidt , Jan Philipp Vogtherr , Malte kleine Piening
autogenerated on Sun Jan 21 2024 04:06:25