plotter_2d_display.h
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 #ifndef JSK_RVIZ_PLUGIN_PLOTTER_2D_H_
36 #define JSK_RVIZ_PLUGIN_PLOTTER_2D_H_
37 
38 #include "std_msgs/Float32.h"
39 #ifndef Q_MOC_RUN
40 #include <rviz/display.h>
41 #include "overlay_utils.h"
42 #include <OGRE/OgreColourValue.h>
43 #include <OGRE/OgreTexture.h>
44 #include <OGRE/OgreMaterial.h>
50 #endif
51 
52 namespace jsk_rviz_plugins
53 {
54 
55  class Plotter2DDisplay
56  : public rviz::Display
57  {
58  Q_OBJECT
59  public:
61  virtual ~Plotter2DDisplay();
62  // methods for OverlayPickerTool
63  virtual bool isInRegion(int x, int y);
64  virtual void movePosition(int x, int y);
65  virtual void setPosition(int x, int y);
66  virtual int getX() { return left_; };
67  virtual int getY() { return top_; };
68  protected:
70  // methods
72  virtual void update(float wall_dt, float ros_dt);
73  virtual void subscribe();
74  virtual void unsubscribe();
75  virtual void onEnable();
76  virtual void onDisable();
77  virtual void initializeBuffer();
78  virtual void onInitialize();
79  virtual void processMessage(const std_msgs::Float32::ConstPtr& msg);
80  virtual void drawPlot();
82  // properties
107 
109  QColor fg_color_;
110  QColor max_color_;
111  QColor bg_color_;
112 
113  double fg_alpha_;
114  double bg_alpha_;
115  bool auto_scale_;
116  bool show_border_;
117  bool auto_color_change_;
118  bool show_value_;
119  bool show_caption_;
120  bool draw_required_;
121  float last_time_;
122  float update_interval_;
124  int text_size_in_plot_;
125 
126  int buffer_length_;
127  std::vector<double> buffer_;
128  uint16_t texture_width_;
129  uint16_t texture_height_;
130  int left_;
131  int top_;
132  int line_width_;
133  int text_size_;
134  int caption_offset_;
135  double min_value_;
136  double max_value_;
137 
139  // ROS variables
141  boost::mutex mutex_;
143 
144  protected Q_SLOTS:
145  void updateTopic();
146  void updateShowValue();
147  void updateBufferSize();
152  void updateWidth();
153  void updateHeight();
154  void updateTop();
155  void updateLeft();
168 
169  private:
170  };
171 }
172 
173 #endif
jsk_rviz_plugins::Plotter2DDisplay::texture_width_
uint16_t texture_width_
Definition: plotter_2d_display.h:192
jsk_rviz_plugins::Plotter2DDisplay::max_value_
double max_value_
Definition: plotter_2d_display.h:200
jsk_rviz_plugins::Plotter2DDisplay::min_value_
double min_value_
Definition: plotter_2d_display.h:199
jsk_rviz_plugins::Plotter2DDisplay::update
virtual void update(float wall_dt, float ros_dt)
Definition: plotter_2d_display.cpp:396
rviz::RosTopicProperty
jsk_rviz_plugins::Plotter2DDisplay::updateShowCaption
void updateShowCaption()
Definition: plotter_2d_display.cpp:541
jsk_rviz_plugins::Plotter2DDisplay::auto_color_change_
bool auto_color_change_
Definition: plotter_2d_display.h:181
jsk_rviz_plugins::Plotter2DDisplay::updateMinValue
void updateMinValue()
Definition: plotter_2d_display.cpp:552
jsk_rviz_plugins::Plotter2DDisplay::Plotter2DDisplay
Plotter2DDisplay()
Definition: plotter_2d_display.cpp:76
jsk_rviz_plugins::Plotter2DDisplay::buffer_
std::vector< double > buffer_
Definition: plotter_2d_display.h:191
jsk_rviz_plugins::Plotter2DDisplay::onEnable
virtual void onEnable()
Definition: plotter_2d_display.cpp:429
jsk_rviz_plugins::Plotter2DDisplay::getX
virtual int getX()
Definition: plotter_2d_display.h:130
boost::shared_ptr< OverlayObject >
jsk_rviz_plugins::Plotter2DDisplay::text_size_in_plot_
int text_size_in_plot_
Definition: plotter_2d_display.h:188
jsk_rviz_plugins::Plotter2DDisplay::fg_alpha_property_
rviz::FloatProperty * fg_alpha_property_
Definition: plotter_2d_display.h:152
jsk_rviz_plugins::Plotter2DDisplay::caption_offset_
int caption_offset_
Definition: plotter_2d_display.h:198
jsk_rviz_plugins::Plotter2DDisplay::text_size_in_plot_property_
rviz::IntProperty * text_size_in_plot_property_
Definition: plotter_2d_display.h:170
jsk_rviz_plugins::Plotter2DDisplay::update_interval_
float update_interval_
Definition: plotter_2d_display.h:186
rviz::BoolProperty
jsk_rviz_plugins::Plotter2DDisplay::updateAutoColorChange
void updateAutoColorChange()
Definition: plotter_2d_display.cpp:512
int_property.h
jsk_rviz_plugins::Plotter2DDisplay::text_size_property_
rviz::IntProperty * text_size_property_
Definition: plotter_2d_display.h:165
jsk_rviz_plugins::Plotter2DDisplay::updateFGColor
void updateFGColor()
Definition: plotter_2d_display.cpp:470
jsk_rviz_plugins::Plotter2DDisplay::subscribe
virtual void subscribe()
Definition: plotter_2d_display.cpp:414
jsk_rviz_plugins::Plotter2DDisplay::updateBGAlpha
void updateBGAlpha()
Definition: plotter_2d_display.cpp:480
jsk_rviz_plugins::Plotter2DDisplay::fg_color_
QColor fg_color_
Definition: plotter_2d_display.h:173
display.h
jsk_rviz_plugins::Plotter2DDisplay::unsubscribe
virtual void unsubscribe()
Definition: plotter_2d_display.cpp:424
jsk_rviz_plugins::Plotter2DDisplay::updateMaxValue
void updateMaxValue()
Definition: plotter_2d_display.cpp:559
jsk_rviz_plugins::Plotter2DDisplay::line_width_
int line_width_
Definition: plotter_2d_display.h:196
jsk_rviz_plugins::Plotter2DDisplay::auto_color_change_property_
rviz::BoolProperty * auto_color_change_property_
Definition: plotter_2d_display.h:162
jsk_rviz_plugins::Plotter2DDisplay::fg_alpha_
double fg_alpha_
Definition: plotter_2d_display.h:177
jsk_rviz_plugins::Plotter2DDisplay::onInitialize
virtual void onInitialize()
Definition: plotter_2d_display.cpp:222
float_property.h
jsk_rviz_plugins::Plotter2DDisplay::sub_
ros::Subscriber sub_
Definition: plotter_2d_display.h:206
rviz::ColorProperty
jsk_rviz_plugins::Plotter2DDisplay::left_
int left_
Definition: plotter_2d_display.h:194
jsk_rviz_plugins::Plotter2DDisplay::top_
int top_
Definition: plotter_2d_display.h:195
rviz::Display
rviz::FloatProperty
jsk_rviz_plugins::Plotter2DDisplay::~Plotter2DDisplay
virtual ~Plotter2DDisplay()
Definition: plotter_2d_display.cpp:185
jsk_rviz_plugins::Plotter2DDisplay::updateFGAlpha
void updateFGAlpha()
Definition: plotter_2d_display.cpp:475
jsk_rviz_plugins::Plotter2DDisplay::updateLeft
void updateLeft()
Definition: plotter_2d_display.cpp:460
jsk_rviz_plugins::Plotter2DDisplay::updateAutoScale
void updateAutoScale()
Definition: plotter_2d_display.cpp:566
jsk_rviz_plugins::Plotter2DDisplay::movePosition
virtual void movePosition(int x, int y)
Definition: plotter_2d_display.cpp:602
overlay_utils.h
bool_property.h
jsk_rviz_plugins::Plotter2DDisplay::auto_scale_property_
rviz::BoolProperty * auto_scale_property_
Definition: plotter_2d_display.h:166
jsk_rviz_plugins::Plotter2DDisplay::last_time_
float last_time_
Definition: plotter_2d_display.h:185
jsk_rviz_plugins::Plotter2DDisplay::updateBGColor
void updateBGColor()
Definition: plotter_2d_display.cpp:465
jsk_rviz_plugins::Plotter2DDisplay::auto_scale_
bool auto_scale_
Definition: plotter_2d_display.h:179
jsk_rviz_plugins::Plotter2DDisplay::onDisable
virtual void onDisable()
Definition: plotter_2d_display.cpp:437
jsk_rviz_plugins::Plotter2DDisplay::updateAutoTextSizeInPlot
void updateAutoTextSizeInPlot()
Definition: plotter_2d_display.cpp:581
bounding_box_sample.x
x
Definition: bounding_box_sample.py:30
jsk_rviz_plugins::Plotter2DDisplay::updateTopic
void updateTopic()
Definition: plotter_2d_display.cpp:485
jsk_rviz_plugins::Plotter2DDisplay::updateBufferSize
void updateBufferSize()
Definition: plotter_2d_display.cpp:506
jsk_rviz_plugins::Plotter2DDisplay::updateTop
void updateTop()
Definition: plotter_2d_display.cpp:455
jsk_rviz_plugins::Plotter2DDisplay::updateShowValue
void updateShowValue()
Definition: plotter_2d_display.cpp:491
jsk_rviz_plugins::Plotter2DDisplay::left_property_
rviz::IntProperty * left_property_
Definition: plotter_2d_display.h:159
jsk_rviz_plugins::Plotter2DDisplay::buffer_length_property_
rviz::IntProperty * buffer_length_property_
Definition: plotter_2d_display.h:156
jsk_rviz_plugins::Plotter2DDisplay::show_value_
bool show_value_
Definition: plotter_2d_display.h:182
jsk_rviz_plugins::Plotter2DDisplay::text_size_
int text_size_
Definition: plotter_2d_display.h:197
jsk_rviz_plugins::Plotter2DDisplay::updateShowBorder
void updateShowBorder()
Definition: plotter_2d_display.cpp:496
jsk_rviz_plugins::Plotter2DDisplay::draw_required_
bool draw_required_
Definition: plotter_2d_display.h:184
jsk_rviz_plugins::Plotter2DDisplay::updateHeight
void updateHeight()
Definition: plotter_2d_display.cpp:449
jsk_rviz_plugins::Plotter2DDisplay::texture_height_
uint16_t texture_height_
Definition: plotter_2d_display.h:193
bounding_box_sample.y
y
Definition: bounding_box_sample.py:31
jsk_rviz_plugins::Plotter2DDisplay::setPosition
virtual void setPosition(int x, int y)
Definition: plotter_2d_display.cpp:608
jsk_rviz_plugins::Plotter2DDisplay::show_caption_
bool show_caption_
Definition: plotter_2d_display.h:183
jsk_rviz_plugins::Plotter2DDisplay::min_value_property_
rviz::FloatProperty * min_value_property_
Definition: plotter_2d_display.h:168
jsk_rviz_plugins::Plotter2DDisplay::buffer_length_
int buffer_length_
Definition: plotter_2d_display.h:190
jsk_rviz_plugins::Plotter2DDisplay::line_width_property_
rviz::IntProperty * line_width_property_
Definition: plotter_2d_display.h:161
jsk_rviz_plugins::Plotter2DDisplay::bg_color_property_
rviz::ColorProperty * bg_color_property_
Definition: plotter_2d_display.h:151
jsk_rviz_plugins::Plotter2DDisplay::updateWidth
void updateWidth()
Definition: plotter_2d_display.cpp:443
jsk_rviz_plugins::Plotter2DDisplay::show_caption_property_
rviz::BoolProperty * show_caption_property_
Definition: plotter_2d_display.h:164
jsk_rviz_plugins::Plotter2DDisplay::drawPlot
virtual void drawPlot()
Definition: plotter_2d_display.cpp:255
jsk_rviz_plugins::Plotter2DDisplay::updateTextSizeInPlot
void updateTextSizeInPlot()
Definition: plotter_2d_display.cpp:592
jsk_rviz_plugins::Plotter2DDisplay::update_interval_property_
rviz::FloatProperty * update_interval_property_
Definition: plotter_2d_display.h:154
jsk_rviz_plugins::Plotter2DDisplay::fg_color_property_
rviz::ColorProperty * fg_color_property_
Definition: plotter_2d_display.h:150
jsk_rviz_plugins::Plotter2DDisplay::width_property_
rviz::IntProperty * width_property_
Definition: plotter_2d_display.h:157
jsk_rviz_plugins::Plotter2DDisplay::height_property_
rviz::IntProperty * height_property_
Definition: plotter_2d_display.h:158
jsk_rviz_plugins::Plotter2DDisplay::updateTextSize
void updateTextSize()
Definition: plotter_2d_display.cpp:533
jsk_rviz_plugins::Plotter2DDisplay::max_value_property_
rviz::FloatProperty * max_value_property_
Definition: plotter_2d_display.h:167
jsk_rviz_plugins::Plotter2DDisplay::update_topic_property_
rviz::RosTopicProperty * update_topic_property_
Definition: plotter_2d_display.h:148
jsk_rviz_plugins::Plotter2DDisplay::max_color_
QColor max_color_
Definition: plotter_2d_display.h:174
jsk_rviz_plugins::Plotter2DDisplay::updateMaxColor
void updateMaxColor()
Definition: plotter_2d_display.cpp:523
jsk_rviz_plugins::Plotter2DDisplay::show_value_property_
rviz::BoolProperty * show_value_property_
Definition: plotter_2d_display.h:149
jsk_rviz_plugins::Plotter2DDisplay::updateLineWidth
void updateLineWidth()
Definition: plotter_2d_display.cpp:501
jsk_rviz_plugins::Plotter2DDisplay::updateUpdateInterval
void updateUpdateInterval()
Definition: plotter_2d_display.cpp:528
jsk_rviz_plugins::Plotter2DDisplay::processMessage
virtual void processMessage(const std_msgs::Float32::ConstPtr &msg)
Definition: plotter_2d_display.cpp:355
jsk_rviz_plugins::Plotter2DDisplay::show_border_
bool show_border_
Definition: plotter_2d_display.h:180
jsk_rviz_plugins::Plotter2DDisplay::show_border_property_
rviz::BoolProperty * show_border_property_
Definition: plotter_2d_display.h:155
jsk_rviz_plugins::Plotter2DDisplay::getY
virtual int getY()
Definition: plotter_2d_display.h:131
jsk_rviz_plugins::Plotter2DDisplay::overlay_
OverlayObject::Ptr overlay_
Definition: plotter_2d_display.h:172
jsk_rviz_plugins::Plotter2DDisplay::bg_alpha_
double bg_alpha_
Definition: plotter_2d_display.h:178
jsk_rviz_plugins::Plotter2DDisplay::top_property_
rviz::IntProperty * top_property_
Definition: plotter_2d_display.h:160
jsk_rviz_plugins::Plotter2DDisplay::auto_text_size_in_plot_
bool auto_text_size_in_plot_
Definition: plotter_2d_display.h:187
jsk_rviz_plugins::Plotter2DDisplay::mutex_
boost::mutex mutex_
Definition: plotter_2d_display.h:205
jsk_rviz_plugins::Plotter2DDisplay::bg_alpha_property_
rviz::FloatProperty * bg_alpha_property_
Definition: plotter_2d_display.h:153
jsk_rviz_plugins::Plotter2DDisplay::bg_color_
QColor bg_color_
Definition: plotter_2d_display.h:175
jsk_rviz_plugins
Definition: __init__.py:1
jsk_rviz_plugins::Plotter2DDisplay::auto_text_size_in_plot_property_
rviz::BoolProperty * auto_text_size_in_plot_property_
Definition: plotter_2d_display.h:169
color_property.h
jsk_rviz_plugins::Plotter2DDisplay::isInRegion
virtual bool isInRegion(int x, int y)
Definition: plotter_2d_display.cpp:596
ros_topic_property.h
ros::Subscriber
rviz::IntProperty
jsk_rviz_plugins::Plotter2DDisplay::max_color_property_
rviz::ColorProperty * max_color_property_
Definition: plotter_2d_display.h:163
jsk_rviz_plugins::Plotter2DDisplay::initializeBuffer
virtual void initializeBuffer()
Definition: plotter_2d_display.cpp:210


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