linear_gauge_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_LINEAR_GAUGE_H_
36 #define JSK_RVIZ_PLUGIN_LINEAR_GAUGE_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 LinearGaugeDisplay
56  : public rviz::Display
57  {
58  Q_OBJECT
59  public:
61  virtual ~LinearGaugeDisplay();
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 onInitialize();
78  virtual void processMessage(const std_msgs::Float32::ConstPtr& msg);
79  virtual void drawPlot();
81  // properties
104 
106  QColor fg_color_;
107  QColor max_color_;
108  QColor bg_color_;
109 
110  double fg_alpha_;
111  double bg_alpha_;
112  bool show_border_;
113  bool auto_color_change_;
114  bool show_value_;
115  bool show_caption_;
116  bool vertical_gauge_;
117  bool draw_required_;
118  float last_time_;
119  float update_interval_;
120 
121  uint16_t texture_width_;
122  uint16_t texture_height_;
123  int left_;
124  int top_;
125  int line_width_;
126  int text_size_;
127  int caption_offset_;
128  double min_value_;
129  double max_value_;
130  const int width_padding_;
131  const int height_padding_;
132 
133  float data_;
134  bool first_time_;
135 
136 
138  // ROS variables
140  boost::mutex mutex_;
142 
143  protected Q_SLOTS:
144  void updateTopic();
145  void updateShowValue();
146  void updateVerticalGauge();
151  void updateWidth();
152  void updateHeight();
153  void updateTop();
154  void updateLeft();
164  private:
165  };
166 }
167 
168 #endif
jsk_rviz_plugins::LinearGaugeDisplay::updateFGColor
void updateFGColor()
Definition: linear_gauge_display.cpp:430
jsk_rviz_plugins::LinearGaugeDisplay::mutex_
boost::mutex mutex_
Definition: linear_gauge_display.h:204
jsk_rviz_plugins::LinearGaugeDisplay::last_time_
float last_time_
Definition: linear_gauge_display.h:182
jsk_rviz_plugins::LinearGaugeDisplay::updateShowValue
void updateShowValue()
Definition: linear_gauge_display.cpp:454
jsk_rviz_plugins::LinearGaugeDisplay::width_padding_
const int width_padding_
Definition: linear_gauge_display.h:194
rviz::RosTopicProperty
jsk_rviz_plugins::LinearGaugeDisplay::~LinearGaugeDisplay
virtual ~LinearGaugeDisplay()
Definition: linear_gauge_display.cpp:178
jsk_rviz_plugins::LinearGaugeDisplay::width_property_
rviz::IntProperty * width_property_
Definition: linear_gauge_display.h:157
jsk_rviz_plugins::LinearGaugeDisplay::show_border_property_
rviz::BoolProperty * show_border_property_
Definition: linear_gauge_display.h:155
boost::shared_ptr< OverlayObject >
jsk_rviz_plugins::LinearGaugeDisplay::updateUpdateInterval
void updateUpdateInterval()
Definition: linear_gauge_display.cpp:496
jsk_rviz_plugins::LinearGaugeDisplay::updateFGAlpha
void updateFGAlpha()
Definition: linear_gauge_display.cpp:436
jsk_rviz_plugins::LinearGaugeDisplay::max_value_property_
rviz::FloatProperty * max_value_property_
Definition: linear_gauge_display.h:166
jsk_rviz_plugins::LinearGaugeDisplay::line_width_property_
rviz::IntProperty * line_width_property_
Definition: linear_gauge_display.h:161
jsk_rviz_plugins::LinearGaugeDisplay::updateLineWidth
void updateLineWidth()
Definition: linear_gauge_display.cpp:472
jsk_rviz_plugins::LinearGaugeDisplay::text_size_
int text_size_
Definition: linear_gauge_display.h:190
jsk_rviz_plugins::LinearGaugeDisplay::onInitialize
virtual void onInitialize()
Definition: linear_gauge_display.cpp:203
rviz::BoolProperty
int_property.h
jsk_rviz_plugins::LinearGaugeDisplay::bg_color_property_
rviz::ColorProperty * bg_color_property_
Definition: linear_gauge_display.h:151
jsk_rviz_plugins::LinearGaugeDisplay::processMessage
virtual void processMessage(const std_msgs::Float32::ConstPtr &msg)
Definition: linear_gauge_display.cpp:337
jsk_rviz_plugins::LinearGaugeDisplay::updateMaxValue
void updateMaxValue()
Definition: linear_gauge_display.cpp:527
jsk_rviz_plugins::LinearGaugeDisplay::updateLeft
void updateLeft()
Definition: linear_gauge_display.cpp:418
jsk_rviz_plugins::LinearGaugeDisplay::line_width_
int line_width_
Definition: linear_gauge_display.h:189
jsk_rviz_plugins::LinearGaugeDisplay::show_border_
bool show_border_
Definition: linear_gauge_display.h:176
jsk_rviz_plugins::LinearGaugeDisplay::min_value_property_
rviz::FloatProperty * min_value_property_
Definition: linear_gauge_display.h:167
jsk_rviz_plugins::LinearGaugeDisplay::left_property_
rviz::IntProperty * left_property_
Definition: linear_gauge_display.h:159
display.h
jsk_rviz_plugins::LinearGaugeDisplay::getX
virtual int getX()
Definition: linear_gauge_display.h:130
jsk_rviz_plugins::LinearGaugeDisplay::auto_color_change_property_
rviz::BoolProperty * auto_color_change_property_
Definition: linear_gauge_display.h:162
jsk_rviz_plugins::LinearGaugeDisplay::sub_
ros::Subscriber sub_
Definition: linear_gauge_display.h:205
jsk_rviz_plugins::LinearGaugeDisplay::bg_alpha_
double bg_alpha_
Definition: linear_gauge_display.h:175
float_property.h
rviz::ColorProperty
jsk_rviz_plugins::LinearGaugeDisplay::max_value_
double max_value_
Definition: linear_gauge_display.h:193
jsk_rviz_plugins::LinearGaugeDisplay::fg_color_
QColor fg_color_
Definition: linear_gauge_display.h:170
jsk_rviz_plugins::LinearGaugeDisplay::height_property_
rviz::IntProperty * height_property_
Definition: linear_gauge_display.h:158
jsk_rviz_plugins::LinearGaugeDisplay::updateAutoColorChange
void updateAutoColorChange()
Definition: linear_gauge_display.cpp:478
rviz::Display
jsk_rviz_plugins::LinearGaugeDisplay::max_color_
QColor max_color_
Definition: linear_gauge_display.h:171
jsk_rviz_plugins::LinearGaugeDisplay::top_property_
rviz::IntProperty * top_property_
Definition: linear_gauge_display.h:160
rviz::FloatProperty
jsk_rviz_plugins::LinearGaugeDisplay::updateTextSize
void updateTextSize()
Definition: linear_gauge_display.cpp:501
jsk_rviz_plugins::LinearGaugeDisplay::updateWidth
void updateWidth()
Definition: linear_gauge_display.cpp:398
jsk_rviz_plugins::LinearGaugeDisplay::updateVerticalGauge
void updateVerticalGauge()
Definition: linear_gauge_display.cpp:460
jsk_rviz_plugins::LinearGaugeDisplay::LinearGaugeDisplay
LinearGaugeDisplay()
Definition: linear_gauge_display.cpp:75
jsk_rviz_plugins::LinearGaugeDisplay::update
virtual void update(float wall_dt, float ros_dt)
Definition: linear_gauge_display.cpp:352
overlay_utils.h
bool_property.h
jsk_rviz_plugins::LinearGaugeDisplay::unsubscribe
virtual void unsubscribe()
Definition: linear_gauge_display.cpp:379
jsk_rviz_plugins::LinearGaugeDisplay::min_value_
double min_value_
Definition: linear_gauge_display.h:192
jsk_rviz_plugins::LinearGaugeDisplay::overlay_
OverlayObject::Ptr overlay_
Definition: linear_gauge_display.h:169
jsk_rviz_plugins::LinearGaugeDisplay::updateShowBorder
void updateShowBorder()
Definition: linear_gauge_display.cpp:466
jsk_rviz_plugins::LinearGaugeDisplay::show_caption_
bool show_caption_
Definition: linear_gauge_display.h:179
jsk_rviz_plugins::LinearGaugeDisplay::updateMaxColor
void updateMaxColor()
Definition: linear_gauge_display.cpp:490
jsk_rviz_plugins::LinearGaugeDisplay::updateHeight
void updateHeight()
Definition: linear_gauge_display.cpp:405
bounding_box_sample.x
x
Definition: bounding_box_sample.py:26
jsk_rviz_plugins::LinearGaugeDisplay::fg_alpha_property_
rviz::FloatProperty * fg_alpha_property_
Definition: linear_gauge_display.h:152
jsk_rviz_plugins::LinearGaugeDisplay::show_value_property_
rviz::BoolProperty * show_value_property_
Definition: linear_gauge_display.h:148
jsk_rviz_plugins::LinearGaugeDisplay::top_
int top_
Definition: linear_gauge_display.h:188
jsk_rviz_plugins::LinearGaugeDisplay::buffer_length_property_
rviz::IntProperty * buffer_length_property_
Definition: linear_gauge_display.h:156
jsk_rviz_plugins::LinearGaugeDisplay::text_size_property_
rviz::IntProperty * text_size_property_
Definition: linear_gauge_display.h:165
jsk_rviz_plugins::LinearGaugeDisplay::updateTopic
void updateTopic()
Definition: linear_gauge_display.cpp:448
jsk_rviz_plugins::LinearGaugeDisplay::updateMinValue
void updateMinValue()
Definition: linear_gauge_display.cpp:522
jsk_rviz_plugins::LinearGaugeDisplay::draw_required_
bool draw_required_
Definition: linear_gauge_display.h:181
bounding_box_sample.y
y
Definition: bounding_box_sample.py:27
jsk_rviz_plugins::LinearGaugeDisplay::data_
float data_
Definition: linear_gauge_display.h:197
jsk_rviz_plugins::LinearGaugeDisplay::onDisable
virtual void onDisable()
Definition: linear_gauge_display.cpp:392
jsk_rviz_plugins::LinearGaugeDisplay::subscribe
virtual void subscribe()
Definition: linear_gauge_display.cpp:370
jsk_rviz_plugins::LinearGaugeDisplay::texture_height_
uint16_t texture_height_
Definition: linear_gauge_display.h:186
jsk_rviz_plugins::LinearGaugeDisplay::movePosition
virtual void movePosition(int x, int y)
Definition: linear_gauge_display.cpp:540
jsk_rviz_plugins::LinearGaugeDisplay::vertical_gauge_
bool vertical_gauge_
Definition: linear_gauge_display.h:180
jsk_rviz_plugins::LinearGaugeDisplay::auto_color_change_
bool auto_color_change_
Definition: linear_gauge_display.h:177
jsk_rviz_plugins::LinearGaugeDisplay::bg_color_
QColor bg_color_
Definition: linear_gauge_display.h:172
jsk_rviz_plugins::LinearGaugeDisplay::texture_width_
uint16_t texture_width_
Definition: linear_gauge_display.h:185
jsk_rviz_plugins::LinearGaugeDisplay::updateShowCaption
void updateShowCaption()
Definition: linear_gauge_display.cpp:510
jsk_rviz_plugins::LinearGaugeDisplay::show_value_
bool show_value_
Definition: linear_gauge_display.h:178
jsk_rviz_plugins::LinearGaugeDisplay::update_interval_
float update_interval_
Definition: linear_gauge_display.h:183
jsk_rviz_plugins::LinearGaugeDisplay::update_interval_property_
rviz::FloatProperty * update_interval_property_
Definition: linear_gauge_display.h:154
jsk_rviz_plugins::LinearGaugeDisplay::first_time_
bool first_time_
Definition: linear_gauge_display.h:198
jsk_rviz_plugins::LinearGaugeDisplay::fg_alpha_
double fg_alpha_
Definition: linear_gauge_display.h:174
jsk_rviz_plugins::LinearGaugeDisplay::left_
int left_
Definition: linear_gauge_display.h:187
jsk_rviz_plugins::LinearGaugeDisplay::update_topic_property_
rviz::RosTopicProperty * update_topic_property_
Definition: linear_gauge_display.h:147
jsk_rviz_plugins::LinearGaugeDisplay::onEnable
virtual void onEnable()
Definition: linear_gauge_display.cpp:384
jsk_rviz_plugins::LinearGaugeDisplay::height_padding_
const int height_padding_
Definition: linear_gauge_display.h:195
jsk_rviz_plugins::LinearGaugeDisplay::caption_offset_
int caption_offset_
Definition: linear_gauge_display.h:191
jsk_rviz_plugins::LinearGaugeDisplay::max_color_property_
rviz::ColorProperty * max_color_property_
Definition: linear_gauge_display.h:163
jsk_rviz_plugins::LinearGaugeDisplay::updateBGColor
void updateBGColor()
Definition: linear_gauge_display.cpp:424
jsk_rviz_plugins::LinearGaugeDisplay::setPosition
virtual void setPosition(int x, int y)
Definition: linear_gauge_display.cpp:546
jsk_rviz_plugins::LinearGaugeDisplay::getY
virtual int getY()
Definition: linear_gauge_display.h:131
jsk_rviz_plugins::LinearGaugeDisplay::updateTop
void updateTop()
Definition: linear_gauge_display.cpp:412
jsk_rviz_plugins::LinearGaugeDisplay::drawPlot
virtual void drawPlot()
Definition: linear_gauge_display.cpp:233
jsk_rviz_plugins
Definition: __init__.py:1
jsk_rviz_plugins::LinearGaugeDisplay::fg_color_property_
rviz::ColorProperty * fg_color_property_
Definition: linear_gauge_display.h:150
jsk_rviz_plugins::LinearGaugeDisplay::bg_alpha_property_
rviz::FloatProperty * bg_alpha_property_
Definition: linear_gauge_display.h:153
color_property.h
ros_topic_property.h
ros::Subscriber
jsk_rviz_plugins::LinearGaugeDisplay::vertical_gauge_property_
rviz::BoolProperty * vertical_gauge_property_
Definition: linear_gauge_display.h:149
jsk_rviz_plugins::LinearGaugeDisplay::show_caption_property_
rviz::BoolProperty * show_caption_property_
Definition: linear_gauge_display.h:164
jsk_rviz_plugins::LinearGaugeDisplay::updateBGAlpha
void updateBGAlpha()
Definition: linear_gauge_display.cpp:442
rviz::IntProperty
jsk_rviz_plugins::LinearGaugeDisplay::isInRegion
virtual bool isInRegion(int x, int y)
Definition: linear_gauge_display.cpp:534


jsk_rviz_plugins
Author(s): Kei Okada , Yohei Kakiuchi , Shohei Fujii , Ryohei Ueda
autogenerated on Fri Aug 2 2024 08:50:14