visualization_manager.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, Willow Garage, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of the Willow Garage, Inc. nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #include <algorithm>
31 
32 #include <QApplication>
33 #include <QCursor>
34 #include <QPixmap>
35 #include <QTimer>
36 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
37 #include <QWindow>
38 #endif
39 
40 #include <boost/bind.hpp>
41 
42 #include <OgreRoot.h>
43 #include <OgreSceneManager.h>
44 #include <OgreSceneNode.h>
45 #include <OgreLight.h>
46 #include <OgreViewport.h>
47 #include <OgreMaterialManager.h>
48 #include <OgreMaterial.h>
49 #include <OgreRenderWindow.h>
50 #include <OgreSharedPtr.h>
51 #include <OgreCamera.h>
52 
53 #include <boost/filesystem.hpp>
54 
55 #include <tf/transform_listener.h>
56 
57 #include <ros/package.h>
58 #include <ros/callback_queue.h>
59 
60 #include "rviz/display.h"
61 #include "rviz/display_factory.h"
62 #include "rviz/display_group.h"
63 #include "rviz/displays_panel.h"
64 #include "rviz/frame_manager.h"
73 #include "rviz/render_panel.h"
75 #include "rviz/tool.h"
76 #include "rviz/tool_manager.h"
78 #include "rviz/view_controller.h"
79 #include "rviz/view_manager.h"
80 #include "rviz/load_resource.h"
83 
86 
87 namespace rviz
88 {
89 // helper class needed to display an icon besides "Global Options"
90 class IconizedProperty : public Property
91 {
92 public:
93  IconizedProperty(const QString& name = QString(),
94  const QVariant default_value = QVariant(),
95  const QString& description = QString(),
96  Property* parent = nullptr,
97  const char* changed_slot = nullptr,
98  QObject* receiver = nullptr)
99  : Property(name, default_value, description, parent, changed_slot, receiver){};
100  QVariant getViewData(int column, int role) const override
101  {
102  return (column == 0 && role == Qt::DecorationRole) ? icon_ : Property::getViewData(column, role);
103  }
104  void setIcon(const QIcon& icon) override
105  {
106  icon_ = icon;
107  }
108 
109 private:
110  QIcon icon_;
111 };
112 
114 {
115 public:
117  boost::thread_group threaded_queue_threads_;
120  boost::mutex render_mutex_;
121 };
122 
123 #ifndef _WIN32
124 #pragma GCC diagnostic push
125 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
126 #endif
128  : VisualizationManager(render_panel, wm, boost::shared_ptr<tf::TransformListener>())
129 {
130 }
131 #ifndef _WIN32
132 #pragma GCC diagnostic pop
133 #endif
134 
138  : ogre_root_(Ogre::Root::getSingletonPtr())
139  , update_timer_(nullptr)
140  , shutting_down_(false)
141  , render_panel_(render_panel)
142  , time_update_timer_(0.0f)
143  , frame_update_timer_(0.0f)
144  , render_requested_(1)
145  , frame_count_(0)
146  , window_manager_(wm)
148 {
149  // visibility_bit_allocator_ is listed after default_visibility_bit_ (and thus initialized later be
150  // default):
152 
153 #ifndef _WIN32
154 #pragma GCC diagnostic push
155 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
156 #endif
157 
158  frame_manager_ = new FrameManager(tf);
159 
160 #ifndef _WIN32
161 #pragma GCC diagnostic pop
162 #endif
163 
164  render_panel->setAutoRender(false);
165 
167 
168  scene_manager_ = ogre_root_->createSceneManager(Ogre::ST_GENERIC);
169 
170  rviz::RenderSystem::RenderSystem::get()->prepareOverlays(scene_manager_);
171 
172  directional_light_ = scene_manager_->createLight("MainDirectional");
173  directional_light_->setType(Ogre::Light::LT_DIRECTIONAL);
174  directional_light_->setDirection(Ogre::Vector3(-1, 0, -1));
175  directional_light_->setDiffuseColour(Ogre::ColourValue(1.0f, 1.0f, 1.0f));
176 
178  root_display_group_->setName("root");
181  connect(display_property_tree_model_, SIGNAL(configChanged()), this, SIGNAL(configChanged()));
182 
183  tool_manager_ = new ToolManager(this);
184  connect(tool_manager_, SIGNAL(configChanged()), this, SIGNAL(configChanged()));
185  connect(tool_manager_, SIGNAL(toolChanged(Tool*)), this, SLOT(onToolChanged(Tool*)));
186 
187  view_manager_ = new ViewManager(this);
189  connect(view_manager_, SIGNAL(configChanged()), this, SIGNAL(configChanged()));
190 
191  IconizedProperty* ip = new IconizedProperty("Global Options", QVariant(), "", root_display_group_);
192  ip->setIcon(loadPixmap("package://rviz/icons/options.png"));
193  global_options_ = ip;
194 
196  new TfFrameProperty("Fixed Frame", "/map",
197  "Frame into which all data is transformed before being displayed.",
198  global_options_, frame_manager_, false, SLOT(updateFixedFrame()), this);
199 
201  new ColorProperty("Background Color", QColor(48, 48, 48), "Background color for the 3D view.",
202  global_options_, SLOT(updateBackgroundColor()), this);
203 
204  fps_property_ =
205  new IntProperty("Frame Rate", 30, "RViz will try to render this many frames per second.",
206  global_options_, SLOT(updateFps()), this);
207 
209  new BoolProperty("Default Light", true, "Light source attached to the current 3D view.",
211 
213  this); // only initialize() a Display after its sub-properties are created.
215 
218 
219  global_status_ = new StatusList("Global Status", root_display_group_);
220 
222 
224 
225  update_timer_ = new QTimer;
226  connect(update_timer_, SIGNAL(timeout()), this, SLOT(onUpdate()));
227 
228  private_->threaded_queue_threads_.create_thread(
230 
232 
234  Ogre::Root::getSingletonPtr()->addFrameListener(ogre_render_queue_clearer_);
235 }
236 
238 {
239  update_timer_->stop();
240  shutting_down_ = true;
241  private_->threaded_queue_threads_.join_all();
242 
243  delete update_timer_;
244 
245  if (selection_manager_)
246  {
248  }
249 
251  delete tool_manager_;
252  delete display_factory_;
253  delete selection_manager_;
254  delete view_manager_;
255 
256  if (ogre_root_)
257  {
258  ogre_root_->destroySceneManager(scene_manager_);
259  }
260  delete frame_manager_;
261  delete private_;
262 
263  Ogre::Root::getSingletonPtr()->removeFrameListener(ogre_render_queue_clearer_);
265 }
266 
268 {
269  emitStatusUpdate("Initializing managers.");
270 
274 
277 }
278 
280 {
281  return &private_->threaded_queue_;
282 }
283 
285 {
286  private_->render_mutex_.lock();
287 }
288 
290 {
291  private_->render_mutex_.unlock();
292 }
293 
295 {
297 }
298 
300 {
301  float interval = 1000.0 / float(fps_property_->getInt());
302  update_timer_->start(interval);
303 }
304 
306 {
307  update_timer_->stop();
308 }
309 
310 void createColorMaterial(const std::string& name,
311  const Ogre::ColourValue& color,
312  bool use_self_illumination)
313 {
314  Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().create(name, ROS_PACKAGE_NAME);
315  mat->setAmbient(color * 0.5f);
316  mat->setDiffuse(color);
317  if (use_self_illumination)
318  {
319  mat->setSelfIllumination(color);
320  }
321  mat->setLightingEnabled(true);
322  mat->setReceiveShadows(false);
323 }
324 
326 {
327  createColorMaterial("RVIZ/Red", Ogre::ColourValue(1.0f, 0.0f, 0.0f, 1.0f), true);
328  createColorMaterial("RVIZ/Green", Ogre::ColourValue(0.0f, 1.0f, 0.0f, 1.0f), true);
329  createColorMaterial("RVIZ/Blue", Ogre::ColourValue(0.0f, 0.0f, 1.0f, 1.0f), true);
330  createColorMaterial("RVIZ/Cyan", Ogre::ColourValue(0.0f, 1.0f, 1.0f, 1.0f), true);
331  createColorMaterial("RVIZ/ShadedRed", Ogre::ColourValue(1.0f, 0.0f, 0.0f, 1.0f), false);
332  createColorMaterial("RVIZ/ShadedGreen", Ogre::ColourValue(0.0f, 1.0f, 0.0f, 1.0f), false);
333  createColorMaterial("RVIZ/ShadedBlue", Ogre::ColourValue(0.0f, 0.0f, 1.0f, 1.0f), false);
334  createColorMaterial("RVIZ/ShadedCyan", Ogre::ColourValue(0.0f, 1.0f, 1.0f, 1.0f), false);
335 }
336 
338 {
339  render_requested_ = 1;
340 }
341 
343 {
346  float wall_dt = wall_diff.toSec();
347  float ros_dt = ros_diff.toSec();
350 
351  if (ros_dt < 0.0)
352  {
353  resetTime();
354  }
355 
356  ros::spinOnce();
357 
358  Q_EMIT preUpdate();
359 
361 
362  root_display_group_->update(wall_dt, ros_dt);
363 
364  view_manager_->update(wall_dt, ros_dt);
365 
366  time_update_timer_ += wall_dt;
367 
368  if (time_update_timer_ > 0.1f)
369  {
370  time_update_timer_ = 0.0f;
371 
372  updateTime();
373  }
374 
375  frame_update_timer_ += wall_dt;
376 
377  if (frame_update_timer_ > 1.0f)
378  {
379  frame_update_timer_ = 0.0f;
380 
381  updateFrames();
382  }
383 
385 
387  {
388  tool_manager_->getCurrentTool()->update(wall_dt, ros_dt);
389  }
390 
392  {
393  directional_light_->setDirection(view_manager_->getCurrent()->getCamera()->getDerivedDirection());
394  }
395 
396  frame_count_++;
397 
398  if (render_requested_ || wall_dt > 0.01)
399  {
400  render_requested_ = 0;
401  boost::mutex::scoped_lock lock(private_->render_mutex_);
402  ogre_root_->renderOneFrame();
403  }
404 }
405 
407 {
408  if (ros_time_begin_.isZero())
409  {
411  }
412 
414 
416  {
418  }
419 
421 }
422 
424 {
425  typedef std::vector<std::string> V_string;
426  V_string frames;
427 #ifndef _WIN32
428 #pragma GCC diagnostic push
429 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
430 #endif
432 #ifndef _WIN32
433 #pragma GCC diagnostic pop
434 #endif
435 
436  // Check the fixed frame to see if it's ok
437  std::string error;
438  if (frame_manager_->frameHasProblems(getFixedFrame().toStdString(), ros::Time(), error))
439  {
440  if (frames.empty())
441  {
442  // fixed_prop->setToWarn();
443  std::stringstream ss;
444  ss << "No tf data. Actual error: " << error;
445  global_status_->setStatus(StatusProperty::Warn, "Fixed Frame", QString::fromStdString(ss.str()));
446  }
447  else
448  {
449  // fixed_prop->setToError();
450  global_status_->setStatus(StatusProperty::Error, "Fixed Frame", QString::fromStdString(error));
451  }
452  }
453  else
454  {
455  // fixed_prop->setToOK();
456  global_status_->setStatus(StatusProperty::Ok, "Fixed Frame", "OK");
457  }
458 }
459 
461 {
462 #ifndef _WIN32
463 #pragma GCC diagnostic push
464 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
465 #endif
466  return frame_manager_->getTFClient();
467 #ifndef _WIN32
468 #pragma GCC diagnostic pop
469 #endif
470 }
471 
472 std::shared_ptr<tf2_ros::Buffer> VisualizationManager::getTF2BufferPtr() const
473 {
475 }
476 
478 {
480 #ifndef _WIN32
481 #pragma GCC diagnostic push
482 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
483 #endif
485 #ifndef _WIN32
486 #pragma GCC diagnostic pop
487 #endif
488 
491 
492  queueRender();
493 }
494 
495 void VisualizationManager::addDisplay(Display* display, bool enabled)
496 {
498  display->initialize(this);
499  display->setEnabled(enabled);
500 }
501 
503 {
505 }
506 
507 void VisualizationManager::emitStatusUpdate(const QString& message)
508 {
509  Q_EMIT statusUpdate(message);
510 }
511 
513 {
514  stopUpdate();
515 
516  emitStatusUpdate("Creating displays");
517  root_display_group_->load(config);
518 
519  emitStatusUpdate("Creating tools");
520  tool_manager_->load(config.mapGetChild("Tools"));
521 
522  emitStatusUpdate("Creating views");
523  view_manager_->load(config.mapGetChild("Views"));
524 
525  startUpdate();
526 }
527 
529 {
530  root_display_group_->save(config);
531  tool_manager_->save(config.mapMakeChild("Tools"));
532  view_manager_->save(config.mapMakeChild("Views"));
533 }
534 
535 Display*
536 VisualizationManager::createDisplay(const QString& class_lookup_name, const QString& name, bool enabled)
537 {
538  QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
539  Display* new_display = root_display_group_->createDisplay(class_lookup_name);
540  addDisplay(new_display, enabled);
541  new_display->setName(name);
542  QApplication::restoreOverrideCursor();
543  return new_display;
544 }
545 
547 {
548  return ros::WallTime::now().toSec();
549 }
550 
552 {
553  return frame_manager_->getTime().toSec();
554 }
555 
557 {
558  return wall_clock_elapsed_.toSec();
559 }
560 
562 {
563  return (frame_manager_->getTime() - ros_time_begin_).toSec();
564 }
565 
567 {
569 
570  queueRender();
571 }
572 
574 {
575  if (update_timer_->isActive())
576  {
577  startUpdate();
578  }
579 }
580 
582 {
584 }
585 
587 {
588  // process pending mouse events
589  Tool* current_tool = tool_manager_->getCurrentTool();
590 
591  int flags = 0;
592  if (current_tool)
593  {
594  ViewportMouseEvent _vme = vme;
595 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
596  QWindow* window = vme.panel->windowHandle();
597  if (window)
598  {
599  double pixel_ratio = window->devicePixelRatio();
600  _vme.x = static_cast<int>(pixel_ratio * _vme.x);
601  _vme.y = static_cast<int>(pixel_ratio * _vme.y);
602  _vme.last_x = static_cast<int>(pixel_ratio * _vme.last_x);
603  _vme.last_y = static_cast<int>(pixel_ratio * _vme.last_y);
604  }
605 #endif
606  flags = current_tool->processMouseEvent(_vme);
607  vme.panel->setCursor(current_tool->getCursor());
608  }
609  else
610  {
611  vme.panel->setCursor(QCursor(Qt::ArrowCursor));
612  }
613 
614  if (flags & Tool::Render)
615  {
616  queueRender();
617  }
618 
619  if (flags & Tool::Finished)
620  {
622  }
623 }
624 
625 void VisualizationManager::handleChar(QKeyEvent* event, RenderPanel* panel)
626 {
627  if (event->key() == Qt::Key_Escape)
628  Q_EMIT escapePressed();
629  tool_manager_->handleChar(event, panel);
630 }
631 
633 {
634  ros::WallDuration timeout(0.1);
635  while (!shutting_down_)
636  {
637  if (update_timer_->isActive())
638  private_->threaded_queue_.callOne(timeout);
639  else
640  timeout.sleep();
641  }
642 }
643 
645 {
646  Q_EMIT configChanged();
647 }
648 
650 {
651 }
652 
654 {
655  QString frame = fixed_frame_property_->getFrame();
656 
657  frame_manager_->setFixedFrame(frame.toStdString());
659 }
660 
662 {
664 }
665 
666 void VisualizationManager::setFixedFrame(const QString& frame)
667 {
669 }
670 
671 void VisualizationManager::setStatus(const QString& message)
672 {
673  emitStatusUpdate(message);
674 }
675 
676 } // namespace rviz
void initialize()
Do initialization that wasn&#39;t done in constructor. Initializes tool manager, view manager...
ViewController * getCurrent() const
Return the current ViewController in use for the main RenderWindow.
OgreRenderQueueClearer * ogre_render_queue_clearer_
VisualizationManager(RenderPanel *render_panel, WindowManagerInterface *wm=nullptr)
Constructor Creates managers and sets up global properties.
void load(const Config &config)
virtual int processMouseEvent(ViewportMouseEvent &event)
Definition: tool.h:108
std::shared_ptr< tf2_ros::Buffer > getTF2BufferPtr() const override
Convenience function: returns getFrameManager()->getTF2BufferPtr().
f
void load(const Config &config) override
Load subproperties and the list of displays in this group from the given Config node, which must be a map.
boost::unordered_map< CollObjectHandle, Picked > M_Picked
Definition: forwards.h:63
VisualizationManagerPrivate * private_
virtual QColor getColor() const
void update()
Clear the internal cache.
void onUpdate()
Call update() on all managed objects.
void configChanged()
Emitted whenever the display configuration changes.
void setAutoRender(bool auto_render)
Display * createDisplay(const QString &class_lookup_name, const QString &name, bool enabled)
Create and add a display to this panel, by class lookup name.
TfFrameProperty * fixed_frame_property_
Frame to transform fixed data to.
void setSelection(const M_Picked &objs)
A single element of a property tree, with a name, value, description, and possibly children...
Definition: property.h:100
void preUpdate()
Emitted before updating all Displays.
Ogre::Camera * getCamera() const
void setFixedFrame(const QString &frame)
Set the coordinate frame we should be transforming all fixed data into.
CallOneResult callOne()
void unlockRender()
Unlock a mutex, allowing calls to Ogre::Root::renderOneFrame().
BoolProperty * default_light_enabled_property_
Tool * getCurrentTool()
Return the tool currently in use.
Definition: tool_manager.h:73
Config mapGetChild(const QString &key) const
If the referenced Node is a Map and it has a child with the given key, return a reference to the chil...
Definition: config.cpp:212
ros::CallbackQueueInterface * getThreadedQueue() override
Return a CallbackQueue using a different thread than the main GUI one.
void update(float wall_dt, float ros_dt) override
Call update() on all child Displays.
ros::Time getTime()
Get current time, depending on the sync mode.
void lockRender()
Lock a mutex to delay calls to Ogre::Root::renderOneFrame().
def default_value(type_)
bool setValue(const QVariant &new_value) override
Override from Property to resolve the frame name on the way in.
~VisualizationManager() override
Destructor Stops update timers and destroys all displays, tools, and managers.
Property specialized to provide max/min enforcement for integers.
Definition: int_property.h:37
void emitStatusUpdate(const QString &message)
Emits statusUpdate() signal with the given message.
const QCursor & getCursor()
Get current cursor of this tool.
Definition: tool.h:186
Display * createDisplay(const QString &class_id)
void initialize()
Initialization for after the DisplayContext is created. Loads standard RViz tools.
void setCurrentTool(Tool *tool)
Set the current tool. The current tool is given all mouse and keyboard events which VisualizationMana...
Configuration data storage class.
Definition: config.h:124
Ogre::ColourValue qtToOgre(const QColor &c)
Definition: parse_color.cpp:83
ROSCPP_DECL CallbackQueue * getGlobalCallbackQueue()
void createColorMaterial(const std::string &name, const Ogre::ColourValue &color, bool use_self_illumination)
double getWallClock()
Return the wall clock time, in seconds since 1970.
QTimer * update_timer_
Display::update is called on each display whenever this timer fires.
WindowManagerInterface * window_manager_
description
Helper class for transforming data into Ogre&#39;s world frame (the fixed frame).
Definition: frame_manager.h:70
void save(Config config) const
double getROSTimeElapsed()
Return the ROS time in seconds since the last reset.
void save(Config config) const
Save the properties of each Display and most editable rviz data.
void addDisplay(Display *display, bool enabled)
Add a display to be managed by this panel.
A Display object which stores other Displays as children.
Definition: display_group.h:47
void statusUpdate(const QString &message)
Emitted during file-loading and initialization to indicate progress.
virtual QVariant getViewData(int column, int role) const
Return data appropriate for the given column (0 or 1) and role for this Property. ...
Definition: property.cpp:241
void setStatus(const QString &message) override
void setCallbackQueue(CallbackQueueInterface *queue)
void setRenderPanel(RenderPanel *render_panel)
Set the 3D view widget whose view will be controlled by ViewController instances from by this ViewMan...
Config mapMakeChild(const QString &key)
Create a child node stored with the given key, and return the child.
Definition: config.cpp:201
The VisualizationManager class is the central manager class of rviz, holding all the Displays...
ros::CallbackQueueInterface * getUpdateQueue() override
Return the CallbackQueue using the main GUI thread.
virtual void removeAllDisplays()
Remove and destroy all child Displays, but preserve any non-Display children.
ros::Time last_update_ros_time_
Stores how long it&#39;s been since the last update.
double getROSTime()
Return the ROS time, in seconds.
void setIcon(const QIcon &icon) override
Set the icon to be displayed next to the property.
tf::TransformListener * getTFClient()
Return the tf::TransformListener used to receive transform data.
void update(float wall_dt, float ros_dt)
bool sleep() const
void setBackgroundColor(Ogre::ColourValue color)
void handleMouseEvent(const ViewportMouseEvent &event) override
Handle a mouse event.
void load(const Config &config)
Load the properties of each Display and most editable rviz data.
void setFixedFrame(const QString &fixed_frame)
Set the fixed frame in this display.
Definition: display.cpp:273
std::vector< std::string > V_string
void handleChar(QKeyEvent *event, RenderPanel *panel) override
Handle a single key event for a given RenderPanel.
void getFrameStrings(std::vector< std::string > &ids) const
void handleChar(QKeyEvent *event, RenderPanel *panel)
virtual int getInt() const
Return the internal property value as an integer.
Definition: int_property.h:74
void escapePressed()
Emitted when ESC key is pressed.
Ogre::Root * ogre_root_
Ogre Root.
void setDragDropClass(const QString &drag_drop_class)
void queueRender() override
Queues a render. Multiple calls before a render happens will only cause a single render.
void reset() override
Reset this and all child Displays.
void setFixedFrame(const std::string &frame)
Set the frame to consider "fixed", into which incoming data is transformed.
void setEnabled(bool enabled)
Enable or disable this Display.
Definition: display.cpp:256
void setStatus(Level level, const QString &name, const QString &text)
Definition: status_list.cpp:50
static WallTime now()
Property specialized to provide getter for booleans.
Definition: bool_property.h:38
double getWallClockElapsed()
Return the wall clock time in seconds since the last reset.
void removeAllDisplays()
Remove and delete all displays.
tf::TransformListener * getTFClient() const override
Convenience function: returns getFrameManager()->getTFClient().
bool frameHasProblems(const std::string &frame, ros::Time time, std::string &error)
Check to see if a frame exists in the tf::TransformListener.
void setName(const QString &name) override
Overridden from Property to set associated widget title to the new name.
Definition: display.cpp:413
QVariant getViewData(int column, int role) const override
Return data appropriate for the given column (0 or 1) and role for this Property. ...
static Time now()
void notifyConfigChanged()
Notify this VisualizationManager that something about its display configuration has changed...
ColorProperty * background_color_property_
void initialize(DisplayContext *context)
Main initialization, called after constructor, before load() or setEnabled().
Definition: display.cpp:83
IconizedProperty(const QString &name=QString(), const QVariant default_value=QVariant(), const QString &description=QString(), Property *parent=nullptr, const char *changed_slot=nullptr, QObject *receiver=nullptr)
PropertyTreeModel * display_property_tree_model_
virtual void update(float wall_dt, float ros_dt)
Definition: tool.h:94
void save(Config config) const
virtual bool getBool() const
ROSCPP_DECL void spinOnce()
virtual void addDisplay(Display *child)
Add a child Display to the end of the list of Displays.
Tool * getDefaultTool()
Get the default tool.
Definition: tool_manager.h:122
Ogre::SceneManager * scene_manager_
Ogre scene manager associated with this panel.
void startUpdate()
Start timers. Creates and starts the update and idle timers, both set to 30Hz (33ms).
QPixmap loadPixmap(QString url, bool fill_cache)
void resetTime()
Resets the wall and ROS elapsed time to zero and calls resetDisplays().
QString getFixedFrame() const override
Return the fixed frame name.
const std::shared_ptr< tf2_ros::Buffer > getTF2BufferPtr()
SelectionManager * selection_manager_
void save(Config config) const override
Save subproperties and the list of displays in this group to the given Config node.
void load(const Config &config)
uint32_t allocBit()
Return a uint32 with a single bit "on" (previously unused), or a 0 if all bits are already allocated...


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Sat May 27 2023 02:06:25