MapDisplay.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  * MapDisplay.cpp
41  *
42  *
43  * authors:
44  *
45  * Kristin Schmidt <krschmidt@uni-osnabrueck.de>
46  * Jan Philipp Vogtherr <jvogtherr@uni-osnabrueck.de>
47  */
48 
49 #include <MapDisplay.hpp>
50 #include <ClusterLabelVisual.hpp>
51 #include <ClusterLabelTool.hpp>
52 
59 
60 #include <rviz/failed_display.h>
61 #include <rviz/display_factory.h>
62 
63 #if defined(WITH_ASSIMP)
64  #include <assimp/Importer.hpp>
65  #include <assimp/postprocess.h>
66  #include <assimp/scene.h>
67 #endif
68 
69 namespace rviz_map_plugin
70 {
72 {
73  m_mapFilePath = new rviz::FileProperty("Map file path", "/path/to/map.h5", "Absolute path of the map file", this,
74  SLOT(updateMap()));
75 }
76 
78 {
79 }
80 
81 // =====================================================================================================================
82 // Public Q_SLOTS
83 
84 std::shared_ptr<Geometry> MapDisplay::getGeometry()
85 {
86  if (!m_geometry)
87  {
88  ROS_ERROR("Map Display: Geometry requested, but none available!");
89  }
90  return m_geometry;
91 }
92 
93 // =====================================================================================================================
94 // Callbacks
95 
96 rviz::Display* MapDisplay::createDisplay(const QString& class_id)
97 {
99  QString error;
100  rviz::Display* disp = factory->make(class_id, &error);
101  if (!disp)
102  {
103  return new rviz::FailedDisplay(class_id, error);
104  }
105  return disp;
106 }
107 
109 {
110  std::string name = this->getName().toStdString();
111 
112  Display* display = createDisplay("rviz_map_plugin/ClusterLabel");
113 
114  m_nh = std::make_shared<ros::NodeHandle>("~");
115  m_nh_p = std::make_shared<ros::NodeHandle>("~");
116 
117  m_clusterLabelDisplay = static_cast<ClusterLabelDisplay*>(display);
118  m_clusterLabelDisplay->setName("ClusterLabel");
123 
124  Display* meshDisplay = createDisplay("rviz_map_plugin/Mesh");
125 
126  m_meshDisplay = static_cast<MeshDisplay*>(meshDisplay);
128  m_meshDisplay->setName("Mesh");
130  m_meshDisplay->setParent(this);
133 
134  // Make signal/slot connections
135  connect(m_clusterLabelDisplay, SIGNAL(signalAddLabel(Cluster)), this, SLOT(saveLabel(Cluster)));
136 }
137 
139 {
142 }
143 
145 {
148 }
149 
150 // =====================================================================================================================
151 // Callbacks triggered from UI events (mostly)
152 
153 void MapDisplay::load(const rviz::Config& config)
154 {
155  std::string name = this->getName().toStdString();
156  std::cout << name << ": LOAD CONFIG..." << std::endl;
157 
158  rviz::Config config2 = config;
159 
160  { // Override with ros params
161  std::stringstream ss;
162  ss << "rviz_map_plugin/" << name;
163 
164  std::string mesh_file;
165  if(m_nh_p->getParam(ss.str(), mesh_file))
166  {
167  config2.mapSetValue(m_mapFilePath->getName(), QString::fromStdString(mesh_file) );
168  } else {
169  std::cout << name << ": COULDN'T FOUND MESH TO LOAD" << std::endl;
170  }
171  }
172 
173  rviz::Display::load(config2);
174 
175  std::cout << name << ": LOAD CONFIG done." << std::endl;
176 }
177 
179 {
180  std::string name = this->getName().toStdString();
181  std::cout << name << ": updateMap" << std::endl;
182 
183  // Load geometry and clusters
184  bool successful = loadData();
185  if (!successful)
186  {
187  return;
188  }
189 
190  // Update sub-plugins
195  for (const auto& vertexCosts : m_costs)
196  {
197  std::vector<float> costs = vertexCosts.second;
198  m_meshDisplay->addVertexCosts(vertexCosts.first, costs);
199  }
201  // m_meshDisplay->setTexCoords(m_texCoords);
202  for (uint32_t i = 0; i < m_textures.size(); i++)
203  {
205  }
207 
208  // All good
210 
212 }
213 
214 // =====================================================================================================================
215 // Data loading
216 
218 {
219 
220 
221  std::string name = this->getName().toStdString();
222  // std::stringstream ss;
223  // ss << "rviz_map_plugin/" << name;
224 
225  // std::string mesh_file;
226  // if(m_nh_p->getParam(ss.str(), mesh_file))
227  // {
228  // std::cout<< name << ": FOUND INITIAL MESH IN PARAMS - " << mesh_file << std::endl;
229  // m_mapFilePath->setFilename(QString::fromStdString(mesh_file));
230  // } else {
231  // std::cout << name << ": COULDN'T FOUND MESH TO LOAD" << std::endl;
232  // }
233 
234 
236  {
237  std::cout << name << "! Tried to load same map twice. Skipping and keeping old data" << std::endl;
238  return true;
239  }
240 
241 
242 
243  // Read map file path
244  std::string mapFile = m_mapFilePath->getFilename();
245  if (mapFile.empty())
246  {
247  ROS_WARN_STREAM("Map Display: No map file path specified!");
248  setStatus(rviz::StatusProperty::Warn, "Map", "No map file path specified!");
249  return false;
250  }
251  if (!boost::filesystem::exists(mapFile))
252  {
253  ROS_WARN_STREAM("Map Display: Specified map file does not exist!");
254  setStatus(rviz::StatusProperty::Warn, "Map", "Specified map file does not exist!");
255  return false;
256  }
257 
258  ROS_INFO_STREAM("Map Display: Loading data for map '" << mapFile << "'");
259 
260  try
261  {
262  if (boost::filesystem::extension(mapFile).compare(".h5") == 0)
263  {
264  ROS_INFO("Map Display: Load HDF5 map");
265  // Open file IO
266  hdf5_map_io::HDF5MapIO map_io(mapFile);
267 
268  ROS_INFO("Map Display: Load geometry");
269 
270  // Read geometry
271  m_geometry = std::make_shared<Geometry>(Geometry(map_io.getVertices(), map_io.getFaceIds()));
272 
273  ROS_INFO("Map Display: Load textures");
274 
275  // Read textures
276  vector<hdf5_map_io::MapImage> textures = map_io.getTextures();
277  m_textures.resize(textures.size());
278  for (size_t i = 0; i < textures.size(); i++)
279  {
280  // Find out the texture index because textures are not stored in ascending order
281  int textureIndex = std::stoi(textures[i].name);
282 
283  // Copy metadata
284  m_textures[textureIndex].width = textures[i].width;
285  m_textures[textureIndex].height = textures[i].height;
286  m_textures[textureIndex].channels = textures[i].channels;
287  m_textures[textureIndex].data = textures[i].data;
288  m_textures[textureIndex].pixelFormat = "rgb8";
289  }
290 
291  ROS_INFO("Map Display: Load materials");
292 
293  // Read materials
294  vector<hdf5_map_io::MapMaterial> materials = map_io.getMaterials();
295  vector<uint32_t> faceToMaterialIndexArray = map_io.getMaterialFaceIndices();
296  m_materials.resize(materials.size());
297  for (size_t i = 0; i < materials.size(); i++)
298  {
299  // Copy material color
300  m_materials[i].color.r = materials[i].r / 255.0f;
301  m_materials[i].color.g = materials[i].g / 255.0f;
302  m_materials[i].color.b = materials[i].b / 255.0f;
303  m_materials[i].color.a = 1.0f;
304 
305  // Look for texture index
306  if (materials[i].textureIndex == -1)
307  {
308  // texture index -1: no texture
309  m_materials[i].textureIndex = boost::none;
310  }
311  else
312  {
313  m_materials[i].textureIndex = materials[i].textureIndex;
314  }
315 
316  m_materials[i].faceIndices.clear();
317  }
318 
319  // Copy face indices
320  for (size_t k = 0; k < faceToMaterialIndexArray.size(); k++)
321  {
322  m_materials[faceToMaterialIndexArray[k]].faceIndices.push_back(k);
323  }
324 
325  ROS_INFO("Map Display: Load vertex colors");
326 
327  // Read vertex colors
328  vector<uint8_t> colors = map_io.getVertexColors();
329  m_colors.clear();
330  m_colors.reserve(colors.size() / 3);
331  for (size_t i = 0; i < colors.size(); i += 3)
332  {
333  // convert from 0-255 (uint8) to 0.0-1.0 (float)
334  m_colors.push_back(Color(colors[i + 0] / 255.0f, colors[i + 1] / 255.0f, colors[i + 2] / 255.0f, 1.0));
335  }
336 
337  ROS_INFO("Map Display: Load vertex normals");
338 
339  // Read vertex normals
340  vector<float> normals = map_io.getVertexNormals();
341  m_normals.clear();
342  m_normals.reserve(normals.size() / 3);
343  for (size_t i = 0; i < normals.size(); i += 3)
344  {
345  m_normals.push_back(Normal(normals[i + 0], normals[i + 1], normals[i + 2]));
346  }
347 
348  ROS_INFO("Map Display: Load texture coordinates");
349 
350  // Read tex cords
351  vector<float> texCoords = map_io.getVertexTextureCoords();
352  m_texCoords.clear();
353  m_texCoords.reserve(texCoords.size() / 3);
354  for (size_t i = 0; i < texCoords.size(); i += 3)
355  {
356  m_texCoords.push_back(TexCoords(texCoords[i], texCoords[i + 1]));
357  }
358 
359  ROS_INFO("Map Display: Load clusters");
360 
361  // Read labels
362  m_clusterList.clear();
363  // m_clusterList.push_back(Cluster("__NEW__", vector<uint32_t>()));
364  for (auto labelGroup : map_io.getLabelGroups())
365  {
366  for (auto labelObj : map_io.getAllLabelsOfGroup(labelGroup))
367  {
368  auto faceIds = map_io.getFaceIdsOfLabel(labelGroup, labelObj);
369 
370  std::stringstream ss;
371  ss << labelGroup << "_" << labelObj;
372  std::string label = ss.str();
373 
374  m_clusterList.push_back(Cluster(label, faceIds));
375  }
376  }
377 
378  m_costs.clear();
379  for (std::string costlayer : map_io.getCostLayers())
380  {
381  try
382  {
383  m_costs[costlayer] = map_io.getVertexCosts(costlayer);
384  }
385  catch (const hf::DataSpaceException& e)
386  {
387  ROS_WARN_STREAM("Could not load channel " << costlayer << " as a costlayer!");
388  }
389  }
390  }
391  #if defined(WITH_ASSIMP)
392  else
393  {
394  std::cout << "LOADING WITH ASSIMP" << std::endl;
395  // PLY, OBJ, DAE? -> ASSIMP
396  // The following lines are a simple way to import the mesh geometry
397  // of commonly used mesh file formats.
398  //
399  // TODOs:
400  // 1. scene graphs will not be imported properly.
401  // Someone has to do some transformations according to the
402  // node graph in the assimp structures. Or optionally (even better):
403  // create tf-transformations for every element of the scene graph
404  //
405  Assimp::Importer io;
406  io.SetPropertyBool(AI_CONFIG_IMPORT_COLLADA_IGNORE_UP_DIRECTION, true);
407 
408  // with aiProcess_PreTransformVertices assimp transforms the whole scene graph
409  // into one mesh
410  // - if you want to use TF for spawning meshes, the loading has to be done manually
411  const aiScene* ascene = io.ReadFile(mapFile, aiProcess_PreTransformVertices);
412  // what if there is more than one mesh?
413  const aiMesh* amesh = ascene->mMeshes[0];
414 
415  const aiVector3D* ai_vertices = amesh->mVertices;
416  const aiFace* ai_faces = amesh->mFaces;
417 
418  m_geometry = std::make_shared<Geometry>();
419 
420  m_geometry->vertices.resize(amesh->mNumVertices);
421  m_geometry->faces.resize(amesh->mNumFaces);
422 
423  for (int i = 0; i < amesh->mNumVertices; i++)
424  {
425  m_geometry->vertices[i].x = amesh->mVertices[i].x;
426  m_geometry->vertices[i].y = amesh->mVertices[i].y;
427  m_geometry->vertices[i].z = amesh->mVertices[i].z;
428  }
429 
430  for (int i = 0; i < amesh->mNumFaces; i++)
431  {
432  m_geometry->faces[i].vertexIndices[0] = amesh->mFaces[i].mIndices[0];
433  m_geometry->faces[i].vertexIndices[1] = amesh->mFaces[i].mIndices[1];
434  m_geometry->faces[i].vertexIndices[2] = amesh->mFaces[i].mIndices[2];
435  }
436  }
437  #endif // defined(WITH_ASSIMP)
438  }
439  catch (...)
440  {
441  ROS_ERROR_STREAM("An unexpected error occurred while using Pluto Map IO");
442  setStatus(rviz::StatusProperty::Error, "IO", "An unexpected error occurred while using Pluto Map IO");
443  return false;
444  }
445 
447 
448  ROS_INFO("Map Display: Successfully loaded map.");
449 
450  return true;
451 }
452 
453 // =====================================================================================================================
454 // Label
455 
457 {
458  std::string label = cluster.name;
459  std::vector<uint32_t> faces = cluster.faces;
460 
461  ROS_INFO_STREAM("Map Display: add label '" << label << "'");
462 
463  try
464  {
465  // Split label into class and instance (tree_1 => class "tree" & instance "1")
466  std::vector<std::string> results;
467  boost::split(results, label, [](char c) { return c == '_'; });
468  if (results.size() != 2)
469  {
470  ROS_ERROR_STREAM("Map Display: Illegal label name '" << label << "'");
471  setStatus(rviz::StatusProperty::Error, "Label", "Illegal label name!");
472  return;
473  }
474 
475  // Open IO
477 
478  // Add label with faces list
479  map_io.addOrUpdateLabel(results[0], results[1], faces);
480 
481  // Add to cluster list
482  m_clusterList.push_back(Cluster(label, faces));
483 
484  setStatus(rviz::StatusProperty::Ok, "Label", "Successfully saved label");
485  ROS_INFO_STREAM("Map Display: Successfully added label to map.");
486 
487  // update the map to show the new label
488  updateMap();
489  }
490  catch (...)
491  {
492  setStatus(rviz::StatusProperty::Error, "Label", "Error while saving label");
493  }
494 }
495 
496 } // End namespace rviz_map_plugin
497 
hdf5_map_io::HDF5MapIO::getMaterials
std::vector< MapMaterial > getMaterials()
hdf5_map_io::HDF5MapIO::getLabelGroups
std::vector< std::string > getLabelGroups()
rviz_map_plugin::ClusterLabelDisplay::onDisable
void onDisable()
RViz callback on disable.
Definition: ClusterLabelDisplay.cpp:169
hdf5_map_io::HDF5MapIO::getMaterialFaceIndices
std::vector< uint32_t > getMaterialFaceIndices()
rviz_map_plugin::MeshDisplay::addTexture
void addTexture(Texture &texture, uint32_t textureIndex)
Add a texture.
Definition: MeshDisplay.cpp:395
rviz_map_plugin::TexCoords
Struct for texture coordinates.
Definition: Types.hpp:76
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::Display::initialize
void initialize(DisplayContext *context)
rviz_map_plugin::MapDisplay::m_mapFilePath
rviz::FileProperty * m_mapFilePath
Path to map file.
Definition: MapDisplay.hpp:221
ROS_ERROR_STREAM
#define ROS_ERROR_STREAM(args)
hdf5_map_io::HDF5MapIO::getFaceIds
std::vector< uint32_t > getFaceIds()
rviz::Display::Display
Display()
rviz_map_plugin::MapDisplay::updateMap
void updateMap()
Update the map, based on the current data state.
Definition: MapDisplay.cpp:178
rviz_map_plugin::MapDisplay::m_nh_p
std::shared_ptr< ros::NodeHandle > m_nh_p
Definition: MapDisplay.hpp:218
rviz::StatusProperty::Error
Error
rviz_map_plugin::MeshDisplay::setGeometry
void setGeometry(shared_ptr< Geometry > geometry)
Set the geometry.
Definition: MeshDisplay.cpp:336
hdf5_map_io::HDF5MapIO::getAllLabelsOfGroup
std::vector< std::string > getAllLabelsOfGroup(std::string groupName)
rviz_map_plugin::ClusterLabelDisplay::onEnable
void onEnable()
RViz callback on enable.
Definition: ClusterLabelDisplay.cpp:164
rviz_map_plugin::MapDisplay::m_colors
vector< Color > m_colors
Colors.
Definition: MapDisplay.hpp:207
int_property.h
rviz::FailedDisplay
rviz_map_plugin::MeshDisplay::setVertexNormals
void setVertexNormals(vector< Normal > &vertexNormals)
Set the vertex normals.
Definition: MeshDisplay.cpp:372
rviz_map_plugin::MapDisplay::getGeometry
shared_ptr< Geometry > getGeometry()
Get the geometry.
Definition: MapDisplay.cpp:84
rviz::Property::addChild
virtual void addChild(Property *child, int index=-1)
rviz::DisplayContext::getDisplayFactory
virtual DisplayFactory * getDisplayFactory() const=0
hdf5_map_io::HDF5MapIO::getFaceIdsOfLabel
std::vector< uint32_t > getFaceIdsOfLabel(std::string groupName, std::string labelName)
enum_property.h
rviz_map_plugin::MapDisplay::~MapDisplay
~MapDisplay()
Destructor.
Definition: MapDisplay.cpp:77
rviz_map_plugin::MapDisplay::m_textures
vector< Texture > m_textures
Textures.
Definition: MapDisplay.hpp:205
rviz_map_plugin::MapDisplay::m_materials
vector< Material > m_materials
Materials.
Definition: MapDisplay.hpp:203
hdf5_map_io::HDF5MapIO::getCostLayers
std::vector< std::string > getCostLayers()
float_property.h
f
f
rviz_map_plugin::MapDisplay::MapDisplay
MapDisplay()
Constructor.
Definition: MapDisplay.cpp:71
rviz::Display
MapDisplay.hpp
rviz_map_plugin::Cluster::name
string name
Definition: Types.hpp:89
rviz_map_plugin::MapDisplay::m_normals
vector< Normal > m_normals
Vertex normals.
Definition: MapDisplay.hpp:209
ClusterLabelVisual.hpp
class_list_macros.h
rviz_map_plugin::ClusterLabelDisplay
Display class for the map plugin.
Definition: ClusterLabelDisplay.hpp:136
rviz::Display::setStatus
virtual void setStatus(StatusProperty::Level level, const QString &name, const QString &text)
ROS_WARN_STREAM
#define ROS_WARN_STREAM(args)
rviz_map_plugin::MapDisplay::m_meshDisplay
rviz_map_plugin::MeshDisplay * m_meshDisplay
Subdisplay: MeshDisplay (for showing the mesh)
Definition: MapDisplay.hpp:227
bool_property.h
hdf5_map_io::HDF5MapIO::getVertexCosts
std::vector< float > getVertexCosts(std::string costlayer)
PLUGINLIB_EXPORT_CLASS
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
rviz_map_plugin::MapDisplay::m_clusterLabelDisplay
rviz_map_plugin::ClusterLabelDisplay * m_clusterLabelDisplay
Subdisplay: ClusterLabel (for showing the clusters)
Definition: MapDisplay.hpp:225
rviz::FileProperty::getFilename
std::string getFilename()
Definition: RvizFileProperty.hpp:64
rviz_map_plugin::MapDisplay::m_geometry
shared_ptr< Geometry > m_geometry
Geometry.
Definition: MapDisplay.hpp:201
hdf5_map_io::HDF5MapIO::getVertexNormals
std::vector< float > getVertexNormals()
rviz_map_plugin::MeshDisplay::clearVertexCosts
void clearVertexCosts()
Clears the vertex costs.
Definition: MeshDisplay.cpp:360
rviz_map_plugin::MapDisplay::m_costs
std::map< std::string, std::vector< float > > m_costs
Definition: MapDisplay.hpp:215
rviz_map_plugin::Geometry
Struct for geometry.
Definition: Types.hpp:112
rviz::Property::connect
std::enable_if<!QtPrivate::FunctionPointer< Func >::IsPointerToMemberFunction, QMetaObject::Connection >::type connect(const QObject *context, Func &&slot, Qt::ConnectionType type=Qt::AutoConnection)
failed_display.h
rviz::StatusProperty::Ok
Ok
rviz::StatusProperty::Warn
Warn
rviz_map_plugin::MeshDisplay::onEnable
void onEnable()
RViz callback on enable.
Definition: MeshDisplay.cpp:241
rviz::Property::model_
PropertyTreeModel * model_
hdf5_map_io::HDF5MapIO::getVertexTextureCoords
std::vector< float > getVertexTextureCoords()
hdf5_map_io::HDF5MapIO::getTextures
std::vector< MapImage > getTextures()
rviz_map_plugin::MapDisplay::createDisplay
rviz::Display * createDisplay(const QString &class_id)
Create a RViz display from it's unique class_id.
Definition: MapDisplay.cpp:96
rviz_map_plugin::ClusterLabelDisplay::setData
void setData(shared_ptr< Geometry > geometry, vector< Cluster > clusters)
Setter for the geometry and cluster data.
Definition: ClusterLabelDisplay.cpp:132
rviz::Display::load
void load(const Config &config) override
ClassIdRecordingFactory< Display >::make
virtual Display * make(const QString &class_id, QString *error_return=nullptr)
ROS_INFO_STREAM
#define ROS_INFO_STREAM(args)
rviz::FileProperty
Definition: RvizFileProperty.hpp:56
rviz_map_plugin::MapDisplay::m_texCoords
vector< TexCoords > m_texCoords
Texture coordinates.
Definition: MapDisplay.hpp:211
colors
colors
rviz_map_plugin::MeshDisplay::setMaterials
void setMaterials(vector< Material > &materials, vector< TexCoords > &texCoords)
Set the materials and texture coordinates.
Definition: MeshDisplay.cpp:385
ClusterLabelTool.hpp
rviz_map_plugin::MapDisplay::onEnable
void onEnable()
RViz callback on enable.
Definition: MapDisplay.cpp:138
rviz::Display::setName
void setName(const QString &name) override
rviz::DisplayFactory
hdf5_map_io::HDF5MapIO
rviz_map_plugin::MapDisplay::load
virtual void load(const rviz::Config &config)
Definition: MapDisplay.cpp:153
rviz_map_plugin::MapDisplay::onDisable
void onDisable()
RViz callback on disable.
Definition: MapDisplay.cpp:144
rviz::Property::getName
virtual QString getName() const
rviz::Display::context_
DisplayContext * context_
rviz_map_plugin::Color
Struct for colors.
Definition: Types.hpp:144
rviz::Property::setParent
void setParent(Property *new_parent)
hdf5_map_io::HDF5MapIO::getVertexColors
std::vector< uint8_t > getVertexColors()
rviz_map_plugin::MeshDisplay
Display for showing the mesh in different modes.
Definition: MeshDisplay.hpp:128
rviz_map_plugin::Cluster::faces
vector< uint32_t > faces
Definition: Types.hpp:90
ROS_ERROR
#define ROS_ERROR(...)
hdf5_map_io::HDF5MapIO::getVertices
std::vector< float > getVertices()
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="")
display_factory.h
rviz_map_plugin::MapDisplay::saveLabel
void saveLabel(Cluster cluster)
Saves a label to HDF5.
Definition: MapDisplay.cpp:456
rviz_map_plugin::MapDisplay::m_clusterList
vector< Cluster > m_clusterList
Clusters.
Definition: MapDisplay.hpp:213
rviz_map_plugin::MapDisplay::onInitialize
void onInitialize()
RViz callback on initialize.
Definition: MapDisplay.cpp:108
string_property.h
ROS_INFO
#define ROS_INFO(...)
config
config
rviz_map_plugin::MapDisplay
Master display for the Mesh- and Cluster- subdisplays. THis implementation uses HDF5 as it's data sou...
Definition: MapDisplay.hpp:139
rviz_map_plugin::MeshDisplay::ignoreIncomingMessages
void ignoreIncomingMessages()
disables visualization of incoming messages
Definition: MeshDisplay.cpp:320
rviz_map_plugin::Cluster
Struct for clusters.
Definition: Types.hpp:87
rviz_map_plugin::Normal
Struct for normals.
Definition: Types.hpp:64
rviz_map_plugin::MapDisplay::m_nh
std::shared_ptr< ros::NodeHandle > m_nh
Definition: MapDisplay.hpp:217
rviz::Config
color_property.h
rviz_map_plugin::MapDisplay::loadData
bool loadData()
Read all data from the HDF5 file and save it in the member variables.
Definition: MapDisplay.cpp:217
rviz::Property::setModel
void setModel(PropertyTreeModel *model)
hdf5_map_io::HDF5MapIO::addOrUpdateLabel
void addOrUpdateLabel(std::string groupName, std::string labelName, std::vector< uint32_t > &faceIds)
rviz::Config::mapSetValue
void mapSetValue(const QString &key, const QVariant &value)
rviz_map_plugin::MeshDisplay::onDisable
void onDisable()
RViz callback on disable.
Definition: MeshDisplay.cpp:250
rviz_map_plugin::MapDisplay::m_map_file_loaded
std::string m_map_file_loaded
Definition: MapDisplay.hpp:222


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