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 #include <QWindow>
37 
38 #include <boost/bind/bind.hpp>
39 
40 #include <OgreRoot.h>
41 #include <OgreSceneManager.h>
42 #include <OgreSceneNode.h>
43 #include <OgreLight.h>
44 #include <OgreViewport.h>
45 #include <OgreMaterialManager.h>
46 #include <OgreMaterial.h>
47 #include <OgreRenderWindow.h>
48 #include <OgreSharedPtr.h>
49 #include <OgreCamera.h>
50 
51 #include <boost/filesystem.hpp>
52 #include <utility>
53 
54 #include <ros/package.h>
55 #include <ros/callback_queue.h>
56 
57 #include <rviz/display.h>
58 #include <rviz/display_factory.h>
59 #include <rviz/display_group.h>
60 #include <rviz/displays_panel.h>
61 #include <rviz/frame_manager.h>
70 #include <rviz/render_panel.h>
72 #include <rviz/tool.h>
73 #include <rviz/tool_manager.h>
75 #include <rviz/view_controller.h>
76 #include <rviz/view_manager.h>
77 #include <rviz/load_resource.h>
80 
83 
84 namespace rviz
85 {
86 // helper class needed to display an icon besides "Global Options"
87 class IconizedProperty : public Property
88 {
89 public:
90  IconizedProperty(const QString& name = QString(),
91  const QVariant& default_value = QVariant(),
92  const QString& description = QString(),
93  Property* parent = nullptr)
94  : Property(name, default_value, description, parent){};
95 
96  QVariant getViewData(int column, int role) const override
97  {
98  return (column == 0 && role == Qt::DecorationRole) ? icon_ : Property::getViewData(column, role);
99  }
100  void setIcon(const QIcon& icon) override
101  {
102  icon_ = icon;
103  }
104 
105 private:
106  QIcon icon_;
107 };
108 
110 {
111 public:
113  boost::thread_group threaded_queue_threads_;
116  boost::mutex render_mutex_;
117 };
118 
121  std::shared_ptr<tf2_ros::Buffer> tf_buffer,
122  std::shared_ptr<tf2_ros::TransformListener> tf_listener)
123  : ogre_root_(Ogre::Root::getSingletonPtr())
124  , update_timer_(nullptr)
125  , shutting_down_(false)
126  , render_panel_(render_panel)
127  , time_update_timer_(0.0f)
128  , frame_update_timer_(0.0f)
129  , render_requested_(1)
130  , frame_count_(0)
131  , window_manager_(wm)
132  , private_(new VisualizationManagerPrivate)
133 {
134  // visibility_bit_allocator_ is listed after default_visibility_bit_ (and thus initialized later be
135  // default):
137 
138  frame_manager_ = new FrameManager(std::move(tf_buffer), std::move(tf_listener));
139 
140  render_panel->setAutoRender(false);
141 
143 #if (OGRE_VERSION < OGRE_VERSION_CHECK(13, 0, 0))
144  scene_manager_ = ogre_root_->createSceneManager(Ogre::ST_GENERIC);
145 #else
146  scene_manager_ = ogre_root_->createSceneManager();
147 #endif
148 
149  rviz::RenderSystem::RenderSystem::get()->prepareOverlays(scene_manager_);
150 
151  directional_light_ = scene_manager_->createLight("MainDirectional");
152  directional_light_->setType(Ogre::Light::LT_DIRECTIONAL);
153  directional_light_->setDirection(Ogre::Vector3(-1, 0, -1));
154  directional_light_->setDiffuseColour(Ogre::ColourValue(1.0f, 1.0f, 1.0f));
155 
157  root_display_group_->setName("root");
162 
163  tool_manager_ = new ToolManager(this);
166 
167  view_manager_ = new ViewManager(this);
170 
171  IconizedProperty* ip = new IconizedProperty("Global Options", QVariant(), "", root_display_group_);
172  ip->setIcon(loadPixmap("package://rviz/icons/options.png"));
173  global_options_ = ip;
174 
176  "Fixed Frame", "map", "Frame into which all data is transformed before being displayed.",
178 
180  new ColorProperty("Background Color", QColor(48, 48, 48), "Background color for the 3D view.",
182 
183  fps_property_ =
184  new IntProperty("Frame Rate", 30, "RViz will try to render this many frames per second.",
186 
188  new BoolProperty("Default Light", true, "Light source attached to the current 3D view.",
190 
192  this); // only initialize() a Display after its sub-properties are created.
194 
197 
198  global_status_ = new StatusList("Global Status", root_display_group_);
199 
201 
203 
204  update_timer_ = new QTimer;
205  connect(update_timer_, &QTimer::timeout, this, &VisualizationManager::onUpdate);
206 
207  private_->threaded_queue_threads_.create_thread(
209 
211 
213  Ogre::Root::getSingletonPtr()->addFrameListener(ogre_render_queue_clearer_);
214 }
215 
217 {
218  update_timer_->stop();
219  shutting_down_ = true;
220  private_->threaded_queue_threads_.join_all();
221 
222  delete update_timer_;
223 
224  if (selection_manager_)
225  {
227  }
228 
230  delete tool_manager_;
231  delete display_factory_;
232  delete selection_manager_;
233  delete view_manager_;
234 
235  if (ogre_root_)
236  {
237  ogre_root_->destroySceneManager(scene_manager_);
238  }
239  delete frame_manager_;
240  delete private_;
241 
242  Ogre::Root::getSingletonPtr()->removeFrameListener(ogre_render_queue_clearer_);
244 }
245 
247 {
248  emitStatusUpdate("Initializing managers.");
249 
253 
256 }
257 
259 {
260  return &private_->threaded_queue_;
261 }
262 
264 {
265  private_->render_mutex_.lock();
266 }
267 
269 {
270  private_->render_mutex_.unlock();
271 }
272 
274 {
276 }
277 
279 {
280  float interval = 1000.0 / float(fps_property_->getInt());
281  update_timer_->start(interval);
282 }
283 
285 {
286  update_timer_->stop();
287 }
288 
289 void createColorMaterial(const std::string& name,
290  const Ogre::ColourValue& color,
291  bool use_self_illumination)
292 {
293  Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().create(
294  name, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
295  mat->setAmbient(color * 0.5f);
296  mat->setDiffuse(color);
297  if (use_self_illumination)
298  {
299  mat->setSelfIllumination(color);
300  }
301  mat->setLightingEnabled(true);
302  mat->setReceiveShadows(false);
303 }
304 
306 {
307  createColorMaterial("RVIZ/Red", Ogre::ColourValue(1.0f, 0.0f, 0.0f, 1.0f), true);
308  createColorMaterial("RVIZ/Green", Ogre::ColourValue(0.0f, 1.0f, 0.0f, 1.0f), true);
309  createColorMaterial("RVIZ/Blue", Ogre::ColourValue(0.0f, 0.0f, 1.0f, 1.0f), true);
310  createColorMaterial("RVIZ/Cyan", Ogre::ColourValue(0.0f, 1.0f, 1.0f, 1.0f), true);
311  createColorMaterial("RVIZ/ShadedRed", Ogre::ColourValue(1.0f, 0.0f, 0.0f, 1.0f), false);
312  createColorMaterial("RVIZ/ShadedGreen", Ogre::ColourValue(0.0f, 1.0f, 0.0f, 1.0f), false);
313  createColorMaterial("RVIZ/ShadedBlue", Ogre::ColourValue(0.0f, 0.0f, 1.0f, 1.0f), false);
314  createColorMaterial("RVIZ/ShadedCyan", Ogre::ColourValue(0.0f, 1.0f, 1.0f, 1.0f), false);
315 }
316 
318 {
319  render_requested_ = 1;
320 }
321 
323 {
326  float wall_dt = wall_diff.toSec();
327  float ros_dt = ros_diff.toSec();
330 
331  if (ros_dt < 0.0)
332  {
333  resetTime();
334  }
335 
336  ros::spinOnce();
337 
338  Q_EMIT preUpdate();
339 
341 
342  root_display_group_->update(wall_dt, ros_dt);
343 
344  view_manager_->update(wall_dt, ros_dt);
345 
346  time_update_timer_ += wall_dt;
347 
348  if (time_update_timer_ > 0.1f)
349  {
350  time_update_timer_ = 0.0f;
351 
352  updateTime();
353  }
354 
355  frame_update_timer_ += wall_dt;
356 
357  if (frame_update_timer_ > 1.0f)
358  {
359  frame_update_timer_ = 0.0f;
360 
361  updateFrames();
362  }
363 
365 
367  {
368  tool_manager_->getCurrentTool()->update(wall_dt, ros_dt);
369  }
370 
372  {
373  directional_light_->setDirection(view_manager_->getCurrent()->getCamera()->getDerivedDirection());
374  }
375 
376  frame_count_++;
377 
378  if (render_requested_ || wall_dt > 0.01)
379  {
380  render_requested_ = 0;
381  boost::mutex::scoped_lock lock(private_->render_mutex_);
382  ogre_root_->renderOneFrame();
383  }
384 }
385 
387 {
388  if (ros_time_begin_.isZero())
389  {
391  }
392 
394 
396  {
398  }
399 
401 }
402 
404 {
405  if (!frame_manager_->getTF2BufferPtr()->_frameExists(getFixedFrame().toStdString()))
406  {
407  bool no_frames = frame_manager_->getTF2BufferPtr()->allFramesAsString().empty();
409  no_frames ? QString("No TF data") :
410  QString("Unknown frame %1").arg(getFixedFrame()));
411  }
412  else
413  {
414  global_status_->setStatus(StatusProperty::Ok, "Fixed Frame", "OK");
415  }
416 }
417 
418 std::shared_ptr<tf2_ros::Buffer> VisualizationManager::getTF2BufferPtr() const
419 {
421 }
422 
424 {
426  frame_manager_->getTF2BufferPtr()->clear();
429 
430  queueRender();
431 }
432 
433 void VisualizationManager::addDisplay(Display* display, bool enabled)
434 {
436  display->initialize(this);
437  display->setEnabled(enabled);
438 }
439 
441 {
443 }
444 
445 void VisualizationManager::emitStatusUpdate(const QString& message)
446 {
447  Q_EMIT statusUpdate(message);
448 }
449 
451 {
452  stopUpdate();
453 
454  emitStatusUpdate("Creating displays");
456 
457  emitStatusUpdate("Creating tools");
458  tool_manager_->load(config.mapGetChild("Tools"));
459 
460  emitStatusUpdate("Creating views");
461  view_manager_->load(config.mapGetChild("Views"));
462 
463  startUpdate();
464 }
465 
467 {
469  tool_manager_->save(config.mapMakeChild("Tools"));
470  view_manager_->save(config.mapMakeChild("Views"));
471 }
472 
473 Display*
474 VisualizationManager::createDisplay(const QString& class_lookup_name, const QString& name, bool enabled)
475 {
476  QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
477  Display* new_display = root_display_group_->createDisplay(class_lookup_name);
478  addDisplay(new_display, enabled);
479  new_display->setName(name);
480  QApplication::restoreOverrideCursor();
481  return new_display;
482 }
483 
485 {
486  return ros::WallTime::now().toSec();
487 }
488 
490 {
491  return frame_manager_->getTime().toSec();
492 }
493 
495 {
496  return wall_clock_elapsed_.toSec();
497 }
498 
500 {
501  return (frame_manager_->getTime() - ros_time_begin_).toSec();
502 }
503 
505 {
507 
508  queueRender();
509 }
510 
512 {
513  if (update_timer_->isActive())
514  {
515  startUpdate();
516  }
517 }
518 
520 {
522 }
523 
525 {
526  // process pending mouse events
527  Tool* current_tool = tool_manager_->getCurrentTool();
528 
529  int flags = 0;
530  if (current_tool)
531  {
532  ViewportMouseEvent _vme = vme;
533  QWindow* window = vme.panel->windowHandle();
534  if (window)
535  {
536  double pixel_ratio = window->devicePixelRatio();
537  _vme.x = static_cast<int>(pixel_ratio * _vme.x);
538  _vme.y = static_cast<int>(pixel_ratio * _vme.y);
539  _vme.last_x = static_cast<int>(pixel_ratio * _vme.last_x);
540  _vme.last_y = static_cast<int>(pixel_ratio * _vme.last_y);
541  }
542  flags = current_tool->processMouseEvent(_vme);
543  vme.panel->setCursor(current_tool->getCursor());
544  }
545  else
546  {
547  vme.panel->setCursor(QCursor(Qt::ArrowCursor));
548  }
549 
550  if (flags & Tool::Render)
551  {
552  queueRender();
553  }
554 
555  if (flags & Tool::Finished)
556  {
558  }
559 }
560 
561 void VisualizationManager::handleChar(QKeyEvent* event, RenderPanel* panel)
562 {
563  if (event->key() == Qt::Key_Escape)
564  Q_EMIT escapePressed();
565  tool_manager_->handleChar(event, panel);
566 }
567 
569 {
570  ros::WallDuration timeout(0.1);
571  while (!shutting_down_)
572  {
573  if (update_timer_->isActive())
574  private_->threaded_queue_.callOne(timeout);
575  else
576  timeout.sleep();
577  }
578 }
579 
581 {
582  Q_EMIT configChanged();
583 }
584 
586 {
587 }
588 
590 {
591  QString frame = fixed_frame_property_->getFrame();
592 
593  frame_manager_->setFixedFrame(frame.toStdString());
595 }
596 
598 {
600 }
601 
602 void VisualizationManager::setFixedFrame(const QString& frame)
603 {
605 }
606 
607 void VisualizationManager::setStatus(const QString& message)
608 {
609  emitStatusUpdate(message);
610 }
611 
612 } // namespace rviz
rviz::FrameManager::getTF2BufferPtr
const std::shared_ptr< tf2_ros::Buffer > getTF2BufferPtr()
Definition: frame_manager.h:209
rviz::VisualizationManager::getROSTimeElapsed
double getROSTimeElapsed()
Return the ROS time in seconds since the last reset.
Definition: visualization_manager.cpp:499
rviz::BoolProperty::getBool
virtual bool getBool() const
Definition: bool_property.cpp:48
rviz::FrameManager
Helper class for transforming data into Ogre's world frame (the fixed frame).
Definition: frame_manager.h:64
render_system.h
rviz::DisplayGroup::reset
void reset() override
Reset this and all child Displays.
Definition: display_group.cpp:247
ros::WallDuration::sleep
bool sleep() const
rviz::VisualizationManager::VisualizationManager
VisualizationManager(RenderPanel *render_panel, WindowManagerInterface *wm=nullptr, std::shared_ptr< tf2_ros::Buffer > tf_buffer=std::shared_ptr< tf2_ros::Buffer >(), std::shared_ptr< tf2_ros::TransformListener > tf_listener=std::shared_ptr< tf2_ros::TransformListener >())
Constructor Creates managers and sets up global properties.
Definition: visualization_manager.cpp:119
rviz::DisplayGroup::removeAllDisplays
virtual void removeAllDisplays()
Remove and destroy all child Displays, but preserve any non-Display children.
Definition: display_group.cpp:156
rviz::BitAllocator::allocBit
uint32_t allocBit()
Return a uint32 with a single bit "on" (previously unused), or a 0 if all bits are already allocated.
Definition: bit_allocator.cpp:38
view_manager.h
rviz::VisualizationManager::last_update_ros_time_
ros::Time last_update_ros_time_
Stores how long it's been since the last update.
Definition: visualization_manager.h:409
rviz::VisualizationManager::onToolChanged
void onToolChanged(Tool *)
Definition: visualization_manager.cpp:585
rviz::DisplayGroup::save
void save(Config config) const override
Save subproperties and the list of displays in this group to the given Config node.
Definition: display_group.cpp:140
rviz::VisualizationManager::getROSTime
double getROSTime()
Return the ROS time, in seconds.
Definition: visualization_manager.cpp:489
rviz::ColorProperty::getColor
virtual QColor getColor() const
Definition: color_property.h:79
rviz::VisualizationManager::setStatus
void setStatus(const QString &message) override
Definition: visualization_manager.cpp:607
rviz::VisualizationManager::statusUpdate
void statusUpdate(const QString &message)
Emitted during file-loading and initialization to indicate progress.
rviz::qtToOgre
Ogre::ColourValue qtToOgre(const QColor &c)
Definition: parse_color.cpp:83
window_manager_interface.h
Ogre
Definition: axes_display.h:35
frame_manager.h
rviz::ToolManager
Definition: tool_manager.h:48
rviz::FrameManager::setFixedFrame
void setFixedFrame(const std::string &frame)
Set the frame to consider "fixed", into which incoming data is transformed.
Definition: frame_manager.cpp:91
rviz::Display::setFixedFrame
void setFixedFrame(const QString &fixed_frame)
Set the fixed frame in this display.
Definition: display.cpp:276
rviz::Display::initialize
void initialize(DisplayContext *context)
Main initialization, called after constructor, before load() or setEnabled().
Definition: display.cpp:84
rviz::Tool
Definition: tool.h:56
rviz::VisualizationManagerPrivate::threaded_queue_
ros::CallbackQueue threaded_queue_
Definition: visualization_manager.cpp:112
rviz::VisualizationManager::handleChar
void handleChar(QKeyEvent *event, RenderPanel *panel) override
Handle a single key event for a given RenderPanel.
Definition: visualization_manager.cpp:561
rviz::ViewManager::update
void update(float wall_dt, float ros_dt)
Definition: view_manager.cpp:69
rviz::VisualizationManager::wall_clock_begin_
ros::WallTime wall_clock_begin_
Definition: visualization_manager.h:428
rviz::StatusProperty::Error
@ Error
Definition: status_property.h:46
rviz::SelectionManager::initialize
void initialize()
Definition: selection_manager.cpp:122
rviz::VisualizationManager::ros_time_begin_
ros::Time ros_time_begin_
Definition: visualization_manager.h:429
display_factory.h
rviz::VisualizationManager::getUpdateQueue
ros::CallbackQueueInterface * getUpdateQueue() override
Return the CallbackQueue using the main GUI thread.
Definition: visualization_manager.cpp:273
rviz::IconizedProperty
Definition: visualization_manager.cpp:87
rviz::ToolManager::save
void save(Config config) const
Definition: tool_manager.cpp:105
rviz::PropertyTreeModel
Definition: property_tree_model.h:38
rviz::VisualizationManager::ogre_root_
Ogre::Root * ogre_root_
Ogre Root.
Definition: visualization_manager.h:405
rviz::VisualizationManager::global_options_
Property * global_options_
Definition: visualization_manager.h:420
rviz::Property::getViewData
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
rviz::VisualizationManager::updateFps
void updateFps()
Definition: visualization_manager.cpp:511
rviz::VisualizationManager::escapePressed
void escapePressed()
Emitted when ESC key is pressed.
rviz::VisualizationManager::queueRender
void queueRender() override
Queues a render. Multiple calls before a render happens will only cause a single render.
Definition: visualization_manager.cpp:317
status_list.h
rviz::VisualizationManager::load
void load(const Config &config)
Load the properties of each Display and most editable rviz data.
Definition: visualization_manager.cpp:450
property.h
rviz::createColorMaterial
void createColorMaterial(const std::string &name, const Ogre::ColourValue &color, bool use_self_illumination)
Definition: visualization_manager.cpp:289
rviz::VisualizationManager::handleMouseEvent
void handleMouseEvent(const ViewportMouseEvent &event) override
Handle a mouse event.
Definition: visualization_manager.cpp:524
int_property.h
rviz::VisualizationManager::render_requested_
uint32_t render_requested_
Definition: visualization_manager.h:440
rviz::BoolProperty
Property specialized to provide getter for booleans.
Definition: bool_property.h:38
rviz::ViewportMouseEvent
Definition: viewport_mouse_event.h:45
description
description
rviz::ViewportMouseEvent::x
int x
Definition: viewport_mouse_event.h:157
rviz::ToolManager::getDefaultTool
Tool * getDefaultTool()
Get the default tool.
Definition: tool_manager.h:122
ros::spinOnce
ROSCPP_DECL void spinOnce()
rviz::VisualizationManager::removeAllDisplays
void removeAllDisplays()
Remove and delete all displays.
Definition: visualization_manager.cpp:440
viewport_mouse_event.h
TimeBase< WallTime, WallDuration >::toSec
double toSec() const
rviz::VisualizationManager::frame_manager_
FrameManager * frame_manager_
Definition: visualization_manager.h:445
rviz::VisualizationManager::createColorMaterials
void createColorMaterials()
Definition: visualization_manager.cpp:305
rviz::VisualizationManagerPrivate::update_nh_
ros::NodeHandle update_nh_
Definition: visualization_manager.cpp:114
selection_manager.h
rviz::VisualizationManager::notifyConfigChanged
void notifyConfigChanged()
Notify this VisualizationManager that something about its display configuration has changed.
Definition: visualization_manager.cpp:580
rviz::TfFrameProperty::setValue
bool setValue(const QVariant &new_value) override
Override from Property to resolve the frame name on the way in.
Definition: tf_frame_property.cpp:55
rviz::ViewManager::load
void load(const Config &config)
Definition: view_manager.cpp:224
rviz::VisualizationManager::getWallClockElapsed
double getWallClockElapsed()
Return the wall clock time in seconds since the last reset.
Definition: visualization_manager.cpp:494
rviz::loadPixmap
QPixmap loadPixmap(const QString &url, bool fill_cache)
Definition: load_resource.cpp:65
rviz::ToolManager::configChanged
void configChanged()
Emitted when anything changes which will change the saved config file contents.
rviz::DisplayGroup::createDisplay
Display * createDisplay(const QString &class_id)
Definition: display_group.cpp:119
rviz::ToolManager::handleChar
void handleChar(QKeyEvent *event, RenderPanel *panel)
Definition: tool_manager.cpp:129
rviz::VisualizationManager::frame_update_timer_
float frame_update_timer_
Definition: visualization_manager.h:436
rviz::VisualizationManager::display_factory_
DisplayFactory * display_factory_
Definition: visualization_manager.h:456
f
f
rviz::ColorProperty
Definition: color_property.h:40
rviz::DisplayGroup::update
void update(float wall_dt, float ros_dt) override
Call update() on all child Displays.
Definition: display_group.cpp:234
tool.h
rviz::VisualizationManager::ros_time_elapsed_
ros::Duration ros_time_elapsed_
Definition: visualization_manager.h:431
rviz::Display
Definition: display.h:63
rviz::VisualizationManager::background_color_property_
ColorProperty * background_color_property_
Definition: visualization_manager.h:433
rviz::FrameManager::getTime
ros::Time getTime()
Get current time, depending on the sync mode.
Definition: frame_manager.h:114
rviz::Property
A single element of a property tree, with a name, value, description, and possibly children.
Definition: property.h:100
displays_panel.h
rviz::StatusList
Definition: status_list.h:36
rviz::VisualizationManager::display_property_tree_model_
PropertyTreeModel * display_property_tree_model_
Definition: visualization_manager.h:414
rviz::VisualizationManager::selection_manager_
SelectionManager * selection_manager_
Definition: visualization_manager.h:438
rviz::Tool::update
virtual void update(float wall_dt, float ros_dt)
Definition: tool.h:94
rviz::ToolManager::load
void load(const Config &config)
Definition: tool_manager.cpp:87
rviz::VisualizationManager::threadedQueueThreadFunc
void threadedQueueThreadFunc()
Definition: visualization_manager.cpp:568
rviz::VisualizationManager::default_visibility_bit_
uint32_t default_visibility_bit_
Definition: visualization_manager.h:458
ros::CallbackQueue
rviz::VisualizationManager::startUpdate
void startUpdate()
Start timers. Creates and starts the update and idle timers, both set to 30Hz (33ms).
Definition: visualization_manager.cpp:278
rviz::VisualizationManager::scene_manager_
Ogre::SceneManager * scene_manager_
Ogre scene manager associated with this panel.
Definition: visualization_manager.h:406
rviz::Display::setEnabled
void setEnabled(bool enabled)
Enable or disable this Display.
Definition: display.cpp:259
rviz
Definition: add_display_dialog.cpp:54
rviz::VisualizationManager::last_update_wall_time_
ros::WallTime last_update_wall_time_
Definition: visualization_manager.h:410
TimeBase< Time, Duration >::isZero
bool isZero() const
rviz::VisualizationManager::resetTime
void resetTime()
Resets the wall and ROS elapsed time to zero and calls resetDisplays().
Definition: visualization_manager.cpp:423
rviz::VisualizationManager::getFixedFrame
QString getFixedFrame() const override
Return the fixed frame name.
Definition: visualization_manager.cpp:597
rviz::ToolManager::toolChanged
void toolChanged(Tool *)
Emitted by setCurrentTool() after the newly chosen tool is activated.
color_property.h
ros::WallTime::now
static WallTime now()
rviz::VisualizationManager::wall_clock_elapsed_
ros::WallDuration wall_clock_elapsed_
Definition: visualization_manager.h:430
rviz::PropertyTreeModel::configChanged
void configChanged()
Emitted when a Property which should be saved changes.
rviz::StatusList::setStatus
void setStatus(Level level, const QString &name, const QString &text)
Definition: status_list.cpp:50
rviz::StatusProperty::Ok
@ Ok
Definition: status_property.h:44
rviz::Tool::Render
@ Render
Definition: tool.h:102
rviz::ViewportMouseEvent::y
int y
Definition: viewport_mouse_event.h:158
rviz::DisplayGroup::load
void load(const Config &config) override
Load subproperties and the list of displays in this group from the given Config node,...
Definition: display_group.cpp:57
rviz::SelectionManager::update
void update()
Definition: selection_manager.cpp:501
rviz::VisualizationManager::updateFixedFrame
void updateFixedFrame()
Definition: visualization_manager.cpp:589
rviz::StatusProperty::Warn
@ Warn
Definition: status_property.h:45
rviz::ViewportMouseEvent::panel
RenderPanel * panel
Definition: viewport_mouse_event.h:154
rviz::VisualizationManager::ogre_render_queue_clearer_
OgreRenderQueueClearer * ogre_render_queue_clearer_
Definition: visualization_manager.h:447
rviz::ViewManager::getCurrent
ViewController * getCurrent() const
Return the current ViewController in use for the main RenderWindow.
Definition: view_manager.cpp:90
rviz::VisualizationManager::updateFrames
void updateFrames()
Definition: visualization_manager.cpp:403
rviz::VisualizationManager::initialize
void initialize()
Do initialization that wasn't done in constructor. Initializes tool manager, view manager,...
Definition: visualization_manager.cpp:246
property_tree_model.h
rviz::VisualizationManager::render_panel_
RenderPanel * render_panel_
Definition: visualization_manager.h:426
rviz::VisualizationManagerPrivate::render_mutex_
boost::mutex render_mutex_
Definition: visualization_manager.cpp:116
rviz::VisualizationManager::updateBackgroundColor
void updateBackgroundColor()
Definition: visualization_manager.cpp:504
display_group.h
rviz::QtOgreRenderWindow::setBackgroundColor
void setBackgroundColor(Ogre::ColourValue color)
Definition: qt_ogre_render_window.cpp:251
ros::WallTime
package.h
rviz::ViewManager
Definition: view_manager.h:53
rviz::OgreRenderQueueClearer
Definition: ogre_render_queue_clearer.h:42
ros::NodeHandle::setCallbackQueue
void setCallbackQueue(CallbackQueueInterface *queue)
rviz::TfFrameProperty
Definition: tf_frame_property.h:41
callback_queue.h
rviz::VisualizationManager::onUpdate
void onUpdate()
Call update() on all managed objects.
Definition: visualization_manager.cpp:322
visualization_manager.h
render_panel.h
rviz::IconizedProperty::icon_
QIcon icon_
Definition: visualization_manager.cpp:106
tf_frame_property.h
rviz::Tool::processMouseEvent
virtual int processMouseEvent(ViewportMouseEvent &event)
Definition: tool.h:108
rviz::VisualizationManager::fps_property_
IntProperty * fps_property_
Definition: visualization_manager.h:423
rviz::Display::setName
void setName(const QString &name) override
Overridden from Property to set associated widget title to the new name.
Definition: display.cpp:402
rviz::DisplayGroup::addDisplay
virtual void addDisplay(Display *child)
Add a child Display to the end of the list of Displays.
Definition: display_group.cpp:268
rviz::DisplayFactory
Definition: display_factory.h:42
rviz::VisualizationManager::root_display_group_
DisplayGroup * root_display_group_
Definition: visualization_manager.h:415
rviz::VisualizationManager::setFixedFrame
void setFixedFrame(const QString &frame)
Set the coordinate frame we should be transforming all fixed data into.
Definition: visualization_manager.cpp:602
rviz::VisualizationManagerPrivate::threaded_queue_threads_
boost::thread_group threaded_queue_threads_
Definition: visualization_manager.cpp:113
rviz::ViewController::getCamera
Ogre::Camera * getCamera() const
Definition: view_controller.h:147
display.h
ogre_render_queue_clearer.h
rviz::IconizedProperty::setIcon
void setIcon(const QIcon &icon) override
Set the icon to be displayed next to the property.
Definition: visualization_manager.cpp:100
rviz::VisualizationManager::unlockRender
void unlockRender()
Unlock a mutex, allowing calls to Ogre::Root::renderOneFrame().
Definition: visualization_manager.cpp:268
rviz::VisualizationManager::private_
VisualizationManagerPrivate * private_
Definition: visualization_manager.h:457
ros::Time
rviz::VisualizationManagerPrivate
Definition: visualization_manager.cpp:109
rviz::VisualizationManager::shutting_down_
volatile bool shutting_down_
Definition: visualization_manager.h:412
rviz::TfFrameProperty::getFrame
QString getFrame() const
Definition: tf_frame_property.cpp:99
rviz::VisualizationManager::stopUpdate
void stopUpdate()
Definition: visualization_manager.cpp:284
tf_buffer
tf2_ros::Buffer * tf_buffer
rviz::VisualizationManager::configChanged
void configChanged()
Emitted whenever the display configuration changes.
rviz::VisualizationManager::createDisplay
Display * createDisplay(const QString &class_lookup_name, const QString &name, bool enabled)
Create and add a display to this panel, by class lookup name.
Definition: visualization_manager.cpp:474
rviz::SelectionManager
Definition: selection_manager.h:81
rviz::VisualizationManager::getThreadedQueue
ros::CallbackQueueInterface * getThreadedQueue() override
Return a CallbackQueue using a different thread than the main GUI one.
Definition: visualization_manager.cpp:258
rviz::ViewManager::save
void save(Config config) const
Definition: view_manager.cpp:251
rviz::VisualizationManager::directional_light_
Ogre::Light * directional_light_
Definition: visualization_manager.h:461
rviz::VisualizationManager::fixed_frame_property_
TfFrameProperty * fixed_frame_property_
Frame to transform fixed data to.
Definition: visualization_manager.h:421
rviz::VisualizationManager::lockRender
void lockRender()
Lock a mutex to delay calls to Ogre::Root::renderOneFrame().
Definition: visualization_manager.cpp:263
rviz::VisualizationManager::visibility_bit_allocator_
BitAllocator visibility_bit_allocator_
Definition: visualization_manager.h:459
rviz::VisualizationManager::global_status_
StatusList * global_status_
Definition: visualization_manager.h:422
rviz::SelectionManager::setSelection
void setSelection(const M_Picked &objs)
Definition: selection_manager.cpp:1214
default_value
def default_value(type_)
rviz::VisualizationManager::~VisualizationManager
~VisualizationManager() override
Destructor Stops update timers and destroys all displays, tools, and managers.
Definition: visualization_manager.cpp:216
rviz::VisualizationManager::frame_count_
uint64_t frame_count_
Definition: visualization_manager.h:441
rviz::VisualizationManager::tool_manager_
ToolManager * tool_manager_
Definition: visualization_manager.h:417
rviz::VisualizationManager::preUpdate
void preUpdate()
Emitted before updating all Displays.
rviz::ViewManager::initialize
void initialize()
Definition: view_manager.cpp:64
rviz::ToolManager::getCurrentTool
Tool * getCurrentTool()
Return the tool currently in use.
Definition: tool_manager.h:73
rviz::IntProperty::getInt
virtual int getInt() const
Return the internal property value as an integer.
Definition: int_property.h:96
rviz::FrameManager::update
void update()
Clear the internal cache.
Definition: frame_manager.cpp:60
load_resource.h
view_controller.h
rviz::VisualizationManager::default_light_enabled_property_
BoolProperty * default_light_enabled_property_
Definition: visualization_manager.h:424
ros::CallbackQueue::callOne
CallOneResult callOne()
rviz::IconizedProperty::IconizedProperty
IconizedProperty(const QString &name=QString(), const QVariant &default_value=QVariant(), const QString &description=QString(), Property *parent=nullptr)
Definition: visualization_manager.cpp:90
rviz::ViewportMouseEvent::last_y
int last_y
Definition: viewport_mouse_event.h:165
rviz::QtOgreRenderWindow::setAutoRender
void setAutoRender(bool auto_render)
Definition: qt_ogre_render_window.h:117
rviz::ViewManager::setRenderPanel
void setRenderPanel(RenderPanel *render_panel)
Set the 3D view widget whose view will be controlled by ViewController instances from by this ViewMan...
Definition: view_manager.cpp:273
rviz::VisualizationManager::view_manager_
ViewManager * view_manager_
Definition: visualization_manager.h:418
rviz::ViewportMouseEvent::last_x
int last_x
Definition: viewport_mouse_event.h:164
rviz::VisualizationManager::getWallClock
double getWallClock()
Return the wall clock time, in seconds since 1970.
Definition: visualization_manager.cpp:484
DurationBase< WallDuration >::toSec
double toSec() const
rviz::ToolManager::initialize
void initialize()
Initialization for after the DisplayContext is created. Loads standard RViz tools.
Definition: tool_manager.cpp:67
rviz::WindowManagerInterface
Definition: window_manager_interface.h:40
tool_manager.h
rviz::RenderPanel
Definition: render_panel.h:74
ros::WallDuration
rviz::ToolManager::setCurrentTool
void setCurrentTool(Tool *tool)
Set the current tool. The current tool is given all mouse and keyboard events which VisualizationMana...
Definition: tool_manager.cpp:172
rviz::VisualizationManager::emitStatusUpdate
void emitStatusUpdate(const QString &message)
Emits statusUpdate() signal with the given message.
Definition: visualization_manager.cpp:445
config
config
rviz::VisualizationManager::time_update_timer_
float time_update_timer_
Definition: visualization_manager.h:435
ros::Duration
rviz::VisualizationManager::addDisplay
void addDisplay(Display *display, bool enabled)
Add a display to be managed by this panel.
Definition: visualization_manager.cpp:433
rviz::M_Picked
boost::unordered_map< CollObjectHandle, Picked > M_Picked
Definition: forwards.h:63
rviz::VisualizationManager::save
void save(Config config) const
Save the properties of each Display and most editable rviz data.
Definition: visualization_manager.cpp:466
rviz::VisualizationManager::updateDefaultLightVisible
void updateDefaultLightVisible()
Definition: visualization_manager.cpp:519
rviz::Tool::getCursor
const QCursor & getCursor()
Get current cursor of this tool.
Definition: tool.h:186
rviz::VisualizationManager::updateTime
void updateTime()
Definition: visualization_manager.cpp:386
rviz::Tool::Finished
@ Finished
Definition: tool.h:103
rviz::ViewManager::configChanged
void configChanged()
rviz::Config
Configuration data storage class.
Definition: config.h:124
rviz::DisplayGroup
A Display object which stores other Displays as children.
Definition: display_group.h:47
rviz::PropertyTreeModel::setDragDropClass
void setDragDropClass(const QString &drag_drop_class)
Definition: property_tree_model.h:53
qt_ogre_render_window.h
ros::CallbackQueueInterface
rviz::VisualizationManager::getTF2BufferPtr
std::shared_ptr< tf2_ros::Buffer > getTF2BufferPtr() const
Convenience function: returns getFrameManager()->getTF2BufferPtr().
Definition: visualization_manager.cpp:418
ros::NodeHandle
rviz::VisualizationManagerPrivate::threaded_nh_
ros::NodeHandle threaded_nh_
Definition: visualization_manager.cpp:115
rviz::IconizedProperty::getViewData
QVariant getViewData(int column, int role) const override
Return data appropriate for the given column (0 or 1) and role for this Property.
Definition: visualization_manager.cpp:96
ros::getGlobalCallbackQueue
ROSCPP_DECL CallbackQueue * getGlobalCallbackQueue()
rviz::IntProperty
Property specialized to provide max/min enforcement for integers.
Definition: int_property.h:37
ros::Time::now
static Time now()
parse_color.h
rviz::VisualizationManager::update_timer_
QTimer * update_timer_
Display::update is called on each display whenever this timer fires.
Definition: visualization_manager.h:408


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust, William Woodall
autogenerated on Fri Dec 13 2024 03:31:03