hri_humans.cpp
Go to the documentation of this file.
1 // Copyright 2021 PAL Robotics S.L.
2 // Copyright 2012, Willow Garage, Inc.
3 //
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are met:
6 //
7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 //
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 //
14 // * Neither the name of the Willow Garage, Inc., PAL Robotics S.L. nor the
15 // names of its contributors may be used to endorse or promote products
16 // derived from this software without specific prior written permission.
17 //
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 // POSSIBILITY OF SUCH DAMAGE.
29 
30 #include "hri_humans.hpp"
31 
32 #include <OGRE/OgreCamera.h>
33 #include <OGRE/OgreManualObject.h>
34 #include <OGRE/OgreMaterialManager.h>
35 #include <OGRE/OgreRectangle2D.h>
36 #include <OGRE/OgreRenderSystem.h>
37 #include <OGRE/OgreRenderWindow.h>
38 #include <OGRE/OgreRoot.h>
39 #include <OGRE/OgreSceneManager.h>
40 #include <OGRE/OgreSceneNode.h>
41 #include <OGRE/OgreTechnique.h>
42 #include <OGRE/OgreTextureManager.h>
43 #include <OGRE/OgreViewport.h>
44 #include <cv_bridge/cv_bridge.h>
45 #include <hri_msgs/IdsList.h>
46 #include <hri_msgs/NormalizedPointOfInterest2D.h>
47 #include <hri_msgs/Skeleton2D.h>
49 #include <rviz/display_context.h>
50 #include <rviz/frame_manager.h>
52 #include <rviz/render_panel.h>
53 #include <rviz/validate_floats.h>
55 #include <stdlib.h> // srand, rand
56 
57 #include <boost/bind.hpp>
58 #include <opencv2/opencv.hpp>
59 #include <sstream>
60 #include <string>
61 #include <unordered_map>
62 #include <vector>
63 
64 #define SKELETON_POINTS 18
65 
66 #define JOINT_RADIUS 8
67 
68 using namespace std;
69 
70 cv::Scalar get_color_from_id(std::string id) {
71  hash<string> hasher;
72  size_t hash = hasher(id);
73  srand(hash);
74  cv::Mat3f hsv(cv::Vec3f(rand() % 360, 0.7, 0.8));
75  cv::Mat3f bgr;
76  cv::cvtColor(hsv, bgr, cv::COLOR_HSV2BGR);
77  return cv::Scalar(bgr(0, 0) * 255);
78 }
79 
80 int clip(int n, int lower, int upper){
81  return std::max(lower, std::min(n, upper));
82 }
83 
84 namespace rviz {
85 HumansDisplay::HumansDisplay() : ImageDisplayBase(), texture_() {
87  new BoolProperty("Normalize Range", true,
88  "If set to true, will try to estimate the range of "
89  "possible values from the received images.",
90  this, SLOT(updateNormalizeOptions()));
91 
92  min_property_ = new FloatProperty("Min Value", 0.0,
93  "Value which will be displayed as black.",
94  this, SLOT(updateNormalizeOptions()));
95 
96  max_property_ = new FloatProperty("Max Value", 1.0,
97  "Value which will be displayed as white.",
98  this, SLOT(updateNormalizeOptions()));
99 
101  "Median window", 5,
102  "Window size for median filter used for computin min/max.", this,
103  SLOT(updateNormalizeOptions()));
104 
106  "Show face RoIs", true, "If set to true, show faces bounding boxes.",
107  this, SLOT(updateShowFaces()));
108 
110  "Show facial landmarks", true, "If set to true, show faces facial landmarks.",
111  this, SLOT(updateShowFacialLandmarks()));
112 
114  "Show body RoIs", true, "If set to true, show bodies bounding boxes.",
115  this, SLOT(updateShowBodies()));
116 
118  "Show 2D Skeletons", true, "If set to true, show 2D skeletons.",
119  this, SLOT(updateShowSkeletons()));
120 
121  show_faces_ = true;
122  show_facial_landmarks_ = true;
123  show_bodies_ = true;
124  show_skeletons_ = true;
125  got_float_image_ = false;
126 }
127 
130  {
131  static uint32_t count = 0;
132  std::stringstream ss;
133  ss << "HumansDisplay" << count++;
134  img_scene_manager_ = Ogre::Root::getSingleton().createSceneManager(
135  Ogre::ST_GENERIC, ss.str());
136  }
137 
139  img_scene_manager_->getRootSceneNode()->createChildSceneNode();
140 
141  {
142  static int count = 0;
143  std::stringstream ss;
144  ss << "HumansDisplayObject" << count++;
145 
146  screen_rect_ = new Ogre::Rectangle2D(true);
147  screen_rect_->setRenderQueueGroup(Ogre::RENDER_QUEUE_OVERLAY - 1);
148  screen_rect_->setCorners(-1.0f, 1.0f, 1.0f, -1.0f);
149 
150  ss << "Material";
151  material_ = Ogre::MaterialManager::getSingleton().create(
152  ss.str(), Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
153  material_->setSceneBlending(Ogre::SBT_REPLACE);
154  material_->setDepthWriteEnabled(false);
155  material_->setReceiveShadows(false);
156  material_->setDepthCheckEnabled(false);
157 
158  material_->getTechnique(0)->setLightingEnabled(false);
159  Ogre::TextureUnitState* tu =
160  material_->getTechnique(0)->getPass(0)->createTextureUnitState();
161  tu->setTextureName(texture_.getTexture()->getName());
162  tu->setTextureFiltering(Ogre::TFO_NONE);
163 
164  material_->setCullingMode(Ogre::CULL_NONE);
165  Ogre::AxisAlignedBox aabInf;
166  aabInf.setInfinite();
167  screen_rect_->setBoundingBox(aabInf);
169  img_scene_node_->attachObject(screen_rect_);
170  }
171 
172  render_panel_ = new RenderPanel();
173  render_panel_->getRenderWindow()->setAutoUpdated(false);
174  render_panel_->getRenderWindow()->setActive(false);
175 
176  render_panel_->resize(640, 480);
178 
180 
183  render_panel_->getCamera()->setNearClipDistance(0.01f);
184 
186 }
187 
189  if (initialized()) {
190  delete render_panel_;
191  delete screen_rect_;
192  removeAndDestroyChildNode(img_scene_node_->getParentSceneNode(),
194  }
195 }
196 
199  render_panel_->getRenderWindow()->setActive(true);
200 }
201 
203  render_panel_->getRenderWindow()->setActive(false);
205  reset();
206 }
207 
210 }
211 
214 }
215 
218 }
219 
222 }
223 
225  if (got_float_image_) {
226  bool normalize = normalize_property_->getBool();
227 
229  min_property_->setHidden(normalize);
230  max_property_->setHidden(normalize);
232 
236  } else {
238  min_property_->setHidden(true);
239  max_property_->setHidden(true);
241  }
242 }
243 
244 void HumansDisplay::update(float wall_dt, float ros_dt) {
245  Q_UNUSED(wall_dt)
246  Q_UNUSED(ros_dt)
247  try {
248  texture_.update();
249 
250  // make sure the aspect ratio of the image is preserved
251  float win_width = render_panel_->width();
252  float win_height = render_panel_->height();
253 
254  float img_width = texture_.getWidth();
255  float img_height = texture_.getHeight();
256 
257  if (img_width != 0 && img_height != 0 && win_width != 0 &&
258  win_height != 0) {
259  float img_aspect = img_width / img_height;
260  float win_aspect = win_width / win_height;
261 
262  if (img_aspect > win_aspect) {
263  screen_rect_->setCorners(-1.0f, 1.0f * win_aspect / img_aspect, 1.0f,
264  -1.0f * win_aspect / img_aspect, false);
265  } else {
266  screen_rect_->setCorners(-1.0f * img_aspect / win_aspect, 1.0f,
267  1.0f * img_aspect / win_aspect, -1.0f, false);
268  }
269  }
270 
271  render_panel_->getRenderWindow()->update();
272  } catch (UnsupportedImageEncoding& e) {
273  setStatus(StatusProperty::Error, "Image", e.what());
274  }
275 }
276 
279  texture_.clear();
280  render_panel_->getCamera()->setPosition(
281  Ogre::Vector3(999999, 999999, 999999));
282 }
283 
284 void HumansDisplay::drawSkeleton(std::string id, int width, int height, std::vector<hri_msgs::NormalizedPointOfInterest2D>& skeleton){
285  /* Body chains:
286  1 - 2 - 8 - 11 - 5 ==> Upper body chain
287  2 - 3 - 4 ==> Right arm chain
288  5 - 6 - 7 ==> Left arm chain
289  8 - 9 - 10 ==> Right leg chain
290  11 - 12 - 13 ==> Left leg chain
291  */
292 
293  if (skeleton.size() == SKELETON_POINTS) {
294 
295  cv::Scalar skeletonColor = get_color_from_id(id);
296 
297  int neckX = clip((int)(skeleton[hri_msgs::Skeleton2D::NECK].x*width), 0, width);
298  int neckY = clip((int)(skeleton[hri_msgs::Skeleton2D::NECK].y*height), 0, height);
299 
300  cv::circle(cvBridge_->image, cv::Point(neckX, neckY), JOINT_RADIUS, skeletonColor, cv::FILLED);
301 
302  int rightShoulderX = clip((int)(skeleton[hri_msgs::Skeleton2D::RIGHT_SHOULDER].x*width), 0, width);
303  int rightShoulderY = clip((int)(skeleton[hri_msgs::Skeleton2D::RIGHT_SHOULDER].y*height), 0, height);
304 
305  cv::circle(cvBridge_->image, cv::Point(rightShoulderX, rightShoulderY), JOINT_RADIUS, skeletonColor, cv::FILLED);
306 
307  int rightHipX = clip((int)(skeleton[hri_msgs::Skeleton2D::RIGHT_HIP].x*width), 0, width);
308  int rightHipY = clip((int)(skeleton[hri_msgs::Skeleton2D::RIGHT_HIP].y*height), 0, height);
309 
310  cv::circle(cvBridge_->image, cv::Point(rightHipX, rightHipY), JOINT_RADIUS, skeletonColor, cv::FILLED);
311 
312  int leftHipX = clip((int)(skeleton[hri_msgs::Skeleton2D::LEFT_HIP].x*width), 0, width);
313  int leftHipY = clip((int)(skeleton[hri_msgs::Skeleton2D::LEFT_HIP].y*height), 0, height);
314 
315  cv::circle(cvBridge_->image, cv::Point(leftHipX, leftHipY), JOINT_RADIUS, skeletonColor, cv::FILLED);
316 
317  int leftShoulderX = clip((int)(skeleton[hri_msgs::Skeleton2D::LEFT_SHOULDER].x*width), 0, width);
318  int leftShoulderY = clip((int)(skeleton[hri_msgs::Skeleton2D::LEFT_SHOULDER].y*height), 0, height);
319 
320  cv::circle(cvBridge_->image, cv::Point(leftShoulderX, leftShoulderY), JOINT_RADIUS, skeletonColor, cv::FILLED);
321 
322  int rightElbowX = clip((int)(skeleton[hri_msgs::Skeleton2D::RIGHT_ELBOW].x*width), 0, width);
323  int rightElbowY = clip((int)(skeleton[hri_msgs::Skeleton2D::RIGHT_ELBOW].y*height), 0, height);
324 
325  cv::circle(cvBridge_->image, cv::Point(rightElbowX, rightElbowY), JOINT_RADIUS, skeletonColor, cv::FILLED);
326 
327  int rightWristX = clip((int)(skeleton[hri_msgs::Skeleton2D::RIGHT_WRIST].x*width), 0, width);
328  int rightWristY = clip((int)(skeleton[hri_msgs::Skeleton2D::RIGHT_WRIST].y*height), 0, height);
329 
330  cv::circle(cvBridge_->image, cv::Point(rightWristX, rightWristY), JOINT_RADIUS, skeletonColor, cv::FILLED);
331 
332  int leftElbowX = clip((int)(skeleton[hri_msgs::Skeleton2D::LEFT_ELBOW].x*width), 0, width);
333  int leftElbowY = clip((int)(skeleton[hri_msgs::Skeleton2D::LEFT_ELBOW].y*height), 0, height);
334 
335  cv::circle(cvBridge_->image, cv::Point(leftElbowX, leftElbowY), JOINT_RADIUS, skeletonColor, cv::FILLED);
336 
337  int leftWristX = clip((int)(skeleton[hri_msgs::Skeleton2D::LEFT_WRIST].x*width), 0, width);
338  int leftWristY = clip((int)(skeleton[hri_msgs::Skeleton2D::LEFT_WRIST].y*height), 0, height);
339 
340  cv::circle(cvBridge_->image, cv::Point(leftWristX, leftWristY), JOINT_RADIUS, skeletonColor, cv::FILLED);
341 
342  int rightKneeX = clip((int)(skeleton[hri_msgs::Skeleton2D::RIGHT_KNEE].x*width), 0, width);
343  int rightKneeY = clip((int)(skeleton[hri_msgs::Skeleton2D::RIGHT_KNEE].y*height), 0, height);
344 
345  cv::circle(cvBridge_->image, cv::Point(rightKneeX, rightKneeY), JOINT_RADIUS, skeletonColor, cv::FILLED);
346 
347  int rightAnkleX = clip((int)(skeleton[hri_msgs::Skeleton2D::RIGHT_ANKLE].x*width), 0, width);
348  int rightAnkleY = clip((int)(skeleton[hri_msgs::Skeleton2D::RIGHT_ANKLE].y*height), 0, height);
349 
350  cv::circle(cvBridge_->image, cv::Point(rightAnkleX, rightAnkleY), JOINT_RADIUS, skeletonColor, cv::FILLED);
351 
352  int leftKneeX = clip((int)(skeleton[hri_msgs::Skeleton2D::LEFT_KNEE].x*width), 0, width);
353  int leftKneeY = clip((int)(skeleton[hri_msgs::Skeleton2D::LEFT_KNEE].y*height), 0, height);
354 
355  cv::circle(cvBridge_->image, cv::Point(leftKneeX, leftKneeY), JOINT_RADIUS, skeletonColor, cv::FILLED);
356 
357  int leftAnkleX = clip((int)(skeleton[hri_msgs::Skeleton2D::LEFT_ANKLE].x*width), 0, width);
358  int leftAnkleY = clip((int)(skeleton[hri_msgs::Skeleton2D::LEFT_ANKLE].y*height), 0, height);
359 
360  cv::circle(cvBridge_->image, cv::Point(leftAnkleX, leftAnkleY), JOINT_RADIUS, skeletonColor, cv::FILLED);
361 
362  // Upper body
363  cv::line(cvBridge_->image, cv::Point(neckX, neckY), cv::Point(rightShoulderX, rightShoulderY), skeletonColor, 5, cv::FILLED);
364  cv::line(cvBridge_->image, cv::Point(rightHipX, rightHipY), cv::Point(rightShoulderX, rightShoulderY), skeletonColor, 5, cv::FILLED);
365  cv::line(cvBridge_->image, cv::Point(neckX, neckY), cv::Point(leftShoulderX, leftShoulderY), skeletonColor, 5, cv::FILLED);
366  cv::line(cvBridge_->image, cv::Point(leftHipX, leftHipY), cv::Point(leftShoulderX, leftShoulderY), skeletonColor, 5, cv::FILLED);
367  cv::line(cvBridge_->image, cv::Point(leftHipX, leftHipY), cv::Point(rightHipX, rightHipY), skeletonColor, 5, cv::FILLED);
368 
369  // Right arm
370  cv::line(cvBridge_->image, cv::Point(rightShoulderX, rightShoulderY), cv::Point(rightElbowX, rightElbowY), skeletonColor, 5, cv::FILLED);
371  cv::line(cvBridge_->image, cv::Point(rightElbowX, rightElbowY), cv::Point(rightWristX, rightWristY), skeletonColor, 5, cv::FILLED);
372 
373  // Left arm
374  cv::line(cvBridge_->image, cv::Point(leftShoulderX, leftShoulderY), cv::Point(leftElbowX, leftElbowY), skeletonColor, 5, cv::FILLED);
375  cv::line(cvBridge_->image, cv::Point(leftElbowX, leftElbowY), cv::Point(leftWristX, leftWristY), skeletonColor, 5, cv::FILLED);
376 
377  // Right Leg
378  cv::line(cvBridge_->image, cv::Point(rightHipX, rightHipY), cv::Point(rightKneeX, rightKneeY), skeletonColor, 5, cv::FILLED);
379  cv::line(cvBridge_->image, cv::Point(rightKneeX, rightKneeY), cv::Point(rightAnkleX, rightAnkleY), skeletonColor, 5, cv::FILLED);
380 
381  // Left leg
382  cv::line(cvBridge_->image, cv::Point(leftHipX, leftHipY), cv::Point(leftKneeX, leftKneeY), skeletonColor, 5, cv::FILLED);
383  cv::line(cvBridge_->image, cv::Point(leftKneeX, leftKneeY), cv::Point(leftAnkleX, leftAnkleY), skeletonColor, 5, cv::FILLED);
384 
385  }
386 }
387 
388 void HumansDisplay::processMessage(const sensor_msgs::Image::ConstPtr& msg) {
389  bool got_float_image =
390  msg->encoding == sensor_msgs::image_encodings::TYPE_32FC1 ||
391  msg->encoding == sensor_msgs::image_encodings::TYPE_16UC1 ||
392  msg->encoding == sensor_msgs::image_encodings::TYPE_16SC1 ||
393  msg->encoding == sensor_msgs::image_encodings::MONO16;
394 
395  if (got_float_image != got_float_image_) {
396  got_float_image_ = got_float_image;
398  }
399 
401  texture_.addMessage(msg);
402  return;
403  }
404 
406 
408  auto faces = hri_listener.getFaces();
409  for (auto const& face : faces) {
410  if (auto face_ptr =
411  face.second.lock()) { // ensure the face is still here
412  if(show_faces_){
413  auto roi = face_ptr->roi();
414  cv::Point roi_tl(static_cast<int>(roi.xmin * msg->width),
415  static_cast<int>(roi.ymin * msg->height));
416  cv::Point roi_br(static_cast<int>(roi.xmax * msg->width),
417  static_cast<int>(roi.ymax * msg->height));
418  cv::rectangle(cvBridge_->image, roi_tl, roi_br, get_color_from_id(face.first), 5);
419  }
421  auto landmarks = *(face_ptr->facialLandmarks()); // boost::optional
422  for(auto landmark : landmarks){
423  if(landmark.x > 0 || landmark.y > 0)
424  cv::circle(cvBridge_->image,
425  cv::Point(static_cast<int>(landmark.x*msg->width), static_cast<int>(landmark.y*msg->height)),
426  5,
427  get_color_from_id(face.first), cv::FILLED);
428  }
429  }
430  }
431  }
432  }
433 
434  if (show_bodies_ || show_skeletons_) {
435  auto bodies = hri_listener.getBodies();
436  for (auto const& body : bodies) {
437  if (auto body_ptr =
438  body.second.lock()) { // ensure the body is still here
439  if (show_bodies_){
440  auto roi = body_ptr->roi();
441  cv::Point roi_tl(static_cast<int>(roi.xmin * msg->width),
442  static_cast<int>(roi.ymin * msg->height));
443  cv::Point roi_br(static_cast<int>(roi.xmax * msg->width),
444  static_cast<int>(roi.ymax * msg->height));
445  cv::rectangle(cvBridge_->image, roi_tl, roi_br, get_color_from_id(body.first), 5);
446  }
447  if (show_skeletons_){
448  auto skeleton = body_ptr->skeleton();
449  drawSkeleton(body.first, msg->width, msg->height, skeleton);
450  }
451  }
452  }
453  }
454 
455  texture_.addMessage(cvBridge_->toImageMsg());
456 }
457 
458 } // namespace rviz
459 
rviz::BoolProperty::getBool
virtual bool getBool() const
rviz::HumansDisplay::processMessage
void processMessage(const sensor_msgs::Image::ConstPtr &msg) override
Definition: hri_humans.cpp:388
rviz::HumansDisplay::show_faces_property_
BoolProperty * show_faces_property_
Definition: hri_humans.hpp:105
rviz::HumansDisplay::render_panel_
RenderPanel * render_panel_
Definition: hri_humans.hpp:95
rviz::ImageDisplayBase::onInitialize
void onInitialize() override
rviz::HumansDisplay::onInitialize
void onInitialize() override
Definition: hri_humans.cpp:128
rviz::Property::setHidden
virtual void setHidden(bool hidden)
image_encodings.h
JOINT_RADIUS
#define JOINT_RADIUS
Definition: hri_humans.cpp:66
rviz::HumansDisplay
Definition: hri_humans.hpp:62
rviz::HumansDisplay::update
void update(float wall_dt, float ros_dt) override
Definition: hri_humans.cpp:244
rviz::Display::initialized
bool initialized() const
rviz::HumansDisplay::show_bodies_
bool show_bodies_
Definition: hri_humans.hpp:113
rviz::StatusProperty::Error
Error
rviz::ImageDisplayBase::unsubscribe
virtual void unsubscribe()
rviz::QtOgreRenderWindow::getCamera
Ogre::Camera * getCamera() const
rviz::HumansDisplay::texture_
ROSImageTexture texture_
Definition: hri_humans.hpp:93
rviz::HumansDisplay::drawSkeleton
void drawSkeleton(std::string id, int width, int height, std::vector< hri_msgs::NormalizedPointOfInterest2D > &skeleton)
Definition: hri_humans.cpp:284
rviz::HumansDisplay::normalize_property_
BoolProperty * normalize_property_
Definition: hri_humans.hpp:104
frame_manager.h
validate_floats.h
rviz::BoolProperty::BoolProperty
BoolProperty(const QString &name, bool default_value, const QString &description, P *parent, Func &&changed_slot)
rviz::ROSImageTexture::clear
void clear()
compatibility.h
body
body
rviz::HumansDisplay::got_float_image_
bool got_float_image_
Definition: hri_humans.hpp:112
rviz::ROSImageTexture::setNormalizeFloatImage
void setNormalizeFloatImage(bool normalize, double min=0.0, double max=1.0)
rviz::ROSImageTexture::getWidth
uint32_t getWidth()
hri::HRIListener::getBodies
std::map< ID, BodyWeakConstPtr > getBodies() const
rviz::HumansDisplay::updateNormalizeOptions
virtual void updateNormalizeOptions()
Definition: hri_humans.cpp:224
rviz::HumansDisplay::median_buffer_size_property_
IntProperty * median_buffer_size_property_
Definition: hri_humans.hpp:111
rviz::HumansDisplay::updateShowFacialLandmarks
void updateShowFacialLandmarks()
Definition: hri_humans.cpp:212
rviz::ROSImageTexture::getHeight
uint32_t getHeight()
f
f
clip
int clip(int n, int lower, int upper)
Definition: hri_humans.cpp:80
sensor_msgs::image_encodings::TYPE_16UC1
const std::string TYPE_16UC1
rviz::Display
rviz::FloatProperty
SKELETON_POINTS
#define SKELETON_POINTS
Definition: hri_humans.cpp:64
rviz::ROSImageTexture::setMedianFrames
void setMedianFrames(unsigned median_frames)
rviz::HumansDisplay::show_bodies_property_
BoolProperty * show_bodies_property_
Definition: hri_humans.hpp:107
rviz::Display::setStatus
virtual void setStatus(StatusProperty::Level level, const QString &name, const QString &text)
rviz::HumansDisplay::show_skeletons_
bool show_skeletons_
Definition: hri_humans.hpp:113
rviz::HumansDisplay::show_facial_landmarks_property_
BoolProperty * show_facial_landmarks_property_
Definition: hri_humans.hpp:106
rviz::removeAndDestroyChildNode
void removeAndDestroyChildNode(Ogre::SceneNode *parent, Ogre::SceneNode *child)
rviz::RenderPanel::initialize
void initialize(Ogre::SceneManager *scene_manager, DisplayContext *manager)
hri_humans.hpp
PLUGINLIB_EXPORT_CLASS
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
rviz::FloatProperty::getFloat
virtual float getFloat() const
cv_bridge::toCvCopy
CvImagePtr toCvCopy(const sensor_msgs::CompressedImage &source, const std::string &encoding=std::string())
render_panel.h
rviz::HumansDisplay::cvBridge_
cv_bridge::CvImagePtr cvBridge_
Definition: hri_humans.hpp:116
rviz
rviz::RenderWidget::getRenderWindow
Ogre::RenderWindow * getRenderWindow()
rviz::HumansDisplay::onDisable
void onDisable() override
Definition: hri_humans.cpp:202
rviz::ROSImageTexture::addMessage
void addMessage(const sensor_msgs::Image::ConstPtr &image)
rviz::HumansDisplay::show_facial_landmarks_
bool show_facial_landmarks_
Definition: hri_humans.hpp:113
rviz::HumansDisplay::screen_rect_
Ogre::Rectangle2D * screen_rect_
Definition: hri_humans.hpp:101
rviz::HumansDisplay::updateShowSkeletons
void updateShowSkeletons()
Definition: hri_humans.cpp:220
image_transport.h
rviz::ImageDisplayBase
rviz::HumansDisplay::min_property_
FloatProperty * min_property_
Definition: hri_humans.hpp:109
rviz::HumansDisplay::onEnable
void onEnable() override
Definition: hri_humans.cpp:197
hri::HRIListener::getFaces
std::map< ID, FaceWeakConstPtr > getFaces() const
face
face
rviz::Display::context_
DisplayContext * context_
rviz::ROSImageTexture::update
bool update()
sensor_msgs::image_encodings::TYPE_32FC1
const std::string TYPE_32FC1
std
rviz::HumansDisplay::hri_listener
hri::HRIListener hri_listener
Definition: hri_humans.hpp:115
rviz::HumansDisplay::show_faces_
bool show_faces_
Definition: hri_humans.hpp:113
rviz::ImageDisplayBase::reset
void reset() override
cv_bridge.h
sensor_msgs::image_encodings::MONO16
const std::string MONO16
get_color_from_id
cv::Scalar get_color_from_id(std::string id)
Definition: hri_humans.cpp:70
class_list_macros.hpp
rviz::HumansDisplay::updateShowFaces
void updateShowFaces()
Definition: hri_humans.cpp:208
rviz::IntProperty::getInt
virtual int getInt() const
rviz::setMaterial
void setMaterial(Ogre::SimpleRenderable &renderable, const Ogre::MaterialPtr &material)
rviz::HumansDisplay::max_property_
FloatProperty * max_property_
Definition: hri_humans.hpp:110
sensor_msgs::image_encodings::TYPE_16SC1
const std::string TYPE_16SC1
rviz::QtOgreRenderWindow::setAutoRender
void setAutoRender(bool auto_render)
rviz::Display::setAssociatedWidget
void setAssociatedWidget(QWidget *widget)
rviz::QtOgreRenderWindow::setOverlaysEnabled
void setOverlaysEnabled(bool overlays_enabled)
rviz::UnsupportedImageEncoding
rviz::RenderPanel
rviz::ROSImageTexture::getTexture
const Ogre::TexturePtr & getTexture()
rviz::HumansDisplay::~HumansDisplay
~HumansDisplay() override
Definition: hri_humans.cpp:188
rviz::HumansDisplay::show_skeletons_property_
BoolProperty * show_skeletons_property_
Definition: hri_humans.hpp:108
rviz::HumansDisplay::reset
void reset() override
Definition: hri_humans.cpp:277
rviz::HumansDisplay::material_
Ogre::MaterialPtr material_
Definition: hri_humans.hpp:102
rviz::ImageDisplayBase::subscribe
virtual void subscribe()
rviz::HumansDisplay::img_scene_node_
Ogre::SceneNode * img_scene_node_
Definition: hri_humans.hpp:100
rviz::HumansDisplay::img_scene_manager_
Ogre::SceneManager * img_scene_manager_
Definition: hri_humans.hpp:91
rviz::IntProperty
display_context.h
rviz::HumansDisplay::updateShowBodies
void updateShowBodies()
Definition: hri_humans.cpp:216


hri_rviz
Author(s): Lorenzo Ferrini, Séverin Lemaignan
autogenerated on Fri Oct 20 2023 02:53:21