MeshDisplay.cpp
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  * MeshDisplay.cpp
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  * Kristin Schmidt <krschmidt@uni-osnabrueck.de>
50  * Jan Philipp Vogtherr <jvogtherr@uni-osnabrueck.de>
51  * Malte kleine Piening <malte@klpiening.de>
52  */
53 
54 #include <MeshDisplay.hpp>
55 
56 #include <mesh_msgs/GetVertexColors.h>
57 #include <mesh_msgs/GetMaterials.h>
58 #include <mesh_msgs/GetGeometry.h>
59 #include <mesh_msgs/GetTexture.h>
60 #include <mesh_msgs/GetUUIDs.h>
61 
69 
70 namespace rviz_map_plugin
71 {
72 MeshDisplay::MeshDisplay() : rviz::Display(), m_ignoreMsgs(false)
73 {
74  // mesh topic
76  "Geometry Topic", "", QString::fromStdString(ros::message_traits::datatype<mesh_msgs::MeshGeometryStamped>()),
77  "Geometry topic to subscribe to.", this, SLOT(updateTopic()));
78 
79  // buffer size / amount of meshes visualized
80  m_bufferSize = new rviz::IntProperty("Buffer Size", 1, "Number of meshes visualized", this, SLOT(updateBufferSize()));
81  m_bufferSize->setMin(1);
82 
83  // Display Type
84  {
85  m_displayType = new rviz::EnumProperty("Display Type", "Fixed Color", "Select Display Type for Mesh", this,
86  SLOT(updateMesh()), this);
87  m_displayType->addOption("Fixed Color", 0);
88  m_displayType->addOption("Vertex Color", 1);
89  m_displayType->addOption("Textures", 2);
90  m_displayType->addOption("Vertex Costs", 3);
91  m_displayType->addOption("Hide Faces", 4);
92 
93  // Fixed Color
94  {
95  // face color properties
96  m_facesColor = new rviz::ColorProperty("Faces Color", QColor(0, 255, 0), "The color of the faces.", m_displayType,
97  SLOT(updateMesh()), this);
98 
99  // face alpha properties
100  m_facesAlpha = new rviz::FloatProperty("Faces Alpha", 1.0, "The alpha-value of the faces", m_displayType,
101  SLOT(updateMesh()), this);
102  m_facesAlpha->setMin(0);
103  m_facesAlpha->setMax(1);
104  }
105 
106  // Vertex Color
107  {
109  "Vertex Colors Topic", "",
110  QString::fromStdString(ros::message_traits::datatype<mesh_msgs::MeshVertexColorsStamped>()),
111  "Vertex color topic to subscribe to.", m_displayType, SLOT(updateVertexColorsTopic()), this);
112 
113  m_vertexColorServiceName = new rviz::StringProperty("Vertex Color Service Name", "get_vertex_colors",
114  "Name of the Vertex Color Service to request Vertex Colors "
115  "from.",
116  m_displayType, SLOT(updateVertexColorService()), this);
117  }
118 
119  // Textures
120  {
121  m_showTexturedFacesOnly = new rviz::BoolProperty("Show textured faces only", false, "Show textured faces only",
122  m_displayType, SLOT(updateMesh()), this);
123 
124  m_materialServiceName = new rviz::StringProperty("Material Service Name", "get_materials",
125  "Name of the Matrial Service to request Materials from.",
127 
128  m_textureServiceName = new rviz::StringProperty("Texture Service Name", "get_texture",
129  "Name of the Texture Service to request Textures from.",
131  }
132 
133  // Vertex Costs
134  {
135  m_costColorType = new rviz::EnumProperty("Color Scale", "Rainbow",
136  "Select color scale for vertex costs. Mesh will update when new data "
137  "arrives.",
138  m_displayType, SLOT(updateVertexCosts()), this);
139  m_costColorType->addOption("Rainbow", 0);
140  m_costColorType->addOption("Red Green", 1);
141 
143  "Vertex Costs Topic", "",
144  QString::fromStdString(ros::message_traits::datatype<mesh_msgs::MeshVertexCostsStamped>()),
145  "Vertex cost topic to subscribe to.", m_displayType, SLOT(updateVertexCostsTopic()), this);
146 
147  m_selectVertexCostMap = new rviz::EnumProperty("Vertex Costs Type", "-- None --",
148  "Select the type of vertex cost map to be displayed. New types "
149  "will appear here when a new message arrives.",
150  m_displayType, SLOT(updateVertexCosts()), this);
151  m_selectVertexCostMap->addOption("-- None --", 0);
152 
153  m_costUseCustomLimits = new rviz::BoolProperty("Use Custom limits", false, "Use custom vertex cost limits",
154  m_displayType, SLOT(updateVertexCosts()), this);
155 
156  // custom cost limits
157  {
158  m_costLowerLimit = new rviz::FloatProperty("Vertex Costs Lower Limit", 0.0, "Vertex costs lower limit",
161 
162  m_costUpperLimit = new rviz::FloatProperty("Vertex Costs Upper Limit", 1.0, "Vertex costs upper limit",
165  }
166  }
167  }
168 
169  // Wireframe
170  {
172  new rviz::BoolProperty("Show Wireframe", true, "Show Wireframe", this, SLOT(updateWireframe()), this);
173 
174  // wireframe color property
175  m_wireframeColor = new rviz::ColorProperty("Wireframe Color", QColor(0, 0, 0), "The color of the wireframe.",
176  m_showWireframe, SLOT(updateWireframe()), this);
177  // wireframe alpha property
178  m_wireframeAlpha = new rviz::FloatProperty("Wireframe Alpha", 1.0, "The alpha-value of the wireframe",
179  m_showWireframe, SLOT(updateWireframe()), this);
182  }
183 
184  // Normals
185  {
186  m_showNormals = new rviz::BoolProperty("Show Normals", true, "Show Normals", this, SLOT(updateNormals()), this);
187 
188  m_normalsColor = new rviz::ColorProperty("Normals Color", QColor(255, 0, 255), "The color of the normals.",
189  m_showNormals, SLOT(updateNormalsColor()), this);
190  m_normalsAlpha = new rviz::FloatProperty("Normals Alpha", 1.0, "The alpha-value of the normals", m_showNormals,
191  SLOT(updateNormalsColor()), this);
194  m_scalingFactor = new rviz::FloatProperty("Normals Scaling Factor", 0.1, "Scaling factor of the normals",
195  m_showNormals, SLOT(updateNormalsSize()), this);
196  }
197 }
198 
200 {
201 }
202 
204 {
206  *rviz::Display::context_->getTF2BufferPtr(), rviz::Display::fixed_frame_.toStdString(), 2,
210 
212  *rviz::Display::context_->getTF2BufferPtr(), rviz::Display::fixed_frame_.toStdString(), 10,
216 
218  *rviz::Display::context_->getTF2BufferPtr(), rviz::Display::fixed_frame_.toStdString(), 10,
222 
223  m_meshSynchronizer = 0;
226 
227  // Initialize service clients
228  ros::NodeHandle n;
229  m_vertexColorClient = n.serviceClient<mesh_msgs::GetVertexColors>(m_vertexColorServiceName->getStdString());
230 
231  m_materialsClient = n.serviceClient<mesh_msgs::GetMaterials>(m_materialServiceName->getStdString());
232 
233  m_textureClient = n.serviceClient<mesh_msgs::GetTexture>(m_textureServiceName->getStdString());
234 
235  updateMesh();
236  updateWireframe();
237  updateNormals();
238  updateTopic();
239 }
240 
242 {
243  m_messagesReceived = 0;
244  subscribe();
245  updateMesh();
246  updateWireframe();
247  updateNormals();
248 }
249 
251 {
252  unsubscribe();
253 
254  // clear visuals
255  std::queue<std::shared_ptr<MeshVisual>>().swap(m_visuals);
256 }
257 
259 {
260  if (!isEnabled() || m_ignoreMsgs)
261  {
262  return;
263  }
264 
265  try
266  {
270  setStatus(rviz::StatusProperty::Ok, "Topic", "OK");
271  }
272  catch (ros::Exception& e)
273  {
274  setStatus(rviz::StatusProperty::Error, "Topic", QString("Error subscribing: ") + e.what());
275  }
276 
277  // Nothing
278  if (m_meshTopic->getTopicStd().empty())
279  {
280  return;
281  }
282  else
283  {
286 
289 
292  }
293 
295 }
296 
298 {
302 
303  if (m_meshSynchronizer)
304  {
305  delete m_meshSynchronizer;
306  m_meshSynchronizer = 0;
307  }
309  {
310  delete m_colorsSynchronizer;
312  }
314  {
315  delete m_costsSynchronizer;
317  }
318 }
319 
321 {
322  m_ignoreMsgs = true;
323  unsubscribe();
324  updateMesh();
325 
326  // only allow one mesh to be visualized
327  while (m_visuals.size() > 1)
328  {
329  m_visuals.pop();
330  }
331 }
332 
333 // =====================================================================================================================
334 // Data manipulators
335 
336 void MeshDisplay::setGeometry(shared_ptr<Geometry> geometry)
337 {
338  // Create the visual
339  std::shared_ptr<MeshVisual> visual = addNewVisual();
340  visual->setGeometry(*geometry);
341  if (isEnabled())
342  {
343  updateMesh();
344  updateNormals();
345  updateWireframe();
346  }
347  setStatus(rviz::StatusProperty::Ok, "Display", "");
348 }
349 
350 void MeshDisplay::setVertexColors(vector<Color>& vertexColors)
351 {
352  std::shared_ptr<MeshVisual> visual = getLatestVisual();
353  if (visual)
354  {
355  visual->setVertexColors(vertexColors);
356  }
357  updateMesh();
358 }
359 
361 {
362  m_costCache.clear();
364 }
365 
366 void MeshDisplay::addVertexCosts(std::string costlayer, std::vector<float>& vertexCosts)
367 {
368  cacheVertexCosts(costlayer, vertexCosts);
370 }
371 
372 void MeshDisplay::setVertexNormals(vector<Normal>& vertexNormals)
373 {
374  std::shared_ptr<MeshVisual> visual = getLatestVisual();
375  if (visual)
376  {
377  visual->setNormals(vertexNormals);
378  }
379  if (isEnabled())
380  {
381  updateNormals();
382  }
383 }
384 
385 void MeshDisplay::setMaterials(vector<Material>& materials, vector<TexCoords>& texCoords)
386 {
387  std::shared_ptr<MeshVisual> visual = getLatestVisual();
388  if (visual)
389  {
390  visual->setMaterials(materials, texCoords);
391  }
392  updateMesh();
393 }
394 
395 void MeshDisplay::addTexture(Texture& texture, uint32_t textureIndex)
396 {
397  std::shared_ptr<MeshVisual> visual = getLatestVisual();
398  if (visual)
399  {
400  visual->addTexture(texture, textureIndex);
401  }
402 }
403 
404 void MeshDisplay::setPose(Ogre::Vector3& position, Ogre::Quaternion& orientation)
405 {
406  std::shared_ptr<MeshVisual> visual = getLatestVisual();
407  if (visual)
408  {
409  visual->setFramePosition(position);
410  visual->setFrameOrientation(orientation);
411  }
412 }
413 
414 // =====================================================================================================================
415 // Callbacks triggered from UI events (mostly)
416 
418 {
419  while (m_visuals.size() > m_bufferSize->getInt())
420  {
421  m_visuals.pop();
422  }
423 }
424 
426 {
427  ROS_INFO("Mesh Display: Update");
428 
429  bool showFaces = false;
430  bool showTextures = false;
431  bool showVertexColors = false;
432  bool showVertexCosts = false;
433 
434  m_facesColor->hide();
435  m_facesAlpha->hide();
436 
439 
443 
450 
451  if (m_ignoreMsgs)
452  {
453  m_meshTopic->hide();
454  m_bufferSize->hide();
455  }
456  else
457  {
458  m_meshTopic->show();
459  m_bufferSize->show();
460  }
461 
462  switch (m_displayType->getOptionInt())
463  {
464  default:
465  case 0: // Faces with fixed color
466  showFaces = true;
467  m_facesColor->show();
468  m_facesAlpha->show();
469  break;
470  case 1: // Faces with vertex color
471  showFaces = true;
472  showVertexColors = true;
473  if (!m_ignoreMsgs)
474  {
477  }
478  break;
479  case 2: // Faces with textures
480  showFaces = true;
481  showTextures = true;
483  if (!m_ignoreMsgs)
484  {
487  }
488  break;
489  case 3: // Faces with vertex costs
490  showFaces = true;
491  showVertexCosts = true;
493  if (!m_ignoreMsgs)
494  {
496  }
500  {
503  }
504  break;
505  case 4: // No Faces
506  break;
507  }
508 
509  std::shared_ptr<MeshVisual> visual = getLatestVisual();
510  if (!visual)
511  {
512  ROS_ERROR("Mesh display: no visual available, can't draw mesh! (maybe no data has been received yet?)");
513  return;
514  }
515 
516  if (isEnabled())
517  {
518  visual->updateMaterial(showFaces, m_facesColor->getOgreColor(), m_facesAlpha->getFloat(), showVertexColors,
519  showVertexCosts, showTextures, m_showTexturedFacesOnly->getBool());
520  updateWireframe();
521  }
522 }
523 
525 {
526  bool showWireframe = m_showWireframe->getBool();
527 
528  std::shared_ptr<MeshVisual> visual = getLatestVisual();
529  if (visual)
530  {
531  visual->updateWireframe(showWireframe, m_wireframeColor->getOgreColor(), m_wireframeAlpha->getFloat());
532  }
533 }
534 
536 {
537  bool showNormals = m_showNormals->getBool();
538 
539  std::shared_ptr<MeshVisual> visual = getLatestVisual();
540  if (visual)
541  {
542  visual->updateNormals(showNormals, m_normalsColor->getOgreColor(), m_normalsAlpha->getFloat(),
544  }
545 }
546 
548 {
549  bool showNormals = m_showNormals->getBool();
550 
551  std::shared_ptr<MeshVisual> visual = getLatestVisual();
552  if (visual)
553  {
554  visual->updateNormals(showNormals, m_normalsColor->getOgreColor(), m_normalsAlpha->getFloat());
555  }
556 }
557 
559 {
560  std::shared_ptr<MeshVisual> visual = getLatestVisual();
561  if (visual)
562  {
563  visual->updateNormals(m_scalingFactor->getFloat());
564  }
565 }
566 
568 {
570  {
572  {
573  std::shared_ptr<MeshVisual> visual = getLatestVisual();
574  if (visual)
575  {
578  }
579  }
580  }
581  else
582  {
584  {
585  std::shared_ptr<MeshVisual> visual = getLatestVisual();
586  if (visual)
587  {
589  }
590  }
591  }
592  updateMesh();
593 }
594 
596 {
598  delete m_colorsSynchronizer;
599 
603 }
604 
606 {
608  delete m_costsSynchronizer;
609 
613 }
614 
616 {
617  unsubscribe();
618  subscribe();
620 }
621 
623 {
624  if (m_ignoreMsgs)
625  {
626  return;
627  }
628 
629  // Check if the service names are valid
630  std::string error;
633  {
634  setStatus(rviz::StatusProperty::Warn, "Services", QString("The service name contains an invalid character."));
635  return;
636  }
637 
638  // Update material and texture service clients
639  ros::NodeHandle n;
640  m_materialsClient = n.serviceClient<mesh_msgs::GetMaterials>(m_materialServiceName->getStdString());
641  m_textureClient = n.serviceClient<mesh_msgs::GetTexture>(m_textureServiceName->getStdString());
643  {
645  if (m_textureClient.exists())
646  {
647  setStatus(rviz::StatusProperty::Ok, "Services", "Material and Texture Service OK");
648  }
649  else
650  {
651  setStatus(rviz::StatusProperty::Warn, "Services", QString("The specified Texture Service doesn't exist."));
652  }
653  }
654  else
655  {
656  setStatus(rviz::StatusProperty::Warn, "Services", QString("The specified Material Service doesn't exist."));
657  }
658 }
659 
661 {
662  if (m_ignoreMsgs)
663  {
664  return;
665  }
666 
667  // Check if the service name is valid
668  std::string error;
670  {
671  setStatus(rviz::StatusProperty::Warn, "Services", QString("The service name contains an invalid character."));
672  return;
673  }
674 
675  // Update vertex color service client
676  ros::NodeHandle n;
677  m_vertexColorClient = n.serviceClient<mesh_msgs::GetVertexColors>(m_vertexColorServiceName->getStdString());
679  {
680  setStatus(rviz::StatusProperty::Ok, "Services", "Vertex Color Service OK");
682  }
683  else
684  {
685  setStatus(rviz::StatusProperty::Warn, "Services", QString("The specified Vertex Color Service doesn't exist."));
686  }
687 }
688 
689 // =====================================================================================================================
690 // Data loading
691 
693 {
694  if (m_ignoreMsgs)
695  {
696  return;
697  }
698 
699  ros::NodeHandle n;
700  m_uuidClient = n.serviceClient<mesh_msgs::GetUUIDs>("get_uuid");
701 
702  mesh_msgs::GetUUIDs srv_uuids;
703  if (m_uuidClient.call(srv_uuids))
704  {
705  std::vector<std::string> uuids = srv_uuids.response.uuids;
706 
707  if (uuids.size() > 0)
708  {
709  std::string uuid = uuids[0];
710 
711  ROS_INFO_STREAM("Initial data available for UUID=" << uuid);
712 
713  m_geometryClient = n.serviceClient<mesh_msgs::GetGeometry>("get_geometry");
714 
715  mesh_msgs::GetGeometry srv_geometry;
716  srv_geometry.request.uuid = uuid;
717  if (m_geometryClient.call(srv_geometry))
718  {
719  ROS_INFO_STREAM("Found geometry for UUID=" << uuid);
720  mesh_msgs::MeshGeometryStamped::ConstPtr geometry =
721  boost::make_shared<const mesh_msgs::MeshGeometryStamped>(srv_geometry.response.mesh_geometry_stamped);
722  processMessage(geometry);
723  }
724  else
725  {
726  ROS_INFO_STREAM("Could not load geometry. Waiting for callback to trigger ... ");
727  }
728  }
729  }
730  else
731  {
732  ROS_INFO("No initial data available, waiting for callback to trigger ...");
733  }
734 }
735 
736 void MeshDisplay::processMessage(const mesh_msgs::MeshGeometryStamped::ConstPtr& meshMsg)
737 {
738  if (m_ignoreMsgs)
739  {
740  return;
741  }
742 
743  Ogre::Quaternion orientation;
744  Ogre::Vector3 position;
745 
746  if (!context_->getFrameManager()->getTransform(meshMsg->header.frame_id, meshMsg->header.stamp, position,
747  orientation))
748  {
749  ROS_ERROR("Error transforming from frame '%s' to frame '%s'", meshMsg->header.frame_id.c_str(),
750  qPrintable(rviz::Display::fixed_frame_));
751  return;
752  }
753 
754  if (!m_lastUuid.empty() && meshMsg->uuid.compare(m_lastUuid) != 0)
755  {
756  ROS_WARN("Received geometry with new UUID!");
757  m_costCache.clear();
759  m_selectVertexCostMap->addOption("-- None --", 0);
760  }
761 
762  m_lastUuid = meshMsg->uuid;
763 
764  // set Geometry
765  std::shared_ptr<Geometry> mesh(std::make_shared<Geometry>());
766  for (const geometry_msgs::Point& v : meshMsg->mesh_geometry.vertices)
767  {
768  Vertex vertex;
769  vertex.x = v.x;
770  vertex.y = v.y;
771  vertex.z = v.z;
772  mesh->vertices.push_back(vertex);
773  }
774  for (const mesh_msgs::MeshTriangleIndices& f : meshMsg->mesh_geometry.faces)
775  {
776  Face face;
777  face.vertexIndices[0] = f.vertex_indices[0];
778  face.vertexIndices[1] = f.vertex_indices[1];
779  face.vertexIndices[2] = f.vertex_indices[2];
780  mesh->faces.push_back(face);
781  }
782  setGeometry(mesh);
783  setPose(position, orientation);
784 
785  // set Normals
786  std::vector<Normal> normals;
787  for (const geometry_msgs::Point& n : meshMsg->mesh_geometry.vertex_normals)
788  {
789  Normal normal(n.x, n.y, n.z);
790  normals.push_back(normal);
791  }
792  setVertexNormals(normals);
793 
794  requestVertexColors(meshMsg->uuid);
795  requestMaterials(meshMsg->uuid);
796 }
797 
798 void MeshDisplay::incomingGeometry(const mesh_msgs::MeshGeometryStamped::ConstPtr& meshMsg)
799 {
801  setStatus(rviz::StatusProperty::Ok, "Topic", QString::number(m_messagesReceived) + " messages received");
802  processMessage(meshMsg);
803 }
804 
805 void MeshDisplay::incomingVertexColors(const mesh_msgs::MeshVertexColorsStamped::ConstPtr& colorsStamped)
806 {
807  if (colorsStamped->uuid.compare(m_lastUuid) != 0)
808  {
809  ROS_ERROR("Received vertex colors, but UUIDs dont match!");
810  return;
811  }
812 
813  std::vector<Color> vertexColors;
814  for (const std_msgs::ColorRGBA c : colorsStamped->mesh_vertex_colors.vertex_colors)
815  {
816  Color color(c.r, c.g, c.b, c.a);
817  vertexColors.push_back(color);
818  }
819 
820  setVertexColors(vertexColors);
821 }
822 
823 void MeshDisplay::incomingVertexCosts(const mesh_msgs::MeshVertexCostsStamped::ConstPtr& costsStamped)
824 {
825  if (costsStamped->uuid.compare(m_lastUuid) != 0)
826  {
827  ROS_ERROR("Received vertex costs, but UUIDs dont match!");
828  return;
829  }
830 
831  cacheVertexCosts(costsStamped->type, costsStamped->mesh_vertex_costs.costs);
833 }
834 
835 void MeshDisplay::requestVertexColors(std::string uuid)
836 {
837  if (m_ignoreMsgs)
838  {
839  return;
840  }
841 
842  mesh_msgs::GetVertexColors srv;
843  srv.request.uuid = uuid;
844  if (m_vertexColorClient.call(srv))
845  {
846  ROS_INFO("Successful vertex colors service call!");
847  mesh_msgs::MeshVertexColorsStamped::ConstPtr meshVertexColors =
848  boost::make_shared<const mesh_msgs::MeshVertexColorsStamped>(srv.response.mesh_vertex_colors_stamped);
849 
850  std::vector<Color> vertexColors;
851  for (const std_msgs::ColorRGBA c : meshVertexColors->mesh_vertex_colors.vertex_colors)
852  {
853  Color color(c.r, c.g, c.b, c.a);
854  vertexColors.push_back(color);
855  }
856 
857  setVertexColors(vertexColors);
858  }
859  else
860  {
861  ROS_INFO("Failed vertex colors service call!");
862  }
863 }
864 
865 void MeshDisplay::requestMaterials(std::string uuid)
866 {
867  if (m_ignoreMsgs)
868  {
869  return;
870  }
871 
872  mesh_msgs::GetMaterials srv;
873  srv.request.uuid = uuid;
874  if (m_materialsClient.call(srv))
875  {
876  ROS_INFO("Successful materials service call!");
877 
878  mesh_msgs::MeshMaterialsStamped::ConstPtr meshMaterialsStamped =
879  boost::make_shared<const mesh_msgs::MeshMaterialsStamped>(srv.response.mesh_materials_stamped);
880 
881  std::vector<Material> materials(meshMaterialsStamped->mesh_materials.materials.size());
882  for (int i = 0; i < meshMaterialsStamped->mesh_materials.materials.size(); i++)
883  {
884  const mesh_msgs::MeshMaterial& mat = meshMaterialsStamped->mesh_materials.materials[i];
885  materials[i].textureIndex = mat.texture_index;
886  materials[i].color = Color(mat.color.r, mat.color.g, mat.color.b, mat.color.a);
887  }
888  for (int i = 0; i < meshMaterialsStamped->mesh_materials.clusters.size(); i++)
889  {
890  const mesh_msgs::MeshFaceCluster& clu = meshMaterialsStamped->mesh_materials.clusters[i];
891 
892  uint32_t materialIndex = meshMaterialsStamped->mesh_materials.cluster_materials[i];
893  const mesh_msgs::MeshMaterial& mat = meshMaterialsStamped->mesh_materials.materials[materialIndex];
894 
895  for (uint32_t face_index : clu.face_indices)
896  {
897  materials[i].faceIndices.push_back(face_index);
898  }
899  }
900 
901  std::vector<TexCoords> textureCoords;
902  for (const mesh_msgs::MeshVertexTexCoords& coord : meshMaterialsStamped->mesh_materials.vertex_tex_coords)
903  {
904  textureCoords.push_back(TexCoords(coord.u, coord.v));
905  }
906 
907  setMaterials(materials, textureCoords);
908 
909  for (mesh_msgs::MeshMaterial material : meshMaterialsStamped->mesh_materials.materials)
910  {
911  if (material.has_texture)
912  {
913  mesh_msgs::GetTexture texSrv;
914  texSrv.request.uuid = uuid;
915  texSrv.request.texture_index = material.texture_index;
916  if (m_textureClient.call(texSrv))
917  {
918  ROS_INFO("Successful texture service call with index %d!", material.texture_index);
919  mesh_msgs::MeshTexture::ConstPtr textureMsg =
920  boost::make_shared<const mesh_msgs::MeshTexture>(texSrv.response.texture);
921 
922  Texture texture;
923  texture.width = textureMsg->image.width;
924  texture.height = textureMsg->image.height;
925  texture.channels = textureMsg->image.step;
926  texture.pixelFormat = textureMsg->image.encoding;
927  texture.data = textureMsg->image.data;
928 
929  addTexture(texture, textureMsg->texture_index);
930  }
931  else
932  {
933  ROS_INFO("Failed texture service call with index %d!", material.texture_index);
934  }
935  }
936  }
937  }
938  else
939  {
940  ROS_INFO("Failed materials service call!");
941  }
942 }
943 
944 void MeshDisplay::cacheVertexCosts(std::string layer, const std::vector<float>& costs)
945 {
946  ROS_INFO_STREAM("Cache vertex cost map '" << layer << "' for UUID ");
947 
948  // insert into cache
949  auto it = m_costCache.find(layer);
950  if (it != m_costCache.end())
951  {
952  ROS_INFO_STREAM("The cost layer \"" << layer << "\" has been updated.");
953  m_costCache.erase(layer);
954  }
955  else
956  {
957  ROS_INFO_STREAM("The cost layer \"" << layer << "\" has been added.");
959  }
960 
961  m_costCache.insert(std::pair<std::string, std::vector<float>>(layer, costs));
962 }
963 
964 std::shared_ptr<MeshVisual> MeshDisplay::getLatestVisual()
965 {
966  if (m_visuals.empty())
967  {
968  return nullptr;
969  }
970  return m_visuals.back();
971 }
972 
973 std::shared_ptr<MeshVisual> MeshDisplay::addNewVisual()
974 {
975  int randomId = (int)((double)rand() / RAND_MAX * 9998);
976  m_visuals.push(std::make_shared<MeshVisual>(context_, 0, 0, randomId));
977 
978  int bufferCapacity = m_bufferSize->getInt();
979  if (m_ignoreMsgs)
980  {
981  bufferCapacity = 1;
982  }
983 
984  if (m_visuals.size() > bufferCapacity)
985  {
986  m_visuals.pop();
987  }
988 
989  return m_visuals.back();
990 }
991 
992 } // End namespace rviz_map_plugin
993 
rviz_map_plugin::MeshDisplay::m_costCache
std::map< std::string, std::vector< float > > m_costCache
Cache for received vertex cost messages.
Definition: MeshDisplay.hpp:473
rviz_map_plugin::MeshDisplay::m_costLowerLimit
rviz::FloatProperty * m_costLowerLimit
Property for setting the lower limit of cost display.
Definition: MeshDisplay.hpp:446
rviz::BoolProperty::getBool
virtual bool getBool() const
rviz_map_plugin::MeshDisplay::m_materialsClient
ros::ServiceClient m_materialsClient
Client to request the materials.
Definition: MeshDisplay.hpp:356
rviz::EnumProperty::getOptionInt
virtual int getOptionInt()
rviz::Display::isEnabled
bool isEnabled() const
rviz_map_plugin::MeshDisplay::m_geometryClient
ros::ServiceClient m_geometryClient
Client to request the geometry.
Definition: MeshDisplay.hpp:365
rviz_map_plugin::MeshDisplay::updateVertexColorService
void updateVertexColorService()
Updates the vertex color service.
Definition: MeshDisplay.cpp:660
rviz_map_plugin::MeshDisplay::processMessage
void processMessage(const mesh_msgs::MeshGeometryStamped::ConstPtr &meshMsg)
Sets data for trianglemesh_visual and updates the mesh.
Definition: MeshDisplay.cpp:736
rviz_map_plugin::MeshDisplay::m_facesColor
rviz::ColorProperty * m_facesColor
Property to set faces color.
Definition: MeshDisplay.hpp:413
rviz::EnumProperty::clearOptions
virtual void clearOptions()
rviz::IntProperty::setMin
void setMin(int min)
rviz::RosTopicProperty
rviz_map_plugin::MeshDisplay::addTexture
void addTexture(Texture &texture, uint32_t textureIndex)
Add a texture.
Definition: MeshDisplay.cpp:395
rviz_map_plugin::Face
Struct for faces.
Definition: Types.hpp:106
rviz_map_plugin::TexCoords
Struct for texture coordinates.
Definition: Types.hpp:76
rviz_map_plugin::MeshDisplay::updateVertexColorsTopic
void updateVertexColorsTopic()
Updates the subscribed vertex colors topic.
Definition: MeshDisplay.cpp:595
rviz::DisplayContext::queueRender
virtual void queueRender()=0
tf2_ros::MessageFilter< mesh_msgs::MeshGeometryStamped >
rviz_map_plugin::MeshDisplay::setVertexColors
void setVertexColors(vector< Color > &vertexColors)
Set the vertex colors.
Definition: MeshDisplay.cpp:350
rviz_map_plugin::MeshDisplay::addVertexCosts
void addVertexCosts(std::string costlayer, vector< float > &vertexCosts)
Adds a vertex costlayer.
Definition: MeshDisplay.cpp:366
rviz_map_plugin::MeshDisplay::initialServiceCall
void initialServiceCall()
initial service call for UUID & geometry
Definition: MeshDisplay.cpp:692
rviz_map_plugin::MeshDisplay::m_meshTopic
rviz::RosTopicProperty * m_meshTopic
Property to handle topic for meshMsg.
Definition: MeshDisplay.hpp:404
rviz::StatusProperty::Error
Error
rviz_map_plugin::MeshDisplay::m_tfMeshFilter
tf2_ros::MessageFilter< mesh_msgs::MeshGeometryStamped > * m_tfMeshFilter
Messagefilter for meshMsg.
Definition: MeshDisplay.hpp:377
ros::ServiceClient::exists
bool exists()
rviz_map_plugin::MeshDisplay::addNewVisual
std::shared_ptr< MeshVisual > addNewVisual()
adds a new visual to the ring buffer
Definition: MeshDisplay.cpp:973
rviz_map_plugin::MeshDisplay::m_materialServiceName
rviz::StringProperty * m_materialServiceName
Property to handle service name for materials.
Definition: MeshDisplay.hpp:428
rviz_map_plugin::MeshDisplay::m_vertexCostsTopic
rviz::RosTopicProperty * m_vertexCostsTopic
Property to handle topic for vertex cost maps.
Definition: MeshDisplay.hpp:437
rviz_map_plugin::MeshDisplay::setGeometry
void setGeometry(shared_ptr< Geometry > geometry)
Set the geometry.
Definition: MeshDisplay.cpp:336
rviz::Property::show
void show()
rviz::BoolProperty
rviz::FloatProperty::setMax
void setMax(float max)
message_filters::Cache< mesh_msgs::MeshGeometryStamped >
int_property.h
rviz_map_plugin::MeshDisplay::MeshDisplay
MeshDisplay()
Constructor.
Definition: MeshDisplay.cpp:72
rviz_map_plugin::MeshDisplay::~MeshDisplay
~MeshDisplay()
Destructor.
Definition: MeshDisplay.cpp:199
rviz_map_plugin::MeshDisplay::m_vertexColorsSubscriber
message_filters::Subscriber< mesh_msgs::MeshVertexColorsStamped > m_vertexColorsSubscriber
Subscriber for vertex colors.
Definition: MeshDisplay.hpp:371
rviz_map_plugin::MeshDisplay::setVertexNormals
void setVertexNormals(vector< Normal > &vertexNormals)
Set the vertex normals.
Definition: MeshDisplay.cpp:372
ros::NodeHandle::serviceClient
ServiceClient serviceClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
rviz_map_plugin::Vertex::z
float z
Definition: Types.hpp:102
enum_property.h
rviz_map_plugin::Vertex::y
float y
Definition: Types.hpp:101
rviz::Property::numChildren
virtual int numChildren() const
ros::Exception
rviz::Display::fixed_frame_
QString fixed_frame_
rviz_map_plugin::MeshDisplay::updateVertexCostsTopic
void updateVertexCostsTopic()
Updates the subscribed vertex costs topic.
Definition: MeshDisplay.cpp:605
message_filters::Subscriber::unsubscribe
void unsubscribe()
ros::names::validate
ROSCPP_DECL bool validate(const std::string &name, std::string &error)
rviz::FloatProperty::setMin
void setMin(float min)
rviz_map_plugin::MeshDisplay::updateMaterialAndTextureServices
void updateMaterialAndTextureServices()
Updates the material and texture services.
Definition: MeshDisplay.cpp:622
float_property.h
f
f
rviz::ColorProperty
rviz::Display
rviz::EnumProperty
rviz::FloatProperty
rviz_map_plugin::MeshDisplay::m_normalsAlpha
rviz::FloatProperty * m_normalsAlpha
Property to set the transparency of the normals.
Definition: MeshDisplay.hpp:458
rviz_map_plugin::MeshDisplay::updateMesh
void updateMesh()
Updates the mesh.
Definition: MeshDisplay.cpp:425
class_list_macros.h
rviz_map_plugin::MeshDisplay::incomingGeometry
void incomingGeometry(const mesh_msgs::MeshGeometryStamped::ConstPtr &meshMsg)
Handler for incoming geometry messages. Validate data and update mesh.
Definition: MeshDisplay.cpp:798
rviz::Property::hide
void hide()
rviz::Display::setStatus
virtual void setStatus(StatusProperty::Level level, const QString &name, const QString &text)
rviz_map_plugin::MeshDisplay::m_vertexColorServiceName
rviz::StringProperty * m_vertexColorServiceName
Property to handle service name for vertexColors.
Definition: MeshDisplay.hpp:422
rviz_map_plugin::MeshDisplay::m_vertexColorClient
ros::ServiceClient m_vertexColorClient
Client to request the vertex colors.
Definition: MeshDisplay.hpp:353
bool_property.h
PLUGINLIB_EXPORT_CLASS
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
rviz_map_plugin::MeshDisplay::m_costColorType
rviz::EnumProperty * m_costColorType
Property for selecting the color type for cost display.
Definition: MeshDisplay.hpp:434
rviz::FloatProperty::getFloat
virtual float getFloat() const
rviz::EnumProperty::addOption
virtual void addOption(const QString &option, int value=0)
rviz_map_plugin::MeshDisplay::clearVertexCosts
void clearVertexCosts()
Clears the vertex costs.
Definition: MeshDisplay.cpp:360
rviz
rviz_map_plugin::MeshDisplay::m_visuals
std::queue< std::shared_ptr< MeshVisual > > m_visuals
Visual data.
Definition: MeshDisplay.hpp:401
rviz_map_plugin::MeshDisplay::m_wireframeAlpha
rviz::FloatProperty * m_wireframeAlpha
Property to set wireframe transparency.
Definition: MeshDisplay.hpp:470
rviz_map_plugin::MeshDisplay::updateNormalsSize
void updateNormalsSize()
Update the size of the mesh normals.
Definition: MeshDisplay.cpp:558
rviz::StringProperty
rviz::StringProperty::getStdString
std::string getStdString()
rviz::StatusProperty::Ok
Ok
swap
void swap(T *&arr, size_t i1, size_t i2, size_t n)
rviz::StatusProperty::Warn
Warn
rviz_map_plugin::MeshDisplay::onEnable
void onEnable()
RViz callback on enable.
Definition: MeshDisplay.cpp:241
rviz_map_plugin::MeshDisplay::onInitialize
void onInitialize()
RViz callback on initialize.
Definition: MeshDisplay.cpp:203
rviz_map_plugin::MeshDisplay::updateWireframe
void updateWireframe()
Updates the mesh wireframe.
Definition: MeshDisplay.cpp:524
rviz_map_plugin::MeshDisplay::m_messagesReceived
uint32_t m_messagesReceived
Counter for the received messages.
Definition: MeshDisplay.hpp:395
rviz_map_plugin::Texture::pixelFormat
string pixelFormat
Definition: Types.hpp:166
ROS_WARN
#define ROS_WARN(...)
rviz_map_plugin::Texture::data
vector< uint8_t > data
Definition: Types.hpp:165
MeshDisplay.hpp
rviz_map_plugin::Texture::height
uint32_t height
Definition: Types.hpp:163
message_filters::SimpleFilter::registerCallback
Connection registerCallback(const boost::function< void(P)> &callback)
rviz_map_plugin::MeshDisplay::m_vertexCostsSubscriber
message_filters::Subscriber< mesh_msgs::MeshVertexCostsStamped > m_vertexCostsSubscriber
Subscriber for vertex costs.
Definition: MeshDisplay.hpp:374
rviz_map_plugin::MeshDisplay::m_meshSubscriber
message_filters::Subscriber< mesh_msgs::MeshGeometryStamped > m_meshSubscriber
Subscriber for meshMsg.
Definition: MeshDisplay.hpp:368
rviz_map_plugin::MeshDisplay::m_textureServiceName
rviz::StringProperty * m_textureServiceName
Property to handle service name for textures.
Definition: MeshDisplay.hpp:431
ROS_INFO_STREAM
#define ROS_INFO_STREAM(args)
rviz_map_plugin::MeshDisplay::m_selectVertexCostMap
rviz::EnumProperty * m_selectVertexCostMap
Property to select different types of vertex cost maps to be shown.
Definition: MeshDisplay.hpp:440
rviz_map_plugin::MeshDisplay::m_facesAlpha
rviz::FloatProperty * m_facesAlpha
Property to set faces transparency.
Definition: MeshDisplay.hpp:416
rviz::DisplayContext::getFrameManager
virtual FrameManager * getFrameManager() const=0
rviz_map_plugin::MeshDisplay::setPose
void setPose(Ogre::Vector3 &position, Ogre::Quaternion &orientation)
Set geometrys pose.
Definition: MeshDisplay.cpp:404
rviz_map_plugin::Texture::width
uint32_t width
Definition: Types.hpp:162
rviz::RosTopicProperty::getTopicStd
std::string getTopicStd() const
rviz_map_plugin::MeshDisplay::updateNormalsColor
void updateNormalsColor()
Update the color of the mesh normals.
Definition: MeshDisplay.cpp:547
rviz_map_plugin::MeshDisplay::unsubscribe
void unsubscribe()
Unsubscribes all topics.
Definition: MeshDisplay.cpp:297
rviz_map_plugin::MeshDisplay::setMaterials
void setMaterials(vector< Material > &materials, vector< TexCoords > &texCoords)
Set the materials and texture coordinates.
Definition: MeshDisplay.cpp:385
rviz::EnumProperty::addOptionStd
void addOptionStd(const std::string &option, int value=0)
rviz_map_plugin::MeshDisplay::updateTopic
void updateTopic()
Updates the subscribed topic.
Definition: MeshDisplay.cpp:615
tf2_ros::MessageFilter::connectInput
void connectInput(F &f)
message_filters::Subscriber::subscribe
void subscribe()
rviz_map_plugin::MeshDisplay::m_costUseCustomLimits
rviz::BoolProperty * m_costUseCustomLimits
Property for using custom limits for cost display.
Definition: MeshDisplay.hpp:443
rviz::FrameManager::getTransform
bool getTransform(const Header &header, Ogre::Vector3 &position, Ogre::Quaternion &orientation)
rviz::Display::context_
DisplayContext * context_
rviz_map_plugin::MeshDisplay::m_tfVertexColorsFilter
tf2_ros::MessageFilter< mesh_msgs::MeshVertexColorsStamped > * m_tfVertexColorsFilter
Messagefilter for vertex colors.
Definition: MeshDisplay.hpp:380
rviz_map_plugin::Color
Struct for colors.
Definition: Types.hpp:144
rviz_map_plugin::MeshDisplay
Display for showing the mesh in different modes.
Definition: MeshDisplay.hpp:128
rviz_map_plugin::MeshDisplay::m_ignoreMsgs
bool m_ignoreMsgs
if set to true, ignore incoming messages and do not use services to request materials
Definition: MeshDisplay.hpp:350
rviz::FrameManager::registerFilterForTransformStatusCheck
void registerFilterForTransformStatusCheck(tf2_ros::MessageFilter< M > *filter, Display *display)
rviz_map_plugin::MeshDisplay::m_uuidClient
ros::ServiceClient m_uuidClient
Client to request the UUID.
Definition: MeshDisplay.hpp:362
rviz_map_plugin::MeshDisplay::m_showWireframe
rviz::BoolProperty * m_showWireframe
Property to select the wireframe.
Definition: MeshDisplay.hpp:464
ROS_ERROR
#define ROS_ERROR(...)
ros::ServiceClient::call
bool call(const MReq &req, MRes &resp, const std::string &service_md5sum)
rviz_map_plugin
Definition: ClusterLabelDisplay.hpp:120
error
KF_EXPORTS void error(const char *error_string, const char *file, const int line, const char *func="")
rviz_map_plugin::MeshDisplay::requestMaterials
void requestMaterials(std::string uuid)
Requests materials from the specified service.
Definition: MeshDisplay.cpp:865
rviz_map_plugin::MeshDisplay::requestVertexColors
void requestVertexColors(std::string uuid)
Requests vertex colors from the specified service.
Definition: MeshDisplay.cpp:835
rviz_map_plugin::Texture::channels
uint8_t channels
Definition: Types.hpp:164
rviz_map_plugin::MeshDisplay::m_wireframeColor
rviz::ColorProperty * m_wireframeColor
Property to set wireframe color.
Definition: MeshDisplay.hpp:467
rviz::IntProperty::getInt
virtual int getInt() const
rviz_map_plugin::MeshDisplay::m_textureClient
ros::ServiceClient m_textureClient
Client to request the textures.
Definition: MeshDisplay.hpp:359
rviz_map_plugin::MeshDisplay::m_normalsColor
rviz::ColorProperty * m_normalsColor
Property to set the color of the normals.
Definition: MeshDisplay.hpp:455
rviz_map_plugin::MeshDisplay::m_costsSynchronizer
message_filters::Cache< mesh_msgs::MeshVertexCostsStamped > * m_costsSynchronizer
Synchronizer for vertex costs.
Definition: MeshDisplay.hpp:392
rviz_map_plugin::MeshDisplay::subscribe
void subscribe()
Set the topics to subscribe.
Definition: MeshDisplay.cpp:258
rviz_map_plugin::MeshDisplay::m_scalingFactor
rviz::FloatProperty * m_scalingFactor
Property to set the size of the normals.
Definition: MeshDisplay.hpp:461
rviz_map_plugin::MeshDisplay::updateVertexCosts
void updateVertexCosts()
Update the vertex costs.
Definition: MeshDisplay.cpp:567
rviz_map_plugin::MeshDisplay::m_colorsSynchronizer
message_filters::Cache< mesh_msgs::MeshVertexColorsStamped > * m_colorsSynchronizer
Synchronizer for vertex colors.
Definition: MeshDisplay.hpp:389
rviz_map_plugin::Texture
Struct for textures.
Definition: Types.hpp:160
rviz_map_plugin::MeshDisplay::m_costUpperLimit
rviz::FloatProperty * m_costUpperLimit
Property for setting the upper limit of cost display.
Definition: MeshDisplay.hpp:449
rviz_map_plugin::MeshDisplay::m_bufferSize
rviz::IntProperty * m_bufferSize
Property to handle buffer size.
Definition: MeshDisplay.hpp:407
rviz_map_plugin::Vertex
Struct for vertices.
Definition: Types.hpp:98
rviz_map_plugin::Vertex::x
float x
Definition: Types.hpp:100
rviz_map_plugin::MeshDisplay::incomingVertexColors
void incomingVertexColors(const mesh_msgs::MeshVertexColorsStamped::ConstPtr &colorsStamped)
Handler for incoming vertex color messages. Validate data and update mesh.
Definition: MeshDisplay.cpp:805
rviz_map_plugin::MeshDisplay::updateNormals
void updateNormals()
Update the mesh normals.
Definition: MeshDisplay.cpp:535
string_property.h
rviz_map_plugin::MeshDisplay::m_showNormals
rviz::BoolProperty * m_showNormals
Property to select the normals.
Definition: MeshDisplay.hpp:452
rviz_map_plugin::MeshDisplay::m_lastUuid
std::string m_lastUuid
Uuid of the last received message.
Definition: MeshDisplay.hpp:398
ROS_INFO
#define ROS_INFO(...)
rviz_map_plugin::MeshDisplay::m_displayType
rviz::EnumProperty * m_displayType
Property to select the display type.
Definition: MeshDisplay.hpp:410
mesh
HalfEdgeMesh< Vec > mesh
rviz_map_plugin::MeshDisplay::incomingVertexCosts
void incomingVertexCosts(const mesh_msgs::MeshVertexCostsStamped::ConstPtr &costsStamped)
Handler for incoming vertex cost messages. Validate data and update mesh.
Definition: MeshDisplay.cpp:823
rviz_map_plugin::MeshDisplay::updateBufferSize
void updateBufferSize()
Updates the buffer size.
Definition: MeshDisplay.cpp:417
rviz_map_plugin::MeshDisplay::ignoreIncomingMessages
void ignoreIncomingMessages()
disables visualization of incoming messages
Definition: MeshDisplay.cpp:320
rviz_map_plugin::Normal
Struct for normals.
Definition: Types.hpp:64
rviz_map_plugin::Face::vertexIndices
array< uint32_t, 3 > vertexIndices
Definition: Types.hpp:108
rviz_map_plugin::MeshDisplay::getLatestVisual
std::shared_ptr< MeshVisual > getLatestVisual()
delivers the latest mesh visual
Definition: MeshDisplay.cpp:964
rviz_map_plugin::MeshDisplay::m_vertexColorsTopic
rviz::RosTopicProperty * m_vertexColorsTopic
Property to handle topic for vertex colors.
Definition: MeshDisplay.hpp:419
color_property.h
rviz::Display::update_nh_
ros::NodeHandle update_nh_
rviz_map_plugin::MeshDisplay::m_tfVertexCostsFilter
tf2_ros::MessageFilter< mesh_msgs::MeshVertexCostsStamped > * m_tfVertexCostsFilter
Messagefilter for vertex costs.
Definition: MeshDisplay.hpp:383
ros_topic_property.h
rviz::ColorProperty::getOgreColor
Ogre::ColourValue getOgreColor() const
rviz_map_plugin::MeshDisplay::onDisable
void onDisable()
RViz callback on disable.
Definition: MeshDisplay.cpp:250
ros::NodeHandle
rviz_map_plugin::MeshDisplay::cacheVertexCosts
void cacheVertexCosts(std::string layer, const std::vector< float > &costs)
Cache function for vertex cost messages.
Definition: MeshDisplay.cpp:944
rviz::IntProperty
rviz_map_plugin::MeshDisplay::m_meshSynchronizer
message_filters::Cache< mesh_msgs::MeshGeometryStamped > * m_meshSynchronizer
Synchronizer for meshMsgs.
Definition: MeshDisplay.hpp:386
rviz_map_plugin::MeshDisplay::m_showTexturedFacesOnly
rviz::BoolProperty * m_showTexturedFacesOnly
Property to only show textured faces when texturizing is enabled.
Definition: MeshDisplay.hpp:425


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