face_selection_tool.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  * face_selection_tool.cpp
41  *
42  * authors: Henning Deeken <hdeeken@uos.de>
43  * Sebastian Pütz <spuetz@uos.de>
44  * Tristan Igelbrink <tigelbri@uos.de>
45  * Johannes Heitmann <joheitma@uos.de>
46  * Marcel Mrozinski <mmronzs@uos.de
47  *
48  */
49 
50 
51 #include "face_selection_tool.h"
53 
56 
57 namespace rviz_mesh_plugin
58 {
59 const float FaceSelectionTool::BOX_SIZE_TOLERANCE = 0.0001;
60 const size_t FaceSelectionTool::MAXIMUM_PICKED_FACES = 10000;
61 
63 {
64  shortcut_key_ = 'l';
65  num_results = 10;
66  has_mesh = false;
67  m_singleSelect = false;
68  m_singleDeselect = false;
69 
71  "Mesh Topic",
72  "segment_mesh",
73  QString::fromStdString(ros::message_traits::datatype<mesh_msgs::TriangleMeshStamped>()),
74  "Mesh topic to subscribe to.",
76  SLOT( updateTopic() ),
77  this
78  );
79 }
80 
82 {
83  for (std::map<size_t, std::vector<size_t> >::iterator it = m_goalFaces.begin();
84  it != m_goalFaces.end(); it++)
85  {
86  it->second.clear();
87  }
88  m_goalFaces.clear();
89  scene_manager->destroyManualObject("ReferenceMesh2");
90  scene_manager->destroyManualObject("SegmentedMesh2");
91  scene_manager->destroySceneNode(scene_node);
92 }
93 
95  //if(mesh_topic->getTopic() != QString::fromStdString(mesh_sub.getTopic())){
96  ROS_INFO("updated topic");
98  mesh_sub = n.subscribe(mesh_topic->getTopic().toStdString(), 1, &FaceSelectionTool::meshCb, this);
99  reference_mesh->clear();
100  has_mesh = false;
102  //}
103 }
104 
105 // onInitialize() is called by the superclass after scene_manager_ and
106 // context_ are set. It should be called only once per instantiation.
108 {
109  ROS_INFO("Call Init");
110 
111  initNode();
112  initOgre();
113  updateTopic();
114 }
115 
117 {
119  Ogre::SceneNode* rootNode = scene_manager->getRootSceneNode();
120  scene_node = rootNode->createChildSceneNode();
121 
122  // create reference mesh object and pass
123  reference_mesh = scene_manager->createManualObject("ReferenceMesh2");
124  reference_mesh->setDynamic(false);
125  reference_mesh->setVisible(true);
126  scene_node->attachObject(reference_mesh);
127 
128  reference_mesh_material = Ogre::MaterialManager::getSingleton()
129  .create("ReferenceMeshMaterial2", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, true);
130  Ogre::Technique* ref_tech = reference_mesh_material->getTechnique(0);
131  ref_tech->removeAllPasses();
132 
133  Ogre::Pass* ref_pass = ref_tech->createPass();
134  ref_pass->setAmbient( Ogre::ColourValue(reference_color_r, reference_color_g, reference_color_b, reference_color_a) );
135  ref_pass->setDiffuse(0,0,0,reference_color_a);
136  ref_pass->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
137  ref_pass->setDepthWriteEnabled(false);
138  ref_pass->setPolygonMode(Ogre::PM_SOLID);
139  ref_pass->setCullingMode(Ogre::CULL_NONE);
140 
141  // create segmented mesh object and pass
142  segment_mesh = scene_manager->createManualObject("SegmentedMesh2");
143  segment_mesh->setDynamic(false);
144  scene_node->attachObject(segment_mesh);
145 
146  segment_mesh_material = Ogre::MaterialManager::getSingleton()
147  .create("SegmentMatrial2", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, true);
148  Ogre::Technique* seg_tech = segment_mesh_material->getTechnique(0);
149  seg_tech->removeAllPasses();
150  Ogre::Pass* seg_pass = seg_tech->createPass();
151 
152  seg_pass->setAmbient( Ogre::ColourValue(segment_color_r, segment_color_g, segment_color_b, segment_color_a) );
153  seg_pass->setDiffuse(0,0,0, segment_color_a);
154  seg_pass->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
155  seg_pass->setDepthWriteEnabled(false);
156  seg_pass->setPolygonMode(Ogre::PM_SOLID);
157  seg_pass->setCullingMode(Ogre::CULL_NONE);
158 }
159 
161 {
162  mesh_sub = n.subscribe( "segment_mesh", 1, &FaceSelectionTool::meshCb, this);
163  mesh_pub = n.advertise<mesh_msgs::TriangleMeshStamped>( "segmented_mesh", 1, true);
164 
165  id_pub = n.advertise<std_msgs::Int32>( "selected_face_id", 1, true);
166  goal_pub = n.advertise<geometry_msgs::PoseStamped>( "goal", 1, true );
167 }
168 
169 
170 void FaceSelectionTool::meshCb(const mesh_msgs::TriangleMeshStamped::ConstPtr& mesh)
171 {
172  if(!has_mesh)
173  {
174  setReferenceMesh(mesh->mesh);
175  setTransform(*mesh);
176  has_mesh = true;
177  }
178 }
179 
181 {
182 }
183 
185 {
186 }
187 
188 void FaceSelectionTool::setTransform(const mesh_msgs::TriangleMeshStamped &mesh){
189  Ogre::Quaternion orientation;
190  Ogre::Vector3 position;
191 
192  if(!context_->getFrameManager()->getTransform(mesh.header.frame_id,
193  mesh.header.stamp,
194  position, orientation))
195  {
196  ROS_ERROR("Error transforming from frame '%s' to the fixed_frame",
197  mesh.header.frame_id.c_str());
198  return;
199  }
200 
201  scene_node->setPosition(position);
202  scene_node->setOrientation(orientation);
203 }
204 
205 void FaceSelectionTool::setReferenceMesh( mesh_msgs::TriangleMesh mesh )
206 {
207  clearSelection();
208  reference_mesh->begin("ReferenceMeshMaterial2", Ogre::RenderOperation::OT_TRIANGLE_LIST);
209 
210  for ( size_t i = 0; i < mesh.vertices.size(); i++ )
211  {
212  reference_mesh->position(mesh.vertices[i].x, mesh.vertices[i].y, mesh.vertices[i].z);
213  }
214 
215  for ( size_t i = 0; i < mesh.triangles.size(); i++ )
216  {
217  reference_mesh->triangle( mesh.triangles[i].vertex_indices[0], mesh.triangles[i].vertex_indices[1], mesh.triangles[i].vertex_indices[2] );
218  }
219 
220  reference_mesh->end();
221 }
222 
223 void FaceSelectionTool::getSegmentMesh(mesh_msgs::TriangleMesh &mesh) //size_t goalSection, std::string regionLabel
224 {
225  size_t numSections = segment_mesh->getNumSections();
226  //ROS_INFO("Mesh has %d sections, we only take the first", numSections);
227 
228  size_t vertexCount;
229  Ogre::Vector3* vertices;
230  size_t indexCount;
231  unsigned long* indices;
232 
233  if(numSections > 0)
234  {
235  getRawManualObjectData(segment_mesh, 0, vertexCount, vertices, indexCount, indices);
236  //ROS_INFO("#vert %d #ind %d", vertexCount, indexCount );
237 
238  geometry_msgs::Point vertex;
239  mesh_msgs::TriangleIndices index;
240  for ( size_t i = 0; i < vertexCount; i++ )
241  {
242  vertex.x = vertices[i].x;
243  vertex.y = vertices[i].y;
244  vertex.z = vertices[i].z;
245  mesh.vertices.push_back(vertex);
246  }
247 
248  for ( size_t i = 0; i < indexCount; i+=3 )
249  {
250  index.vertex_indices[0] = indices[i];
251  index.vertex_indices[1] = indices[i+1];
252  index.vertex_indices[2] = indices[i+2];
253  mesh.triangles.push_back(index);
254  }
255  }
256 }
257 
259 {
260  segment_mesh->clear();
261  for (std::map<size_t, std::vector<size_t> >::iterator it = m_goalFaces.begin(); it != m_goalFaces.end(); it++)
262  {
263  it->second.clear();
264  }
265  m_goalFaces.clear();
266 }
267 
269 {
270  return (m_goalFaces.size() > 0);
271 }
272 
274 {
275  size_t facesSize = 0;
276  size_t vertexCount = 0;
277  Ogre::Vector3* vertices;
278  size_t indexCount = 0;
279  unsigned long* indices;
280  segment_mesh->clear();
281  Ogre::ManualObject* mesh = context_->getSceneManager()->getManualObject("ReferenceMesh2");
282  segment_mesh->begin("SegmentMatrial2", Ogre::RenderOperation::OT_TRIANGLE_LIST);
283  for (std::map<size_t, std::vector<size_t> >::iterator it = m_goalFaces.begin(); it != m_goalFaces.end(); it++)
284  {
285  getRawManualObjectData(mesh, it->first, vertexCount, vertices, indexCount, indices);
286  facesSize += it->second.size();
287 
288  for (size_t j = 0; j < it->second.size(); j++)
289  {
290  segment_mesh->position(vertices[indices[it->second[j]]].x,
291  vertices[indices[it->second[j]]].y,
292  vertices[indices[it->second[j]]].z);
293  segment_mesh->position(vertices[indices[it->second[j] + 1]].x,
294  vertices[indices[it->second[j] + 1]].y,
295  vertices[indices[it->second[j] + 1]].z);
296  segment_mesh->position(vertices[indices[it->second[j] + 2]].x,
297  vertices[indices[it->second[j] + 2]].y,
298  vertices[indices[it->second[j] + 2]].z);
299  }
300  delete[] vertices;
301  delete[] indices;
302  }
303 
304  for (size_t j = 0; j < facesSize; j++)
305  {
306  segment_mesh->triangle(3 * j, 3 * j + 2, 3 * j + 1);
307  }
308  segment_mesh->end();
309 }
310 
311 // Handling key events to label marked faces or to get db structure
313 {
314  if (event->key() == Qt::Key_K)
315  {
316  ROS_INFO("IDS..");
317  for (std::map<size_t, std::vector<size_t> >::iterator it = m_goalFaces.begin(); it != m_goalFaces.end(); it++)
318  {
319  for (size_t j = 0; j < it->second.size(); j++)
320  {
321  ROS_INFO("ID: %lu", it->second[j]);
322  }
323  }
324  }
325  /*
326  mesh_msgs::TriangleMeshStamped mesh;
327  getSegmentMesh(mesh.mesh);
328  mesh.header.frame_id = "world";
329  mesh.header.stamp = ros::Time::now();
330  mesh_pub.publish( mesh );
331  */
332 
333  // if 'r' is pressed clear the current selection of faces
334  if (event->key() == Qt::Key_R)
335  {
336  clearSelection();
337  }
338 
339  if (event->key() == Qt::Key_T)
340  {
341  reference_mesh->setVisible( !reference_mesh->isVisible() );
342  segment_mesh->setVisible( !segment_mesh->isVisible() );
343  }
344 
345  return Render;
346 }
347 
348 // Handling mouse event and mark the clicked faces
350 {
351 
352  if (event.leftDown())
353  {
354  m_singleSelect = true;
355  selectSingleFace(event);
356  }
357 
358  else if (event.leftUp())
359  {
360  m_singleSelect = false;
361  selectSingleFace(event);
362  }
363 
364  else if (m_singleSelect)
365  {
366  selectSingleFace(event);
367  }
368 
369  else if (event.rightDown())
370  {
371  m_singleDeselect = true;
372  deselectSingleFace(event);
373  }
374 
375  else if (event.rightUp())
376  {
377  m_singleDeselect = false;
378  deselectSingleFace(event);
379  }
380 
381  else if (m_singleDeselect)
382  {
383  deselectSingleFace(event);
384  }
385 
386  return Render;
387 }
388 
389 // test whether a single ray intersects with the reference mesh
390 // by checking if the reference mesh is within the num_results closest targets
391 // num_results must be >= 2 to allow labeling direct sight, higher allows to label trough objects... unsure if that is desirable
392 bool FaceSelectionTool::singleRayQuery(rviz::ViewportMouseEvent& event, int num_results, Ogre::Ray& ray)
393 {
394  ray = event.viewport->getCamera()->getCameraToViewportRay((float) event.x / event.viewport->getActualWidth(),
395  (float) event.y / event.viewport->getActualHeight());
396  Ogre::RaySceneQuery* query = context_->getSceneManager()->createRayQuery(ray, Ogre::SceneManager::WORLD_GEOMETRY_TYPE_MASK);
397  query-> setSortByDistance(true, num_results);
398  query->execute();
399  Ogre::RaySceneQueryResult &results = query->getLastResults();
400 
401  for (size_t i = 0; i < results.size(); i++)
402  {
403 
404  Ogre::ManualObject* mesh = static_cast<Ogre::ManualObject*>(results[i].movable);
405  //ROS_INFO("%s", mesh->getName().c_str() );
406  if (mesh->getName().find("ReferenceMesh") != std::string::npos)
407  {
408  return true;
409  }
410  }
411  return false;
412 }
413 
415 {
416  Ogre::Ray ray;
417  size_t goalSection = -1 ;
418  size_t goalIndex = -1;
419  Ogre::Real dist = -1;
420 
421  if ( singleRayQuery( event, num_results, ray) )
422  {
423  getIdentityOfSingleFace(reference_mesh, ray, goalSection, goalIndex, dist);
424 
425  if (goalIndex != -1)
426  {
427 
428  std_msgs::Int32 index;
429  index.data = goalIndex / 3;
430  id_pub.publish(index);
431 
432 
433  Ogre::Vector3 goal = ray.getPoint(dist);
434  geometry_msgs::PoseStamped goal_msg;
435  goal_msg.header.stamp = ros::Time::now();
436  goal_msg.header.frame_id = context_->getFixedFrame().toStdString();
437  goal_msg.pose.position.x = goal.x;
438  goal_msg.pose.position.y = goal.y;
439  goal_msg.pose.position.z = goal.z;
440 
441  goal_pub.publish(goal_msg);
442 
443  if (m_goalFaces.find( goalSection ) == m_goalFaces.end())
444  {
445  std::vector<size_t> faces;
446  m_goalFaces.insert( std::pair<size_t, std::vector<size_t> >( goalSection, faces ) );
447  }
448  m_goalFaces[goalSection].push_back(goalIndex);
449  std::sort( m_goalFaces[goalSection].begin(), m_goalFaces[goalSection].end() );
450  m_goalFaces[goalSection].erase( std::unique( m_goalFaces[goalSection].begin(),
451  m_goalFaces[goalSection].end() ),
452  m_goalFaces[goalSection].end() );
454  }
455  }
456 }
457 
459 {
460  Ogre::Ray ray;
461  size_t goalSection = -1 ;
462  size_t goalIndex = -1;
463  Ogre::Real dist = -1;
464 
465  if ( singleRayQuery( event, num_results, ray) )
466  {
467  getIdentityOfSingleFace(reference_mesh, ray, goalSection, goalIndex, dist);
468 
469  if (m_goalFaces.find(goalSection) != m_goalFaces.end())
470  {
471  if (std::find(m_goalFaces[goalSection].begin(),
472  m_goalFaces[goalSection].end(),
473  goalIndex) != m_goalFaces[goalSection].end())
474  {
475  m_goalFaces[goalSection].erase(std::find(m_goalFaces[goalSection].begin(),
476  m_goalFaces[goalSection].end(),
477  goalIndex));
478  if (m_goalFaces[goalSection].size() < 1)
479  {
480  m_goalFaces.erase(goalSection);
481  }
483  }
484  }
485  }
486 }
487 
488 void FaceSelectionTool::getIdentityOfSingleFace(Ogre::ManualObject* mesh,
489  Ogre::Ray &ray,
490  size_t &goalSection,
491  size_t &goalIndex,
492  Ogre::Real& closestDistance)
493 {
494  closestDistance = -1.0f;
495  size_t vertexCount = 0;
496  Ogre::Vector3* vertices;
497  size_t indexCount = 0;
498  unsigned long* indices;
499  size_t numSections = mesh->getNumSections();
500 
501  for (size_t i = 0; i < numSections; i++)
502  {
503  getRawManualObjectData(mesh, i, vertexCount, vertices, indexCount, indices);
504  if(indexCount != 0)
505  {
506  for (size_t j = 0; j < indexCount; j += 3)
507  {
508  std::pair<bool, Ogre::Real> goal =
509  Ogre::Math::intersects(
510  ray,
511  vertices[indices[j]],
512  vertices[indices[j + 1]],
513  vertices[indices[j + 2]],
514  true,
515  true);
516 
517  if (goal.first)
518  {
519  if ((closestDistance < 0.0f) || (goal.second < closestDistance))
520  {
521  closestDistance = goal.second;
522  goalIndex = j;
523  goalSection = i;
524  }
525  }
526  }
527  }
528 
529  delete[] vertices;
530  delete[] indices;
531  }
532 }
533 
534 void FaceSelectionTool::getRawManualObjectData(Ogre::ManualObject *mesh,
535  size_t sectionNumber,
536  size_t &vertexCount,
537  Ogre::Vector3* &vertices,
538  size_t &indexCount,
539  unsigned long* &indices)
540 {
541  Ogre::VertexData* vertexData;
542  const Ogre::VertexElement* vertexElement;
543  Ogre::HardwareVertexBufferSharedPtr vertexBuffer;
544  unsigned char* vertexChar;
545  float* vertexFloat;
546 
547  vertexData = mesh->getSection(sectionNumber)->getRenderOperation()->vertexData;
548  vertexElement = vertexData->vertexDeclaration->findElementBySemantic(Ogre::VES_POSITION);
549  vertexBuffer = vertexData->vertexBufferBinding->getBuffer(vertexElement->getSource());
550  vertexChar = static_cast<unsigned char*>(vertexBuffer->lock(Ogre::HardwareBuffer::HBL_READ_ONLY));
551 
552  vertexCount = vertexData->vertexCount;
553  vertices = new Ogre::Vector3[vertexCount];
554 
555  for (size_t i = 0; i < vertexCount; i++, vertexChar += vertexBuffer->getVertexSize())
556  {
557  vertexElement->baseVertexPointerToElement(vertexChar, &vertexFloat);
558  vertices[i] = (mesh->getParentNode()->_getDerivedOrientation() *
559  (Ogre::Vector3(vertexFloat[0], vertexFloat[1], vertexFloat[2]) * mesh->getParentNode()->_getDerivedScale())) +
560  mesh->getParentNode()->_getDerivedPosition();
561  }
562 
563  vertexBuffer->unlock();
564 
565  Ogre::IndexData* indexData;
566  Ogre::HardwareIndexBufferSharedPtr indexBuffer;
567  indexData = mesh->getSection(sectionNumber)->getRenderOperation()->indexData;
568  indexCount = indexData->indexCount;
569  indices = new unsigned long[indexCount];
570  indexBuffer = indexData->indexBuffer;
571  unsigned int* pLong = static_cast<unsigned int*>(indexBuffer->lock(Ogre::HardwareBuffer::HBL_READ_ONLY));
572  unsigned short* pShort = reinterpret_cast<unsigned short*>(pLong);
573 
574  for (size_t i = 0; i < indexCount; i++)
575  {
576  unsigned long index;
577  if (indexBuffer->getType() == Ogre::HardwareIndexBuffer::IT_32BIT)
578  {
579  index = static_cast<unsigned long>(pLong[i]);
580  }
581 
582  else
583  {
584  index = static_cast<unsigned long>(pShort[i]);
585  }
586 
587  indices[i] = index;
588  }
589  indexBuffer->unlock();
590 }
591 
592 } // end namespace rviz_label_tool
593 
rviz_mesh_plugin::FaceSelectionTool::getIdentityOfSingleFace
void getIdentityOfSingleFace(Ogre::ManualObject *mesh, Ogre::Ray &ray, size_t &goalSection, size_t &goalIndex, Ogre::Real &dist)
Definition: face_selection_tool.cpp:488
rviz_mesh_plugin::FaceSelectionTool::segment_color_b
int segment_color_b
Definition: face_selection_tool.h:195
rviz::ViewportMouseEvent::leftDown
bool leftDown()
rviz::RosTopicProperty
rviz::ViewportMouseEvent::rightUp
bool rightUp()
rviz::DisplayContext::queueRender
virtual void queueRender()=0
rviz::Tool
rviz_mesh_plugin::FaceSelectionTool::activate
virtual void activate()
Definition: face_selection_tool.cpp:180
rviz_mesh_plugin::FaceSelectionTool::~FaceSelectionTool
~FaceSelectionTool()
Definition: face_selection_tool.cpp:81
rviz_mesh_plugin::FaceSelectionTool::FaceSelectionTool
FaceSelectionTool()
Definition: face_selection_tool.cpp:62
rviz_mesh_plugin::FaceSelectionTool::has_mesh
bool has_mesh
Definition: face_selection_tool.h:186
rviz_mesh_plugin::FaceSelectionTool::num_results
int num_results
Definition: face_selection_tool.h:185
rviz::ViewportMouseEvent
rviz::ViewportMouseEvent::x
int x
rviz::Tool::context_
DisplayContext * context_
rviz_mesh_plugin::FaceSelectionTool::areFacesSelected
bool areFacesSelected()
Definition: face_selection_tool.cpp:268
rviz_mesh_plugin::FaceSelectionTool::n
ros::NodeHandle n
Definition: face_selection_tool.h:180
ros::Subscriber::shutdown
void shutdown()
rviz_mesh_plugin::FaceSelectionTool::clearSelection
void clearSelection()
Definition: face_selection_tool.cpp:258
rviz_mesh_plugin::FaceSelectionTool::mesh_pub
ros::Publisher mesh_pub
Definition: face_selection_tool.h:182
rviz_mesh_plugin::FaceSelectionTool::segment_color_a
float segment_color_a
Definition: face_selection_tool.h:196
rviz_mesh_plugin::FaceSelectionTool::m_goalFaces
std::map< size_t, std::vector< size_t > > m_goalFaces
Definition: face_selection_tool.h:175
ros::Publisher::publish
void publish(const boost::shared_ptr< M > &message) const
ros::NodeHandle::advertise
Publisher advertise(AdvertiseOptions &ops)
rviz::DisplayContext::getSceneManager
virtual Ogre::SceneManager * getSceneManager() const=0
f
f
rviz_mesh_plugin::FaceSelectionTool::reference_color_g
int reference_color_g
Definition: face_selection_tool.h:189
rviz_mesh_plugin::FaceSelectionTool::selectSingleFace
void selectSingleFace(rviz::ViewportMouseEvent &event)
Definition: face_selection_tool.cpp:414
rviz::ViewportMouseEvent::viewport
Ogre::Viewport * viewport
rviz_mesh_plugin::FaceSelectionTool::updateSelectionMesh
void updateSelectionMesh()
Definition: face_selection_tool.cpp:273
class_list_macros.h
rviz_mesh_plugin::FaceSelectionTool::id_pub
ros::Publisher id_pub
Definition: face_selection_tool.h:183
rviz_mesh_plugin::FaceSelectionTool::segment_color_g
int segment_color_g
Definition: face_selection_tool.h:194
rviz_mesh_plugin::FaceSelectionTool::reference_color_r
int reference_color_r
Definition: face_selection_tool.h:188
PLUGINLIB_EXPORT_CLASS
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
rviz_mesh_plugin::FaceSelectionTool::processKeyEvent
virtual int processKeyEvent(QKeyEvent *event, rviz::RenderPanel *panel)
Definition: face_selection_tool.cpp:312
rviz_mesh_plugin::FaceSelectionTool::mesh_topic
rviz::RosTopicProperty * mesh_topic
Definition: face_selection_tool.h:173
rviz::Tool::shortcut_key_
char shortcut_key_
rviz_mesh_plugin::FaceSelectionTool::MAXIMUM_PICKED_FACES
static const size_t MAXIMUM_PICKED_FACES
Definition: face_selection_tool.h:133
rviz::RosTopicProperty::getTopic
QString getTopic() const
rviz::Tool::Render
Render
rviz::ViewportMouseEvent::y
int y
rviz_mesh_plugin::FaceSelectionTool::deselectSingleFace
void deselectSingleFace(rviz::ViewportMouseEvent &event)
Definition: face_selection_tool.cpp:458
face_selection_tool.h
rviz::DisplayContext::getFixedFrame
virtual QString getFixedFrame() const=0
rviz_mesh_plugin::FaceSelectionTool::reference_color_b
int reference_color_b
Definition: face_selection_tool.h:190
rviz_mesh_plugin::FaceSelectionTool::initNode
void initNode()
Definition: face_selection_tool.cpp:160
ros::NodeHandle::subscribe
Subscriber subscribe(const std::string &topic, uint32_t queue_size, const boost::function< void(C)> &callback, const VoidConstPtr &tracked_object=VoidConstPtr(), const TransportHints &transport_hints=TransportHints())
rviz::Tool::getPropertyContainer
virtual Property * getPropertyContainer() const
rviz::DisplayContext::getFrameManager
virtual FrameManager * getFrameManager() const=0
rviz_mesh_plugin::FaceSelectionTool::scene_manager
Ogre::SceneManager * scene_manager
Definition: face_selection_tool.h:166
rviz_mesh_plugin::FaceSelectionTool::m_singleSelect
bool m_singleSelect
Definition: face_selection_tool.h:177
rviz_mesh_plugin::FaceSelectionTool::reference_color_a
float reference_color_a
Definition: face_selection_tool.h:191
rviz_mesh_plugin::FaceSelectionTool::goal_pub
ros::Publisher goal_pub
Definition: face_selection_tool.h:184
rviz_mesh_plugin::FaceSelectionTool::setReferenceMesh
void setReferenceMesh(mesh_msgs::TriangleMesh mesh)
Definition: face_selection_tool.cpp:205
rviz::FrameManager::getTransform
bool getTransform(const Header &header, Ogre::Vector3 &position, Ogre::Quaternion &orientation)
rviz_mesh_plugin::FaceSelectionTool::BOX_SIZE_TOLERANCE
static const float BOX_SIZE_TOLERANCE
Definition: face_selection_tool.h:132
rviz_mesh_plugin
Definition: face_selection_tool.h:117
rviz_mesh_plugin::FaceSelectionTool::initOgre
void initOgre()
Definition: face_selection_tool.cpp:116
rviz::ViewportMouseEvent::leftUp
bool leftUp()
rviz_mesh_plugin::FaceSelectionTool::getRawManualObjectData
void getRawManualObjectData(Ogre::ManualObject *mesh, size_t sectionNumber, size_t &vertexCount, Ogre::Vector3 *&vertices, size_t &indexCount, unsigned long *&indices)
Definition: face_selection_tool.cpp:534
rviz_mesh_plugin::FaceSelectionTool
Definition: face_selection_tool.h:119
rviz_mesh_plugin::FaceSelectionTool::processMouseEvent
virtual int processMouseEvent(rviz::ViewportMouseEvent &event)
Definition: face_selection_tool.cpp:349
rviz_mesh_plugin::FaceSelectionTool::setTransform
void setTransform(const mesh_msgs::TriangleMeshStamped &mesh)
Definition: face_selection_tool.cpp:188
ROS_ERROR
#define ROS_ERROR(...)
rviz_mesh_plugin::FaceSelectionTool::singleRayQuery
bool singleRayQuery(rviz::ViewportMouseEvent &event, int num_results, Ogre::Ray &ray)
Definition: face_selection_tool.cpp:392
rviz_mesh_plugin::FaceSelectionTool::segment_color_r
int segment_color_r
Definition: face_selection_tool.h:193
rviz::ViewportMouseEvent::rightDown
bool rightDown()
rviz_mesh_plugin::FaceSelectionTool::m_singleDeselect
bool m_singleDeselect
Definition: face_selection_tool.h:178
rviz_mesh_plugin::FaceSelectionTool::updateTopic
void updateTopic()
Definition: face_selection_tool.cpp:94
rviz_mesh_plugin::FaceSelectionTool::reference_mesh_material
Ogre::MaterialPtr reference_mesh_material
Definition: face_selection_tool.h:168
rviz_mesh_plugin::FaceSelectionTool::segment_mesh_material
Ogre::MaterialPtr segment_mesh_material
Definition: face_selection_tool.h:170
rviz_mesh_plugin::FaceSelectionTool::reference_mesh
Ogre::ManualObject * reference_mesh
Definition: face_selection_tool.h:167
rviz::RenderPanel
rviz_mesh_plugin::FaceSelectionTool::getSegmentMesh
void getSegmentMesh(mesh_msgs::TriangleMesh &mesh)
Definition: face_selection_tool.cpp:223
ROS_INFO
#define ROS_INFO(...)
rviz_mesh_plugin::FaceSelectionTool::deactivate
virtual void deactivate()
Definition: face_selection_tool.cpp:184
rviz_mesh_plugin::FaceSelectionTool::meshCb
void meshCb(const mesh_msgs::TriangleMeshStamped::ConstPtr &mesh)
Definition: face_selection_tool.cpp:170
rviz_mesh_plugin::FaceSelectionTool::onInitialize
virtual void onInitialize()
Definition: face_selection_tool.cpp:107
rviz_mesh_plugin::FaceSelectionTool::scene_node
Ogre::SceneNode * scene_node
Definition: face_selection_tool.h:171
rviz_mesh_plugin::FaceSelectionTool::mesh_sub
ros::Subscriber mesh_sub
Definition: face_selection_tool.h:181
rviz_mesh_plugin::FaceSelectionTool::segment_mesh
Ogre::ManualObject * segment_mesh
Definition: face_selection_tool.h:169
ros_topic_property.h
ros::Time::now
static Time now()


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