facing_visualizer.cpp
Go to the documentation of this file.
1 // -*- mode: c++ -*-
2 /*********************************************************************
3  * Software License Agreement (BSD License)
4  *
5  * Copyright (c) 2014, JSK Lab
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  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * * Neither the name of the JSK Lab nor the names of its
19  * contributors may be used to endorse or promote products derived
20  * from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  * POSSIBILITY OF SUCH DAMAGE.
34  *********************************************************************/
35 
36 #include "facing_visualizer.h"
38 #include <rviz/render_panel.h>
39 #include <rviz/view_manager.h>
41 #include <QPainter>
42 
43 namespace jsk_rviz_plugins
44 {
45 
46  const double minimum_font_size = 0.2;
47  const float arrow_animation_duration = 1.0;
48 
49  SquareObject::SquareObject(Ogre::SceneManager* manager,
50  double outer_radius,
51  double inner_radius,
52  std::string name):
53  manager_(manager), outer_radius_(outer_radius),
54  inner_radius_(inner_radius), name_(name), polygon_type_(CIRCLE)
55  {
56  manual_ = manager->createManualObject();
58  }
59 
61  {
62  manual_->detachFromParent();
63  manager_->destroyManualObject(manual_);
64  }
65 
66  Ogre::ManualObject* SquareObject::getManualObject()
67  {
68  return manual_;
69  }
70 
71  void SquareObject::setOuterRadius(double outer_radius)
72  {
73  outer_radius_ = outer_radius;
74  }
75 
76  void SquareObject::setInnerRadius(double inner_radius)
77  {
78  inner_radius_ = inner_radius;
79  }
80 
82  {
83  manual_->clear();
84  manual_->begin(name_,
85  Ogre::RenderOperation::OT_TRIANGLE_STRIP);
86  if (polygon_type_ == CIRCLE) {
87  const size_t resolution = 100;
88  const double radius_ratio = inner_radius_ / outer_radius_;
89  const double inner_offset = - outer_radius_ * 0.0;
90  int counter = 0;
91  for (size_t i = 0; i < resolution; i++) {
92  double theta = 2.0 * M_PI / resolution * i;
93  double next_theta = 2.0 * M_PI / resolution * (i + 1);
94 
95  manual_->position(inner_radius_ * cos(theta) + inner_offset,
96  inner_radius_ * sin(theta) + inner_offset,
97  0.0f);
98  manual_->textureCoord((1 + radius_ratio * cos(theta)) / 2.0,
99  (1.0 - radius_ratio * sin(theta)) / 2.0);
100  manual_->index(counter++);
101  manual_->position(outer_radius_ * cos(theta),
102  outer_radius_ * sin(theta),
103  0.0f);
104  manual_->textureCoord((1 + cos(theta)) / 2.0,
105  (1.0 -sin(theta)) / 2.0);
106  manual_->index(counter++);
107  manual_->position(inner_radius_ * cos(next_theta) + inner_offset,
108  inner_radius_ * sin(next_theta) + inner_offset,
109  0.0f);
110  manual_->textureCoord((1 + radius_ratio * cos(next_theta)) / 2.0,
111  (1.0 - radius_ratio * sin(next_theta)) / 2.0);
112  manual_->index(counter++);
113  manual_->position(outer_radius_ * cos(next_theta),
114  outer_radius_ * sin(next_theta),
115  0.0f);
116  manual_->textureCoord((1 + cos(next_theta)) / 2.0,
117  (1.0 -sin(next_theta)) / 2.0);
118  manual_->index(counter++);
119 
120  }
121  }
122  else if (polygon_type_ == SQUARE) {
124  0.0f); // 1
125  manual_->textureCoord(0, 0); // 4
126  manual_->index(0);
127 
128  manual_->position(-outer_radius_, outer_radius_,
129  0.0f); // 2
130  manual_->textureCoord(0, 1); // 3
131  manual_->index(1);
132 
133  manual_->position(-outer_radius_, -outer_radius_,
134  0.0f); // 3
135  manual_->textureCoord(1, 1); // 2
136  manual_->index(2);
137 
138  manual_->position(outer_radius_, -outer_radius_,
139  0.0f); // 4
140  manual_->textureCoord(1, 0); // 1
141  manual_->index(3);
142 
144  0.0f); // 1
145  manual_->textureCoord(0, 0); // 4
146  manual_->index(4);
147  }
148  // for (size_t i = 0; i < resolution; i++) {
149  // }
150  // manual_->index(0);
151  manual_->end();
152  }
153 
155  {
157  }
158 
159  TextureObject::TextureObject(const int width, const int height,
160  const std::string name):
161  width_(width), height_(height), name_(name)
162  {
163  texture_ = Ogre::TextureManager::getSingleton().createManual(
164  name,
165  Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
166  Ogre::TEX_TYPE_2D,
167  width, height,
168  0,
169  Ogre::PF_A8R8G8B8,
170  Ogre::TU_DEFAULT
171  );
172  material_ = Ogre::MaterialManager::getSingleton().create(
173  getMaterialName(), // name
174  Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
175 
176  material_->getTechnique(0)->getPass(0)->createTextureUnitState(
177  texture_->getName());
178  material_->setReceiveShadows(false);
179  material_->getTechnique(0)->setLightingEnabled(true);
180  material_->getTechnique(0)->getPass(0)->setCullingMode(Ogre::CULL_NONE);
181  material_->getTechnique(0)->getPass(0)->setLightingEnabled(false);
182  material_->getTechnique(0)->getPass(0)->setDepthWriteEnabled(false);
183  material_->getTechnique(0)->getPass(0)->setDepthCheckEnabled(true);
184 
185  material_->getTechnique(0)->getPass(0)->setVertexColourTracking(Ogre::TVC_DIFFUSE);
186  material_->getTechnique(0)->getPass(0)->createTextureUnitState(texture_->getName());
187  material_->getTechnique(0)->getPass(0)->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
188 
189  material_->getTechnique(0)->getPass(0)
190  ->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
191  // material_->getTechnique(0)->getPass(0)
192  // ->setSceneBlending(Ogre::SBT_MODULATE);
193 
194  }
195 
197  {
198  material_->unload();
199  Ogre::MaterialManager::getSingleton().remove(material_->getName());
200  }
201 
203  {
204  return ScopedPixelBuffer(texture_->getBuffer());
205  }
206 
208  {
209  return name_ + "Material";
210  }
211 
212  FacingObject::FacingObject(Ogre::SceneManager* manager,
213  Ogre::SceneNode* parent,
214  double size):
215  scene_manager_(manager), size_(size), enable_(true), text_("")
216  {
217  node_ = parent->createChildSceneNode();
218  }
219 
221  {
222  node_->detachAllObjects();
223  scene_manager_->destroySceneNode(node_);
224  }
225 
226  void FacingObject::setPosition(Ogre::Vector3& pos)
227  {
228  node_->setPosition(pos);
229  }
230 
232  {
233  rviz::ViewManager* manager = context->getViewManager();
234  rviz::RenderPanel* panel = manager->getRenderPanel();
235  Ogre::Camera* camera = panel->getCamera();
236  Ogre::Quaternion q = camera->getDerivedOrientation();
237  setOrientation(q);
238  }
239 
240  void FacingObject::setOrientation(Ogre::Quaternion& rot)
241  {
242  node_->setOrientation(rot);
243  }
244 
246  {
247  size_ = size;
248  }
249 
250  void FacingObject::setEnable(bool enable)
251  {
252  enable_ = enable;
253  node_->setVisible(enable_);
254  }
255 
256  void FacingObject::setText(std::string text)
257  {
258  text_ = text;
259  //updateTextUnderLine();
260  updateText();
261  }
262 
264  {
265  color_.a = alpha;
266  updateColor();
267  }
268 
269  void FacingObject::setColor(QColor color)
270  {
271  color_.r = color.red() / 255.0;
272  color_.g = color.green() / 255.0;
273  color_.b = color.blue() / 255.0;
274  updateColor();
275  }
276 
277  void FacingObject::setColor(Ogre::ColourValue color)
278  {
279  color_ = color;
280  updateColor();
281  }
282 
284  Ogre::SceneManager* manager,
285  Ogre::SceneNode* parent,
286  rviz::DisplayContext* context,
287  double size,
288  std::string text):
289  FacingObject(manager, parent, size)
290  {
292  context->getSceneManager(),
293  node_);
295  context->getSceneManager(),
296  node_);
297  target_text_node_ = node_->createChildSceneNode();
298  msg_ = new rviz::MovableText("not initialized", "Liberation Sans", 0.05);
299  msg_->setVisible(false);
302  target_text_node_->attachObject(msg_);
303  createArrows(context);
304  updateLine();
306  updateText();
307  setEnable(false);
308  }
309 
311  {
312  delete line_;
313  delete text_under_line_;
314  delete msg_;
315  scene_manager_->destroyManualObject(upper_arrow_);
316  scene_manager_->destroyManualObject(lower_arrow_);
317  scene_manager_->destroyManualObject(left_arrow_);
318  scene_manager_->destroyManualObject(right_arrow_);
319  upper_material_->unload();
320  lower_material_->unload();
321  left_material_->unload();
322  right_material_->unload();
323  Ogre::MaterialManager::getSingleton().remove(upper_material_->getName());
324  Ogre::MaterialManager::getSingleton().remove(lower_material_->getName());
325  Ogre::MaterialManager::getSingleton().remove(left_material_->getName());
326  Ogre::MaterialManager::getSingleton().remove(right_material_->getName());
327  }
328 
329  void SimpleCircleFacingVisualizer::update(float wall_dt, float ros_dt)
330  {
331  double t_ = ros::WallTime::now().toSec();
332  double t_rate
333  = fmod(t_, arrow_animation_duration) / arrow_animation_duration;
334  upper_arrow_node_->setPosition(0, (1.3 - 0.3 * t_rate) * size_, 0);
335  lower_arrow_node_->setPosition(0, (-1.3 + 0.3 * t_rate) * size_, 0);
336  left_arrow_node_->setPosition((1.3 - 0.3 * t_rate) * size_, 0, 0);
337  right_arrow_node_->setPosition((-1.3 + 0.3 * t_rate) * size_, 0, 0);
338  }
339 
341  {
342  line_->clear();
344  msg_->setVisible(false);
345  }
346 
348  {
349  const double size_factor = 0.15;
350  upper_arrow_node_->setPosition(Ogre::Vector3(0, size_ * 1.0, 0.0));
351  upper_arrow_->clear();
352  upper_arrow_->estimateVertexCount(3);
354  Ogre::RenderOperation::OT_TRIANGLE_LIST);
355 
356  upper_arrow_->colour(color);
357  upper_arrow_->position(Ogre::Vector3(0, size_ * size_factor, 0));
358  upper_arrow_->colour(color);
359  upper_arrow_->position(Ogre::Vector3(size_ * size_factor,
360  size_ * size_factor * 2,
361  0));
362  upper_arrow_->colour(color);
363  upper_arrow_->position(Ogre::Vector3(-size_ * size_factor,
364  size_ * size_factor * 2,
365  0));
366  upper_arrow_->end();
367 
368  lower_arrow_node_->setPosition(Ogre::Vector3(0, -size_ * 1.0, 0.0));
369  lower_arrow_->clear();
370  lower_arrow_->estimateVertexCount(3);
372  Ogre::RenderOperation::OT_TRIANGLE_LIST);
373 
374  lower_arrow_->colour(color);
375  lower_arrow_->position(Ogre::Vector3(0,
376  -size_ * size_factor,
377  0));
378  lower_arrow_->colour(color);
379  lower_arrow_->position(Ogre::Vector3(size_ * size_factor,
380  -size_ * size_factor * 2,
381  0));
382  lower_arrow_->colour(color);
383  lower_arrow_->position(Ogre::Vector3(-size_ * size_factor,
384  -size_ * size_factor * 2,
385  0));
386  lower_arrow_->end();
387  left_arrow_node_->setPosition(Ogre::Vector3(size_ * 1.0, 0.0, 0.0));
388  left_arrow_->clear();
389  left_arrow_->estimateVertexCount(3);
391  Ogre::RenderOperation::OT_TRIANGLE_LIST);
392 
393  left_arrow_->colour(color);
394  left_arrow_->position(Ogre::Vector3(size_ * size_factor,
395  0.0,
396  0));
397  left_arrow_->colour(color);
398  left_arrow_->position(Ogre::Vector3(size_ * size_factor * 2,
399  size_ * size_factor,
400  0));
401  left_arrow_->colour(color);
402  left_arrow_->position(Ogre::Vector3(size_ * size_factor * 2,
403  - size_ * size_factor,
404  0));
405  left_arrow_->end();
406 
407  right_arrow_node_->setPosition(Ogre::Vector3(-size_ * 1.0, 0.0, 0.0));
408  right_arrow_->clear();
409  right_arrow_->estimateVertexCount(3);
411  Ogre::RenderOperation::OT_TRIANGLE_LIST);
412 
413  right_arrow_->colour(color);
414  right_arrow_->position(Ogre::Vector3(-size_ * size_factor,
415  0.0,
416  0));
417  right_arrow_->colour(color);
418  right_arrow_->position(Ogre::Vector3(-size_ * size_factor * 2,
419  size_ * size_factor,
420  0));
421  right_arrow_->colour(color);
422  right_arrow_->position(Ogre::Vector3(-size_ * size_factor * 2,
423  - size_ * size_factor,
424  0));
425  right_arrow_->end();
426 
427 
428  upper_material_->getTechnique(0)->setLightingEnabled(false);
429  upper_material_->getTechnique(0)->setSceneBlending( Ogre::SBT_TRANSPARENT_ALPHA );
430  upper_material_->getTechnique(0)->setDepthWriteEnabled( false );
431  lower_material_->getTechnique(0)->setLightingEnabled(false);
432  lower_material_->getTechnique(0)->setSceneBlending( Ogre::SBT_TRANSPARENT_ALPHA );
433  lower_material_->getTechnique(0)->setDepthWriteEnabled( false );
434  left_material_->getTechnique(0)->setLightingEnabled(false);
435  left_material_->getTechnique(0)->setSceneBlending( Ogre::SBT_TRANSPARENT_ALPHA );
436  left_material_->getTechnique(0)->setDepthWriteEnabled( false );
437  right_material_->getTechnique(0)->setLightingEnabled(false);
438  right_material_->getTechnique(0)->setSceneBlending( Ogre::SBT_TRANSPARENT_ALPHA );
439  right_material_->getTechnique(0)->setDepthWriteEnabled( false );
440  }
441 
442  // allocate material and node for arrrows
444  rviz::DisplayContext* context)
445  {
446  static uint32_t count = 0;
448  ss << "TargetVisualizerDisplayTriangle" << count++;
449  ss << "Material";
450  ss << "0";
451  upper_material_name_ = std::string(ss.str());
452  ss << "1";
453  lower_material_name_ = std::string(ss.str());
454  ss << "2";
455  left_material_name_ = std::string(ss.str());
456  ss << "3";
457  right_material_name_ = std::string(ss.str());
458  upper_material_ = Ogre::MaterialManager::getSingleton().create(
460  Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
461  lower_material_ = Ogre::MaterialManager::getSingleton().create(
463  Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
464  left_material_ = Ogre::MaterialManager::getSingleton().create(
466  Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
467  right_material_ = Ogre::MaterialManager::getSingleton().create(
469  Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
470 
471  upper_material_->setReceiveShadows(false);
472  upper_material_->getTechnique(0)->setLightingEnabled(true);
473  upper_material_->setCullingMode(Ogre::CULL_NONE);
474  lower_material_->setReceiveShadows(false);
475  lower_material_->getTechnique(0)->setLightingEnabled(true);
476  lower_material_->setCullingMode(Ogre::CULL_NONE);
477  left_material_->setReceiveShadows(false);
478  left_material_->getTechnique(0)->setLightingEnabled(true);
479  left_material_->setCullingMode(Ogre::CULL_NONE);
480  right_material_->setReceiveShadows(false);
481  right_material_->getTechnique(0)->setLightingEnabled(true);
482  right_material_->setCullingMode(Ogre::CULL_NONE);
483 
484  upper_arrow_ = context->getSceneManager()->createManualObject(
486  upper_arrow_node_ = node_->createChildSceneNode();
487  upper_arrow_node_->attachObject(upper_arrow_);
488  lower_arrow_ = context->getSceneManager()->createManualObject(
490  lower_arrow_node_ = node_->createChildSceneNode();
491  lower_arrow_node_->attachObject(lower_arrow_);
492  left_arrow_ = context->getSceneManager()->createManualObject(
494  left_arrow_node_ = node_->createChildSceneNode();
495  left_arrow_node_->attachObject(left_arrow_);
496  right_arrow_ = context->getSceneManager()->createManualObject(
498  right_arrow_node_ = node_->createChildSceneNode();
499  right_arrow_node_->attachObject(right_arrow_);
501  }
502 
504  {
505  const int resolution = 100;
506  line_->clear();
507  line_->setColor(color_.r, color_.g, color_.b, color_.a);
508  line_->setLineWidth(0.1 * size_);
509  line_->setNumLines(1);
510  line_->setMaxPointsPerLine(1024);
511  for (size_t i = 0; i < resolution + 1; i++) {
512  double x = size_ * cos(i * 2 * M_PI / resolution);
513  double y = size_ * sin(i * 2 * M_PI / resolution);
514  double z = 0;
515  Ogre::Vector3 p;
516  p[0] = x;
517  p[1] = y;
518  p[2] = z;
519  line_->addPoint(p);
520  }
521  }
522 
523  // need msg to be initialized beforehand
525  {
526  Ogre::Vector3 text_position(size_ * cos(45.0 / 180.0 * M_PI)
527  + size_ / 2.0,
528  size_ * sin(45.0 / 180.0 * M_PI)
529  + size_ / 2.0,
530  0);
531  target_text_node_->setPosition(text_position);
532  Ogre::Vector3 msg_size = msg_->GetAABB().getSize();
535 
539  Ogre::Vector3 A(size_ * cos(45.0 / 180.0 * M_PI),
540  size_ * sin(45.0 / 180.0 * M_PI),
541  0);
542  Ogre::Vector3 B(text_position + Ogre::Vector3(- size_ / 4.0, 0, 0));
543  Ogre::Vector3 C(text_position + Ogre::Vector3(msg_size[0], 0, 0));
547  }
548 
550  {
551  FacingObject::setSize(size);
552  updateLine();
553  updateText();
555  }
556 
558  {
559  FacingObject::setEnable(enable);
560  msg_->setVisible(enable);
561  line_->getSceneNode()->setVisible(enable);
562  text_under_line_->getSceneNode()->setVisible(enable);
563  }
564 
566  {
568  msg_->setCharacterHeight(std::max(0.15 * size_, minimum_font_size));
569  }
570 
572  {
573  text_ = text;
575  updateText();
576  }
577 
579  {
580  msg_->setColor(color_);
581  line_->setColor(color_.r, color_.g, color_.b, color_.a);
584  }
585 
586  FacingTexturedObject::FacingTexturedObject(Ogre::SceneManager* manager,
587  Ogre::SceneNode* parent,
588  double size):
589  FacingObject(manager, parent, size)
590  {
592  static int count = 0;
593  ss << "FacingVisualizer" << count++;
594  texture_object_.reset(new TextureObject(128, 128, ss.str()));
595  square_object_.reset(new SquareObject(manager, size, 0,
596  texture_object_->getMaterialName()));
597  node_->attachObject(square_object_->getManualObject());
598  }
599 
600 
602  {
603  FacingObject::setSize(size);
604  square_object_->setOuterRadius(size_);
605  square_object_->rebuildPolygon();
606  }
607 
608  GISCircleVisualizer::GISCircleVisualizer(Ogre::SceneManager* manager,
609  Ogre::SceneNode* parent,
610  double size,
611  std::string text):
612  FacingTexturedObject(manager, parent, size), text_(text)
613  {
614 
615  }
616 
617  void GISCircleVisualizer::update(float wall_dt, float ros_dt)
618  {
620  std::string text = text_ + " ";
621  {
622  ScopedPixelBuffer buffer = texture_object_->getBuffer();
623  QColor transparent(0, 0, 0, 0);
624  QColor foreground = rviz::ogreToQt(color_);
625  QColor white(255, 255, 255, color_.a * 255);
626  QImage Hud = buffer.getQImage(128, 128, transparent);
627  double line_width = 5;
628  double inner_line_width = 10;
629  double l = 128;
630  //double cx = l / 2 - line_width / 4.0;
631  double cx = l / 2;
632  //double cy = l / 2 - line_width / 4.0;
633  double cy = l / 2;
634  double r = 48;
635  double inner_r = 40;
636  double mouse_r = 30;
637  double mouse_cy_offset = 5;
638 
639  QPainter painter( &Hud );
640  painter.setRenderHint(QPainter::Antialiasing, true);
641  painter.setPen(QPen(foreground, line_width, Qt::SolidLine));
642  painter.setBrush(white);
643  painter.drawEllipse(line_width / 2.0, line_width / 2.0,
644  l - line_width, l - line_width);
645  double offset_rate = fmod(now.toSec(), 10) / 10.0;
646  double theta_offset = offset_rate * M_PI * 2.0;
647  for (size_t ci = 0; ci < text.length(); ci++) {
648  double theta = M_PI * 2.0 / text.length() * ci + theta_offset;
649  painter.save();
650  QFont font("DejaVu Sans Mono");
651  font.setPointSize(8);
652  font.setBold(false);
653  painter.setFont(font);
654  painter.translate(cx + r * cos(theta),
655  cy + r * sin(theta));
656  painter.rotate(theta / M_PI * 180 + 90);
657  painter.drawText(0, 0, text.substr(ci, 1).c_str());
658  painter.restore();
659  }
660  painter.setPen(QPen(foreground, inner_line_width, Qt::SolidLine));
661  painter.setBrush(transparent);
662  painter.drawEllipse(cx - inner_r, cy - inner_r,
663  inner_r * 2, inner_r * 2);
664  double mouse_c_x = cx;
665  double mouse_c_y = cy - mouse_cy_offset;
666  double start_angle = -25 * M_PI / 180;
667  double end_angle = -125 * M_PI / 180;
668  painter.setPen(QPen(foreground, line_width, Qt::SolidLine));
669  painter.drawChord(mouse_c_x - mouse_r, mouse_c_y - mouse_r,
670  2.0 * mouse_r, 2.0 * mouse_r,
671  start_angle * 180 / M_PI * 16,
672  end_angle * 180 / M_PI * 16);
673  painter.end();
674  }
675  }
676 
678  {
679  anonymous_ = anonymous;
680  if (!anonymous_) {
681  square_object_->setInnerRadius(size_ * 0.6);
682  }
683  else {
684  square_object_->setInnerRadius(0.0);
685 
686  }
687  square_object_->rebuildPolygon();
688  }
689 
691  {
692  FacingObject::setSize(size);
693  square_object_->setOuterRadius(size_);
694  if (!anonymous_) {
695  square_object_->setInnerRadius(size_ * 0.6);
696  }
697  else {
698  square_object_->setInnerRadius(0.0);
699  }
700  square_object_->rebuildPolygon();
701  }
702 
703 
704 }
f
virtual std::string getMaterialName()
virtual ScopedPixelBuffer getBuffer()
virtual void setPosition(Ogre::Vector3 &pos)
void addPoint(const Ogre::Vector3 &point)
std::string name_
virtual QImage getQImage(unsigned int width, unsigned int height)
virtual void setText(std::string text)
int counter
TextureObject(const int width, const int height, const std::string name)
virtual void update(float wall_dt, float ros_dt)
virtual ViewManager * getViewManager() const=0
Ogre::Camera * getCamera() const
FacingObject(Ogre::SceneManager *manager, Ogre::SceneNode *parent, double size)
virtual void setAlpha(double alpha)
const double minimum_font_size
void setCharacterHeight(Ogre::Real height)
FacingTexturedObject(Ogre::SceneManager *manager, Ogre::SceneNode *parent, double size)
virtual void setOrientation(rviz::DisplayContext *context)
Ogre::SceneNode * getSceneNode()
virtual void createArrows(rviz::DisplayContext *context)
virtual Ogre::ManualObject * getManualObject()
virtual void setSize(double size)
Ogre::AxisAlignedBox GetAABB()
virtual void setAnonymous(bool anonymous)
QColor ogreToQt(const Ogre::ColourValue &c)
const float arrow_animation_duration
void setCaption(const Ogre::String &caption)
RenderPanel * getRenderPanel() const
virtual void setPolygonType(PolygonType type)
virtual void setOuterRadius(double outer_radius)
void setColor(float r, float g, float b, float a) override
x
void setTextAlignment(const HorizontalAlignment &horizontalAlignment, const VerticalAlignment &verticalAlignment)
y
virtual void setColor(QColor color)
void setNumLines(uint32_t num)
void setMaxPointsPerLine(uint32_t max)
virtual void updateArrowsObjects(Ogre::ColourValue color)
virtual Ogre::SceneManager * getSceneManager() const=0
SquareObject(Ogre::SceneManager *manager, double outer_radius, double inner_radius, std::string name)
void setColor(const Ogre::ColourValue &color)
static WallTime now()
Ogre::SceneManager * scene_manager_
virtual void setEnable(bool enable)
SimpleCircleFacingVisualizer(Ogre::SceneManager *manager, Ogre::SceneNode *parent, rviz::DisplayContext *context, double size, std::string text="")
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
virtual void update(float wall_dt, float ros_dt)
INLINE Rall1d< T, V, S > sin(const Rall1d< T, V, S > &arg)
void setLineWidth(float width)
virtual void setInnerRadius(double inner_radius)
GISCircleVisualizer(Ogre::SceneManager *manager, Ogre::SceneNode *parent, double size, std::string text="")
z


jsk_rviz_plugins
Author(s): Kei Okada , Yohei Kakiuchi , Shohei Fujii , Ryohei Ueda
autogenerated on Thu Jun 1 2023 02:45:58