hri_humans.hpp
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 #ifndef RVIZ_HRI_HUMANS_H
31 #define RVIZ_HRI_HUMANS_H
32 
33 #ifndef Q_MOC_RUN // See: https://bugreports.qt-project.org/browse/QTBUG-22829
34 #include <OGRE/OgreMaterial.h>
35 #include <OGRE/OgreRenderTargetListener.h>
36 #include <OGRE/OgreSharedPtr.h>
37 #include <cv_bridge/cv_bridge.h>
38 #include <hri_msgs/IdsList.h>
39 #include <hri_msgs/NormalizedPointOfInterest2D.h>
40 
41 #include <QObject>
42 #include <map>
43 #include <string>
44 #include <vector>
45 
46 #include "hri/hri.h"
47 #include "ros/ros.h"
53 #include "rviz/render_panel.h"
54 #endif
55 
56 namespace Ogre {
57 class SceneNode;
58 class Rectangle2D;
59 } // namespace Ogre
60 
61 namespace rviz {
63  Q_OBJECT
64  public:
65  HumansDisplay();
66  ~HumansDisplay() override;
67 
68  // Overrides from Display
69  void onInitialize() override;
70  void update(float wall_dt, float ros_dt) override;
71  void reset() override;
72 
73  public Q_SLOTS:
74  virtual void updateNormalizeOptions();
75  void updateShowFaces();
76  void updateShowBodies();
78  void updateShowSkeletons();
79 
80  protected:
81  // overrides from Display
82  void onEnable() override;
83  void onDisable() override;
84 
85  // skeleton drawing function
86  void drawSkeleton(std::string id, int width, int height, std::vector<hri_msgs::NormalizedPointOfInterest2D>& skeleton);
87 
88  /* This is called by incomingMessage(). */
89  void processMessage(const sensor_msgs::Image::ConstPtr& msg) override;
90 
91  Ogre::SceneManager* img_scene_manager_;
92 
94 
96 
97  // ros::NodeHandle nh_;
98 
99  private:
100  Ogre::SceneNode* img_scene_node_;
101  Ogre::Rectangle2D* screen_rect_;
102  Ogre::MaterialPtr material_;
103 
114 
117 };
118 
119 } // namespace rviz
120 
121 #endif
rviz::HumansDisplay::processMessage
void processMessage(const sensor_msgs::Image::ConstPtr &msg) override
Definition: hri_humans.cpp:388
rviz::HumansDisplay::HumansDisplay
HumansDisplay()
Definition: hri_humans.cpp:85
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::HumansDisplay::onInitialize
void onInitialize() override
Definition: hri_humans.cpp:128
Ogre
rviz::HumansDisplay
Definition: hri_humans.hpp:62
boost::shared_ptr< CvImage >
rviz::HumansDisplay::update
void update(float wall_dt, float ros_dt) override
Definition: hri_humans.cpp:244
rviz::HumansDisplay::show_bodies_
bool show_bodies_
Definition: hri_humans.hpp:113
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::ROSImageTexture
ros.h
rviz::BoolProperty
rviz::HumansDisplay::normalize_property_
BoolProperty * normalize_property_
Definition: hri_humans.hpp:104
int_property.h
rviz::HumansDisplay::got_float_image_
bool got_float_image_
Definition: hri_humans.hpp:112
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
float_property.h
rviz::FloatProperty
rviz::HumansDisplay::show_bodies_property_
BoolProperty * show_bodies_property_
Definition: hri_humans.hpp:107
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
bool_property.h
render_panel.h
rviz::HumansDisplay::cvBridge_
cv_bridge::CvImagePtr cvBridge_
Definition: hri_humans.hpp:116
rviz
rviz::HumansDisplay::onDisable
void onDisable() override
Definition: hri_humans.cpp:202
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
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
image_display_base.h
hri::HRIListener
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
cv_bridge.h
rviz::HumansDisplay::updateShowFaces
void updateShowFaces()
Definition: hri_humans.cpp:208
rviz::HumansDisplay::max_property_
FloatProperty * max_property_
Definition: hri_humans.hpp:110
rviz::RenderPanel
rviz::HumansDisplay::~HumansDisplay
~HumansDisplay() override
Definition: hri_humans.cpp:188
rviz::HumansDisplay::show_skeletons_property_
BoolProperty * show_skeletons_property_
Definition: hri_humans.hpp:108
ros_image_texture.h
rviz::HumansDisplay::reset
void reset() override
Definition: hri_humans.cpp:277
rviz::HumansDisplay::material_
Ogre::MaterialPtr material_
Definition: hri_humans.hpp:102
rviz::HumansDisplay::img_scene_node_
Ogre::SceneNode * img_scene_node_
Definition: hri_humans.hpp:100
hri.h
rviz::HumansDisplay::img_scene_manager_
Ogre::SceneManager * img_scene_manager_
Definition: hri_humans.hpp:91
rviz::IntProperty
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