overlay_camera_display.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 <boost/bind.hpp>
37 
38 #include <OgreManualObject.h>
39 #include <OgreMaterialManager.h>
40 #include <OgreRectangle2D.h>
41 #include <OgreRenderSystem.h>
42 #include <OgreRenderWindow.h>
43 #include <OgreSceneManager.h>
44 #include <OgreSceneNode.h>
45 #include <OgreTextureManager.h>
46 #include <OgreViewport.h>
47 #include <OgreTechnique.h>
48 #include <OgreCamera.h>
49 #include <OgrePixelFormat.h>
50 #include <OGRE/OgreHardwarePixelBuffer.h>
51 #include <OGRE/OgreTechnique.h>
52 #include <tf/transform_listener.h>
53 
54 #include "rviz/bit_allocator.h"
55 #include "rviz/frame_manager.h"
56 #include "rviz/ogre_helpers/axes.h"
61 #include "rviz/render_panel.h"
63 #include "rviz/validate_floats.h"
64 #include "rviz/display_context.h"
66 #include "rviz/load_resource.h"
67 
69 #include "overlay_camera_display.h"
70 
71 namespace jsk_rviz_plugins
72 {
73 using namespace rviz;
74 const QString OverlayCameraDisplay::BACKGROUND( "background" );
75 const QString OverlayCameraDisplay::OVERLAY( "overlay" );
76 const QString OverlayCameraDisplay::BOTH( "background and overlay" );
77 
78 bool validateFloats(const sensor_msgs::CameraInfo& msg)
79 {
80  bool valid = true;
81  valid = valid && rviz::validateFloats( msg.D );
82  valid = valid && rviz::validateFloats( msg.K );
83  valid = valid && rviz::validateFloats( msg.R );
84  valid = valid && rviz::validateFloats( msg.P );
85  return valid;
86 }
87 
90  , texture_()
91  , render_panel_( 0 )
92  , caminfo_tf_filter_( 0 )
93  , new_caminfo_( false )
94  , force_render_( false )
95  , caminfo_ok_(false)
96 {
97  image_position_property_ = new EnumProperty( "Image Rendering", BOTH,
98  "Render the image behind all other geometry or overlay it on top, or both.",
99  this, SLOT( forceRender() ));
100  image_position_property_->addOption( BACKGROUND );
101  image_position_property_->addOption( OVERLAY );
102  image_position_property_->addOption( BOTH );
103 
104  alpha_property_ = new FloatProperty( "Overlay Alpha", 0.5,
105  "The amount of transparency to apply to the camera image when rendered as overlay.",
106  this, SLOT( updateAlpha() ));
107  alpha_property_->setMin( 0 );
108  alpha_property_->setMax( 1 );
109 
110 
111  zoom_property_ = new FloatProperty( "Zoom Factor", 1.0,
112  "Set a zoom factor below 1 to see a larger part of the world, above 1 to magnify the image.",
113  this, SLOT( forceRender() ));
114  zoom_property_->setMin( 0.00001 );
115  zoom_property_->setMax( 100000 );
116 
117  width_property_ = new IntProperty("width", 640,
118  "width of overlay image",
119  this, SLOT(updateWidth()));
120  height_property_ = new IntProperty("height", 480,
121  "height of overlay image",
122  this, SLOT(updateHeight()));
123  left_property_ = new IntProperty("left", 0,
124  "left positoin of overlay image",
125  this, SLOT(updateLeft()));
126  top_property_ = new IntProperty("top", 0,
127  "top positoin of overlay image",
128  this, SLOT(updateTop()));
129  texture_alpha_property_ = new FloatProperty("texture alpha", 0.8,
130  "texture alpha",
131  this, SLOT(updateTextureAlpha()));
132  texture_alpha_property_->setMin(0.0);
133  texture_alpha_property_->setMax(1.0);
134 }
135 
137 {
138  if ( initializedp_ )
139  {
140  render_panel_->getRenderWindow()->removeListener( this );
141 
142  unsubscribe();
144 
145 
146  //workaround. delete results in a later crash
147  render_panel_->hide();
148  //delete render_panel_;
149 
150  delete bg_screen_rect_;
151  delete fg_screen_rect_;
152 
153  bg_scene_node_->getParentSceneNode()->removeAndDestroyChild( bg_scene_node_->getName() );
154  fg_scene_node_->getParentSceneNode()->removeAndDestroyChild( fg_scene_node_->getName() );
155 
156  delete caminfo_tf_filter_;
157 
159  }
160 }
161 
163 {
165 
166 #if ROS_VERSION_MINIMUM(1, 15, 0) // noetic and greater
170 #else
172  *context_->getTFClient(), fixed_frame_.toStdString(),
174 #endif
175 
176  bg_scene_node_ = scene_node_->createChildSceneNode();
177  fg_scene_node_ = scene_node_->createChildSceneNode();
178 
179  {
180  static int count = 0;
182  ss << "OverlayCameraDisplayObject" << count++;
183 
184  //background rectangle
185  bg_screen_rect_ = new Ogre::Rectangle2D(true);
186  bg_screen_rect_->setCorners(-1.0f, 1.0f, 1.0f, -1.0f);
187 
188  ss << "Material";
189  bg_material_ = Ogre::MaterialManager::getSingleton().create( ss.str(), Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME );
190  bg_material_->setDepthWriteEnabled(false);
191 
192  bg_material_->setReceiveShadows(false);
193  bg_material_->setDepthCheckEnabled(false);
194 
195  bg_material_->getTechnique(0)->setLightingEnabled(false);
196  Ogre::TextureUnitState* tu = bg_material_->getTechnique(0)->getPass(0)->createTextureUnitState();
197  tu->setTextureName(texture_.getTexture()->getName());
198  tu->setTextureFiltering( Ogre::TFO_NONE );
199  tu->setAlphaOperation( Ogre::LBX_SOURCE1, Ogre::LBS_MANUAL, Ogre::LBS_CURRENT, 0.0 );
200 
201  bg_material_->setCullingMode(Ogre::CULL_NONE);
202  bg_material_->setSceneBlending( Ogre::SBT_REPLACE );
203 
204  Ogre::AxisAlignedBox aabInf;
205  aabInf.setInfinite();
206 
207  bg_screen_rect_->setRenderQueueGroup(Ogre::RENDER_QUEUE_BACKGROUND);
208  bg_screen_rect_->setBoundingBox(aabInf);
209 #if ((OGRE_VERSION_MAJOR << 16) | (OGRE_VERSION_MINOR << 8) | OGRE_VERSION_PATCH) < ((1 << 16) | (10 << 8) | 0)
210  bg_screen_rect_->setMaterial(bg_material_->getName());
211 #else
212  bg_screen_rect_->setMaterial(bg_material_);
213 #endif
214 
215  bg_scene_node_->attachObject(bg_screen_rect_);
216  bg_scene_node_->setVisible(false);
217 
218  //overlay rectangle
219  fg_screen_rect_ = new Ogre::Rectangle2D(true);
220  fg_screen_rect_->setCorners(-1.0f, 1.0f, 1.0f, -1.0f);
221 
222  fg_material_ = bg_material_->clone( ss.str()+"fg" );
223  fg_screen_rect_->setBoundingBox(aabInf);
224 #if ((OGRE_VERSION_MAJOR << 16) | (OGRE_VERSION_MINOR << 8) | OGRE_VERSION_PATCH) < ((1 << 16) | (10 << 8) | 0)
225  fg_screen_rect_->setMaterial(fg_material_->getName());
226 #else
227  fg_screen_rect_->setMaterial(fg_material_);
228 #endif
229 
230  fg_material_->setSceneBlending( Ogre::SBT_TRANSPARENT_ALPHA );
231  fg_screen_rect_->setRenderQueueGroup(Ogre::RENDER_QUEUE_OVERLAY - 1);
232 
233  fg_scene_node_->attachObject(fg_screen_rect_);
234  fg_scene_node_->setVisible(false);
235  }
236 
237  updateAlpha();
238 
239  updateWidth();
240  updateHeight();
241  updateLeft();
242  updateTop();
244 
245  render_panel_ = new RenderPanel();
246  render_panel_->getRenderWindow()->addListener( this );
247  render_panel_->getRenderWindow()->setAutoUpdated(false);
248  render_panel_->getRenderWindow()->setActive( false );
249  render_panel_->resize( 640, 480 );
251 
252  //setAssociatedWidget( render_panel_ );
253 
256  render_panel_->getCamera()->setNearClipDistance( 0.01f );
257 
259  caminfo_tf_filter_->registerCallback(boost::bind(&OverlayCameraDisplay::caminfoCallback, this, _1));
260  //context_->getFrameManager()->registerFilterForTransformStatusCheck(caminfo_tf_filter_, this);
261 
263  render_panel_->getViewport()->setVisibilityMask( vis_bit_ );
264 
266  vis_bit_, context_->getRootDisplayGroup(), this, "Visibility", true,
267  "Changes the visibility of other Displays in the camera view.");
268 
269  visibility_property_->setIcon( loadPixmap("package://rviz/icons/visibility.svg",true) );
270 
271  this->addChild( visibility_property_, 0 );
272  initializedp_ = true;
273 }
274 
275 void OverlayCameraDisplay::preRenderTargetUpdate(const Ogre::RenderTargetEvent& evt)
276 {
277  QString image_position = image_position_property_->getString();
278  bg_scene_node_->setVisible( caminfo_ok_ && (image_position == BACKGROUND || image_position == BOTH) );
279  fg_scene_node_->setVisible( caminfo_ok_ && (image_position == OVERLAY || image_position == BOTH) );
280 
281  // set view flags on all displays
283 }
284 
285 void OverlayCameraDisplay::postRenderTargetUpdate(const Ogre::RenderTargetEvent& evt)
286 {
287  bg_scene_node_->setVisible( false );
288  fg_scene_node_->setVisible( false );
289 }
290 
292 {
293  subscribe();
294  render_panel_->getRenderWindow()->setActive(true);
295  if (overlay_) {
296  overlay_->show();
297  }
298 }
299 
301 {
302  render_panel_->getRenderWindow()->setActive(false);
303  unsubscribe();
304  clear();
305  if (overlay_) {
306  overlay_->hide();
307  }
308 }
309 
311 {
312  if ( (!isEnabled()) || (topic_property_->getTopicStd().empty()) )
313  {
314  return;
315  }
316 
317  std::string target_frame = fixed_frame_.toStdString();
318  ImageDisplayBase::enableTFFilter(target_frame);
319 
321 
322  std::string topic = topic_property_->getTopicStd();
324 
325  try
326  {
327  caminfo_sub_.subscribe( update_nh_, caminfo_topic, 1 );
328  setStatus( StatusProperty::Ok, "Camera Info", "OK" );
329  }
330  catch( ros::Exception& e )
331  {
332  setStatus( StatusProperty::Error, "Camera Info", QString( "Error subscribing: ") + e.what() );
333  }
334 }
335 
337 {
340 }
341 
343 {
344  float alpha = alpha_property_->getFloat();
345 
346  Ogre::Pass* pass = fg_material_->getTechnique( 0 )->getPass( 0 );
347  if( pass->getNumTextureUnitStates() > 0 )
348  {
349  Ogre::TextureUnitState* tex_unit = pass->getTextureUnitState( 0 );
350  tex_unit->setAlphaOperation( Ogre::LBX_MODULATE, Ogre::LBS_MANUAL, Ogre::LBS_CURRENT, alpha );
351  }
352  else
353  {
354  fg_material_->setAmbient( Ogre::ColourValue( 0.0f, 1.0f, 1.0f, alpha ));
355  fg_material_->setDiffuse( Ogre::ColourValue( 0.0f, 1.0f, 1.0f, alpha ));
356  }
357 
358  force_render_ = true;
360 }
361 
363 {
364  force_render_ = true;
366 }
367 
369 {
372 }
373 
375 {
376  texture_.clear();
377  force_render_ = true;
379 
380  new_caminfo_ = false;
381  current_caminfo_.reset();
382 
383  setStatus( StatusProperty::Warn, "Camera Info",
384  "No CameraInfo received on [" + QString::fromStdString( caminfo_sub_.getTopic() ) + "]. Topic may not exist.");
385  setStatus( StatusProperty::Warn, "Image", "No Image received");
386 
387  render_panel_->getCamera()->setPosition( Ogre::Vector3( 999999, 999999, 999999 ));
388 }
389 
390 void OverlayCameraDisplay::update( float wall_dt, float ros_dt )
391 {
392  try
393  {
395  {
397  force_render_ = false;
398  }
399  }
401  {
402  setStatus( StatusProperty::Error, "Image", e.what() );
403  }
404 
405  render_panel_->getRenderWindow()->update();
406  if (!overlay_) {
407  static int count = 0;
409  ss << "OverlayCameraImageDisplayObject" << count++;
410  overlay_.reset(new OverlayObject(ss.str()));
411  overlay_->show();
412  }
413  overlay_->updateTextureSize(render_panel_->getRenderWindow()->getWidth(),
414  render_panel_->getRenderWindow()->getHeight());
415  redraw();
416  overlay_->setDimensions(width_, height_);
417  overlay_->setPosition(left_, top_);
418 }
419 
421 {
422  Ogre::RenderTarget *rt = render_panel_->getRenderWindow();
423  int width = rt->getWidth();
424  int height = rt->getHeight();
425  Ogre::uchar *data = new Ogre::uchar[width * height * 3];
426  Ogre::PixelBox pb(width, height, 1, Ogre::PF_BYTE_RGB, data);
427  rt->copyContentsToMemory(pb);
428  {
429  ScopedPixelBuffer buffer = overlay_->getBuffer();
430  QImage Hud = buffer.getQImage(*overlay_);
431  for (int i = 0; i < overlay_->getTextureWidth(); i++) {
432  for (int j = 0; j < overlay_->getTextureHeight(); j++) {
433  Ogre::ColourValue c = pb.getColourAt(i, j, 0);
434  QColor color(c.r * 255, c.g * 255, c.b * 255, texture_alpha_ * 255);
435  Hud.setPixel(i, j, color.rgba());
436  }
437  }
438  }
439  delete[] data;
440 }
441 
443 {
444  sensor_msgs::CameraInfo::ConstPtr info;
445  sensor_msgs::Image::ConstPtr image;
446  {
447  boost::mutex::scoped_lock lock( caminfo_mutex_ );
448 
449  info = current_caminfo_;
450  image = texture_.getImage();
451  }
452 
453  if( !info || !image )
454  {
455  return false;
456  }
457 
458  if( !validateFloats( *info ))
459  {
460  setStatus( StatusProperty::Error, "Camera Info", "Contains invalid floating point values (nans or infs)" );
461  return false;
462  }
463 
464  // if we're in 'exact' time mode, only show image if the time is exactly right
465  ros::Time rviz_time = context_->getFrameManager()->getTime();
467  rviz_time != image->header.stamp )
468  {
469  std::ostringstream s;
470  s << "Time-syncing active and no image at timestamp " << rviz_time.toSec() << ".";
471  setStatus( StatusProperty::Warn, "Time", s.str().c_str() );
472  return false;
473  }
474 
475  Ogre::Vector3 position;
476  Ogre::Quaternion orientation;
477  context_->getFrameManager()->getTransform( image->header.frame_id, image->header.stamp, position, orientation );
478 
479  //printf( "OverlayCameraDisplay:updateCamera(): pos = %.2f, %.2f, %.2f.\n", position.x, position.y, position.z );
480 
481  // convert vision (Z-forward) frame to ogre frame (Z-out)
482  orientation = orientation * Ogre::Quaternion( Ogre::Degree( 180 ), Ogre::Vector3::UNIT_X );
483 
484  float img_width = info->width;
485  float img_height = info->height;
486 
487  // If the image width is 0 due to a malformed caminfo, try to grab the width from the image.
488  if( img_width == 0 )
489  {
490  ROS_DEBUG( "Malformed CameraInfo on camera [%s], width = 0", qPrintable( getName() ));
491  img_width = texture_.getWidth();
492  }
493 
494  if (img_height == 0)
495  {
496  ROS_DEBUG( "Malformed CameraInfo on camera [%s], height = 0", qPrintable( getName() ));
497  img_height = texture_.getHeight();
498  }
499 
500  if( img_height == 0.0 || img_width == 0.0 )
501  {
502  setStatus( StatusProperty::Error, "Camera Info",
503  "Could not determine width/height of image due to malformed CameraInfo (either width or height is 0)" );
504  return false;
505  }
506 
507  double fx = info->P[0];
508  double fy = info->P[5];
509 
510  float win_width = render_panel_->width();
511  float win_height = render_panel_->height();
512  float zoom_x = zoom_property_->getFloat();
513  float zoom_y = zoom_x;
514 
515  // Preserve aspect ratio
516  if( win_width != 0 && win_height != 0 )
517  {
518  float img_aspect = (img_width/fx) / (img_height/fy);
519  float win_aspect = win_width / win_height;
520 
521  if ( img_aspect > win_aspect )
522  {
523  zoom_y = zoom_y / img_aspect * win_aspect;
524  }
525  else
526  {
527  zoom_x = zoom_x / win_aspect * img_aspect;
528  }
529  }
530 
531  // Add the camera's translation relative to the left camera (from P[3]);
532  double tx = -1 * (info->P[3] / fx);
533  Ogre::Vector3 right = orientation * Ogre::Vector3::UNIT_X;
534  position = position + (right * tx);
535 
536  double ty = -1 * (info->P[7] / fy);
537  Ogre::Vector3 down = orientation * Ogre::Vector3::UNIT_Y;
538  position = position + (down * ty);
539 
540  if( !rviz::validateFloats( position ))
541  {
542  setStatus( StatusProperty::Error, "Camera Info", "CameraInfo/P resulted in an invalid position calculation (nans or infs)" );
543  return false;
544  }
545 
546  render_panel_->getCamera()->setPosition( position );
547  render_panel_->getCamera()->setOrientation( orientation );
548 
549  // calculate the projection matrix
550  double cx = info->P[2];
551  double cy = info->P[6];
552 
553  double far_plane = 100;
554  double near_plane = 0.01;
555 
556  Ogre::Matrix4 proj_matrix;
557  proj_matrix = Ogre::Matrix4::ZERO;
558 
559  proj_matrix[0][0]= 2.0 * fx/img_width * zoom_x;
560  proj_matrix[1][1]= 2.0 * fy/img_height * zoom_y;
561 
562  proj_matrix[0][2]= 2.0 * (0.5 - cx/img_width) * zoom_x;
563  proj_matrix[1][2]= 2.0 * (cy/img_height - 0.5) * zoom_y;
564 
565  proj_matrix[2][2]= -(far_plane+near_plane) / (far_plane-near_plane);
566  proj_matrix[2][3]= -2.0*far_plane*near_plane / (far_plane-near_plane);
567 
568  proj_matrix[3][2]= -1;
569 
570  render_panel_->getCamera()->setCustomProjectionMatrix( true, proj_matrix );
571  render_panel_->resize(info->width, info->height);
572  setStatus( StatusProperty::Ok, "Camera Info", "OK" );
573 
574 #if 0
575  static Axes* debug_axes = new Axes(scene_manager_, 0, 0.2, 0.01);
576  debug_axes->setPosition(position);
577  debug_axes->setOrientation(orientation);
578 #endif
579 
580  //adjust the image rectangles to fit the zoom & aspect ratio
581  bg_screen_rect_->setCorners( -1.0f*zoom_x, 1.0f*zoom_y, 1.0f*zoom_x, -1.0f*zoom_y );
582  fg_screen_rect_->setCorners( -1.0f*zoom_x, 1.0f*zoom_y, 1.0f*zoom_x, -1.0f*zoom_y );
583 
584  Ogre::AxisAlignedBox aabInf;
585  aabInf.setInfinite();
586  bg_screen_rect_->setBoundingBox( aabInf );
587  fg_screen_rect_->setBoundingBox( aabInf );
588 
589  setStatus( StatusProperty::Ok, "Time", "ok" );
590  setStatus( StatusProperty::Ok, "Camera Info", "ok" );
591 
592  return true;
593 }
594 
595 void OverlayCameraDisplay::processMessage(const sensor_msgs::Image::ConstPtr& msg)
596 {
597  texture_.addMessage(msg);
598 }
599 
600 void OverlayCameraDisplay::caminfoCallback( const sensor_msgs::CameraInfo::ConstPtr& msg )
601 {
602  boost::mutex::scoped_lock lock( caminfo_mutex_ );
604  new_caminfo_ = true;
605 }
606 
608 {
609  std::string targetFrame = fixed_frame_.toStdString();
610  caminfo_tf_filter_->setTargetFrame(targetFrame);
612 }
613 
615 {
617  clear();
618 }
619 
621 {
623 }
624 
626 {
628 }
629 
631 {
633 }
634 
636 {
638 }
639 
641 {
643 }
644 
645 }
646 
jsk_rviz_plugins::OverlayCameraDisplay::render_panel_
RenderPanel * render_panel_
Definition: overlay_camera_display.h:116
jsk_rviz_plugins::OverlayCameraDisplay
Definition: overlay_camera_display.h:89
rviz::Display::isEnabled
bool isEnabled() const
rviz::BitAllocator::allocBit
uint32_t allocBit()
jsk_rviz_plugins::OverlayCameraDisplay::overlay_
OverlayObject::Ptr overlay_
Definition: overlay_camera_display.h:168
jsk_rviz_plugins::OverlayCameraDisplay::OVERLAY
static const QString OVERLAY
Definition: overlay_camera_display.h:107
image_transport::getCameraInfoTopic
IMAGE_TRANSPORT_DECL std::string getCameraInfoTopic(const std::string &base_topic)
axes.h
rviz::ImageDisplayBase::fixedFrameChanged
void fixedFrameChanged() override
jsk_rviz_plugins::OverlayCameraDisplay::top_
int top_
Definition: overlay_camera_display.h:176
rviz::ImageDisplayBase::onInitialize
void onInitialize() override
rviz::ImageDisplayBase::enableTFFilter
void enableTFFilter(std::string &targetFrame)
rviz::DisplayContext::queueRender
virtual void queueRender()=0
msg
msg
tf2_ros::MessageFilter
jsk_rviz_plugins::OverlayCameraDisplay::bg_screen_rect_
Ogre::Rectangle2D * bg_screen_rect_
Definition: overlay_camera_display.h:139
jsk_rviz_plugins::OverlayCameraDisplay::height_property_
rviz::IntProperty * height_property_
Definition: overlay_camera_display.h:171
rviz::DisplayGroupVisibilityProperty::update
void update() override
jsk_rviz_plugins::OverlayCameraDisplay::texture_alpha_property_
rviz::FloatProperty * texture_alpha_property_
Definition: overlay_camera_display.h:174
rviz::StatusProperty::Error
Error
rviz::ImageDisplayBase::unsubscribe
virtual void unsubscribe()
rviz::QtOgreRenderWindow::getCamera
Ogre::Camera * getCamera() const
jsk_rviz_plugins::OverlayCameraDisplay::caminfoCallback
void caminfoCallback(const sensor_msgs::CameraInfo::ConstPtr &msg)
Definition: overlay_camera_display.cpp:632
jsk_rviz_plugins::OverlayCameraDisplay::texture_
ROSImageTexture texture_
Definition: overlay_camera_display.h:115
jsk_rviz_plugins::OverlayCameraDisplay::left_property_
rviz::IntProperty * left_property_
Definition: overlay_camera_display.h:172
jsk_rviz_plugins::ScopedPixelBuffer
Definition: overlay_utils.h:101
rviz_mouse_point_to_tablet.lock
lock
Definition: rviz_mouse_point_to_tablet.py:11
jsk_rviz_plugins::OverlayCameraDisplay::postRenderTargetUpdate
virtual void postRenderTargetUpdate(const Ogre::RenderTargetEvent &evt)
Definition: overlay_camera_display.cpp:317
jsk_rviz_plugins::OverlayCameraDisplay::bg_scene_node_
Ogre::SceneNode * bg_scene_node_
Definition: overlay_camera_display.h:136
int_property.h
frame_manager.h
tf::MessageFilter::connectInput
void connectInput(F &f)
jsk_rviz_plugins::OverlayCameraDisplay::redraw
void redraw()
Definition: overlay_camera_display.cpp:452
jsk_rviz_plugins::OverlayCameraDisplay::caminfo_ok_
bool caminfo_ok_
Definition: overlay_camera_display.h:162
rviz::Property::addChild
virtual void addChild(Property *child, int index=-1)
TimeBase< Time, Duration >::toSec
double toSec() const
validate_floats.h
jsk_rviz_plugins::OverlayCameraDisplay::~OverlayCameraDisplay
virtual ~OverlayCameraDisplay()
Definition: overlay_camera_display.cpp:168
rviz::ROSImageTexture::clear
void clear()
enum_property.h
jsk_rviz_plugins::OverlayCameraDisplay::clear
void clear()
Definition: overlay_camera_display.cpp:406
jsk_rviz_plugins::OverlayCameraDisplay::top_property_
rviz::IntProperty * top_property_
Definition: overlay_camera_display.h:173
ros::Exception
jsk_rviz_plugins::OverlayCameraDisplay::updateLeft
void updateLeft()
Definition: overlay_camera_display.cpp:662
jsk_rviz_plugins::OverlayCameraDisplay::updateQueueSize
virtual void updateQueueSize()
Definition: overlay_camera_display.cpp:400
jsk_rviz_plugins::OverlayCameraDisplay::left_
int left_
Definition: overlay_camera_display.h:176
jsk_rviz_plugins::OverlayCameraDisplay::update
virtual void update(float wall_dt, float ros_dt)
Definition: overlay_camera_display.cpp:422
rviz::Display::fixed_frame_
QString fixed_frame_
rviz::UniformStringStream
jsk_rviz_plugins::OverlayCameraDisplay::caminfo_sub_
message_filters::Subscriber< sensor_msgs::CameraInfo > caminfo_sub_
Definition: overlay_camera_display.h:145
jsk_rviz_plugins::OverlayCameraDisplay::processMessage
virtual void processMessage(const sensor_msgs::Image::ConstPtr &msg)
Definition: overlay_camera_display.cpp:627
jsk_rviz_plugins::OverlayCameraDisplay::alpha_property_
FloatProperty * alpha_property_
Definition: overlay_camera_display.h:152
jsk_rviz_plugins::OverlayCameraDisplay::preRenderTargetUpdate
virtual void preRenderTargetUpdate(const Ogre::RenderTargetEvent &evt)
Definition: overlay_camera_display.cpp:307
jsk_rviz_plugins::OverlayCameraDisplay::texture_alpha_
float texture_alpha_
Definition: overlay_camera_display.h:177
rviz::ROSImageTexture::getWidth
uint32_t getWidth()
rviz::validateFloats
bool validateFloats(const boost::array< T, N > &arr)
loadPixmap
QPixmap loadPixmap(const QString &url, bool fill_cache)
message_filters::Subscriber::unsubscribe
void unsubscribe()
jsk_rviz_plugins::OverlayCameraDisplay::visibility_property_
DisplayGroupVisibilityProperty * visibility_property_
Definition: overlay_camera_display.h:155
data
data
jsk_rviz_plugins::OverlayCameraDisplay::caminfo_tf_filter_
tf::MessageFilter< sensor_msgs::CameraInfo > * caminfo_tf_filter_
Definition: overlay_camera_display.h:149
rviz::DisplayContext::getSceneManager
virtual Ogre::SceneManager * getSceneManager() const=0
rviz::ROSImageTexture::getHeight
uint32_t getHeight()
float_property.h
jsk_rviz_plugins::OverlayCameraDisplay::vis_bit_
uint32_t vis_bit_
Definition: overlay_camera_display.h:166
message_filters::Subscriber::getTopic
std::string getTopic() const
rviz::Display
rviz::EnumProperty
jsk_rviz_plugins::OverlayCameraDisplay::bg_material_
Ogre::MaterialPtr bg_material_
Definition: overlay_camera_display.h:140
rviz::FloatProperty
rviz::FrameManager::getTime
ros::Time getTime()
class_list_macros.h
rviz::Display::setStatus
virtual void setStatus(StatusProperty::Level level, const QString &name, const QString &text)
bit_allocator.h
rviz::RenderPanel::initialize
void initialize(Ogre::SceneManager *scene_manager, DisplayContext *manager)
jsk_rviz_plugins::OverlayCameraDisplay::fg_screen_rect_
Ogre::Rectangle2D * fg_screen_rect_
Definition: overlay_camera_display.h:142
jsk_rviz_plugins::OverlayCameraDisplay::initializedp_
bool initializedp_
Definition: overlay_camera_display.h:178
rviz::FloatProperty::getFloat
virtual float getFloat() const
jsk_rviz_plugins::OverlayCameraDisplay::onDisable
virtual void onDisable()
Definition: overlay_camera_display.cpp:332
render_panel.h
ROS_DEBUG
#define ROS_DEBUG(...)
rviz
jsk_rviz_plugins::OverlayCameraDisplay::BOTH
static const QString BOTH
Definition: overlay_camera_display.h:108
rviz::RenderWidget::getRenderWindow
Ogre::RenderWindow * getRenderWindow()
rviz::Display::scene_node_
Ogre::SceneNode * scene_node_
jsk_rviz_plugins::OverlayCameraDisplay::updateTop
void updateTop()
Definition: overlay_camera_display.cpp:667
display_group_visibility_property.h
rviz::StatusProperty::Ok
Ok
rviz::StatusProperty::Warn
Warn
rviz::Display::scene_manager_
Ogre::SceneManager * scene_manager_
jsk_rviz_plugins::OverlayCameraDisplay::onInitialize
virtual void onInitialize()
Definition: overlay_camera_display.cpp:194
jsk_rviz_plugins::OverlayCameraDisplay::updateWidth
void updateWidth()
Definition: overlay_camera_display.cpp:652
rviz::StringProperty::getString
QString getString()
load_resource.h
jsk_rviz_plugins::OverlayCameraDisplay::onEnable
virtual void onEnable()
Definition: overlay_camera_display.cpp:323
jsk_rviz_plugins::OverlayCameraDisplay::width_
int width_
Definition: overlay_camera_display.h:175
tf::MessageFilter::setQueueSize
virtual void setQueueSize(uint32_t new_queue_size)
rviz::ROSImageTexture::addMessage
void addMessage(const sensor_msgs::Image::ConstPtr &image)
contact_state_marker.alpha
alpha
Definition: contact_state_marker.py:90
rviz::DisplayContext::getRootDisplayGroup
virtual DisplayGroup * getRootDisplayGroup() const=0
rviz::DisplayContext::getFrameManager
virtual FrameManager * getFrameManager() const=0
jsk_rviz_plugins::OverlayCameraDisplay::updateTextureAlpha
void updateTextureAlpha()
Definition: overlay_camera_display.cpp:672
jsk_rviz_plugins::OverlayCameraDisplay::force_render_
bool force_render_
Definition: overlay_camera_display.h:164
width
width
rviz::Axes
rviz::RosTopicProperty::getTopicStd
std::string getTopicStd() const
jsk_rviz_plugins::OverlayCameraDisplay::fg_scene_node_
Ogre::SceneNode * fg_scene_node_
Definition: overlay_camera_display.h:137
rviz::DisplayContext::visibilityBits
virtual BitAllocator * visibilityBits()=0
rviz::ImageDisplayBase
jsk_rviz_plugins::OverlayCameraDisplay::fg_material_
Ogre::MaterialPtr fg_material_
Definition: overlay_camera_display.h:143
jsk_rviz_plugins::validateFloats
bool validateFloats(const sensor_msgs::CameraInfo &msg)
Definition: overlay_camera_display.cpp:110
jsk_rviz_plugins::OverlayCameraDisplay::OverlayCameraDisplay
OverlayCameraDisplay()
Definition: overlay_camera_display.cpp:120
message_filters::Subscriber::subscribe
void subscribe()
transform_listener.h
camera_common.h
PLUGINLIB_EXPORT_CLASS
PLUGINLIB_EXPORT_CLASS(jsk_rviz_plugins::PictogramArrayDisplay, rviz::Display)
jsk_rviz_plugins::OverlayCameraDisplay::subscribe
void subscribe()
Definition: overlay_camera_display.cpp:342
jsk_rviz_plugins::OverlayCameraDisplay::unsubscribe
void unsubscribe()
Definition: overlay_camera_display.cpp:368
rviz::FrameManager::getTransform
bool getTransform(const Header &header, Ogre::Vector3 &position, Ogre::Quaternion &orientation)
jsk_rviz_plugins::OverlayCameraDisplay::height_
int height_
Definition: overlay_camera_display.h:175
rviz::FrameManager::getSyncMode
SyncMode getSyncMode()
rviz::Property::getName
virtual QString getName() const
f
f
rviz::Display::context_
DisplayContext * context_
rviz::ROSImageTexture::getImage
const sensor_msgs::Image::ConstPtr & getImage()
ros::Time
rviz::ROSImageTexture::update
bool update()
jsk_rviz_plugins::OverlayCameraDisplay::BACKGROUND
static const QString BACKGROUND
Definition: overlay_camera_display.h:106
tf::MessageFilter::setTargetFrame
void setTargetFrame(const std::string &target_frame)
jsk_rviz_plugins::OverlayCameraDisplay::fixedFrameChanged
virtual void fixedFrameChanged()
Definition: overlay_camera_display.cpp:639
tf::MessageFilter< sensor_msgs::CameraInfo >
point_test.count
int count
Definition: point_test.py:15
rviz::ImageDisplayBase::reset
void reset() override
rviz::ImageDisplayBase::updateQueueSize
virtual void updateQueueSize()
jsk_rviz_plugins::OverlayCameraDisplay::forceRender
void forceRender()
Definition: overlay_camera_display.cpp:394
rviz::Property::setIcon
virtual void setIcon(const QIcon &icon)
jsk_rviz_plugins::ScopedPixelBuffer::getQImage
virtual QImage getQImage(unsigned int width, unsigned int height)
Definition: overlay_utils.cpp:89
jsk_rviz_plugins::OverlayCameraDisplay::image_position_property_
EnumProperty * image_position_property_
Definition: overlay_camera_display.h:153
motor_states_temperature_decomposer.s
s
Definition: motor_states_temperature_decomposer.py:79
jsk_rviz_plugins::OverlayCameraDisplay::updateHeight
void updateHeight()
Definition: overlay_camera_display.cpp:657
rviz::IntProperty::getInt
virtual int getInt() const
tf::MessageFilter::clear
void clear()
target_frame
std::string target_frame
rviz::Axes::setPosition
void setPosition(const Ogre::Vector3 &position) override
rviz::QtOgreRenderWindow::setAutoRender
void setAutoRender(bool auto_render)
rviz::QtOgreRenderWindow::setOverlaysEnabled
void setOverlaysEnabled(bool overlays_enabled)
rviz::UnsupportedImageEncoding
rviz::RenderPanel
rviz::ROSImageTexture::getTexture
const Ogre::TexturePtr & getTexture()
rviz::Axes::setOrientation
void setOrientation(const Ogre::Quaternion &orientation) override
jsk_rviz_plugins::OverlayCameraDisplay::current_caminfo_
sensor_msgs::CameraInfo::ConstPtr current_caminfo_
Definition: overlay_camera_display.h:157
rviz::ImageDisplayBase::topic_property_
RosTopicProperty * topic_property_
overlay_camera_display.h
height
height
rviz::QtOgreRenderWindow::getViewport
Ogre::Viewport * getViewport() const
jsk_rviz_plugins::OverlayCameraDisplay::caminfo_mutex_
boost::mutex caminfo_mutex_
Definition: overlay_camera_display.h:158
jsk_rviz_plugins::OverlayCameraDisplay::reset
virtual void reset()
Definition: overlay_camera_display.cpp:646
rviz::ImageDisplayBase::queue_size_property_
IntProperty * queue_size_property_
jsk_rviz_plugins::OverlayObject
Definition: overlay_utils.h:121
jsk_rviz_plugins::OverlayCameraDisplay::width_property_
rviz::IntProperty * width_property_
Definition: overlay_camera_display.h:170
jsk_rviz_plugins
Definition: __init__.py:1
rviz::BitAllocator::freeBits
void freeBits(uint32_t bits)
rviz::DisplayContext::getTF2BufferPtr
std::shared_ptr< tf2_ros::Buffer > getTF2BufferPtr() const
rviz::Display::update_nh_
ros::NodeHandle update_nh_
ros_topic_property.h
rviz::ImageDisplayBase::subscribe
virtual void subscribe()
jsk_rviz_plugins::OverlayCameraDisplay::zoom_property_
FloatProperty * zoom_property_
Definition: overlay_camera_display.h:154
uniform_string_stream.h
jsk_rviz_plugins::OverlayCameraDisplay::updateAlpha
void updateAlpha()
Definition: overlay_camera_display.cpp:374
rviz::IntProperty
display_context.h
jsk_rviz_plugins::OverlayCameraDisplay::updateCamera
bool updateCamera()
Definition: overlay_camera_display.cpp:474
rviz::FrameManager::SyncExact
SyncExact
jsk_rviz_plugins::OverlayCameraDisplay::new_caminfo_
bool new_caminfo_
Definition: overlay_camera_display.h:160
rviz::DisplayGroupVisibilityProperty


jsk_rviz_plugins
Author(s): Kei Okada , Yohei Kakiuchi , Shohei Fujii , Ryohei Ueda
autogenerated on Fri Dec 13 2024 03:49:56