snow_display.h
Go to the documentation of this file.
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2020, David Lu!!
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of the copyright holder nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  */
34 
35 #ifndef SNOWBOT_OPERATING_SYSTEM_SNOW_DISPLAY_H
36 #define SNOWBOT_OPERATING_SYSTEM_SNOW_DISPLAY_H
37 
38 #include <rviz/display.h>
42 #include <geometry_msgs/Point.h>
43 #include <vector>
44 
46 {
47 class SnowDisplay : public rviz::Display
48 {
49  Q_OBJECT
50 public:
51  SnowDisplay();
52 
53  void update(float wall_dt, float ros_dt) override;
54 
55 protected:
56  void onInitialize() override;
57 
58 private Q_SLOTS:
59  void updateSize();
60  void updatePosition();
61 
62 private:
63  void letItSnow();
64 
65  void initializeXY(geometry_msgs::Point& pt) const;
66 
68  std::vector<rviz::PointCloud::Point> flakes_;
69 
70  std::vector<geometry_msgs::Point> points_;
71 
78 
79  double width_, height_;
80 };
81 } // namespace snowbot_operating_system
82 
83 #endif // SNOWBOT_OPERATING_SYSTEM_SNOW_DISPLAY_H
snowbot_operating_system::SnowDisplay::height_
double height_
Definition: snow_display.h:79
snowbot_operating_system::SnowDisplay::updateSize
void updateSize()
Definition: snow_display.cpp:86
snowbot_operating_system::SnowDisplay
Definition: snow_display.h:47
snowbot_operating_system::SnowDisplay::height_property_
rviz::FloatProperty * height_property_
Definition: snow_display.h:73
snowbot_operating_system::SnowDisplay::gravity_property_
rviz::FloatProperty * gravity_property_
Definition: snow_display.h:74
int_property.h
display.h
point_cloud.h
float_property.h
rviz::Display
snowbot_operating_system::SnowDisplay::jiggle_property_
rviz::FloatProperty * jiggle_property_
Definition: snow_display.h:76
rviz::PointCloud
rviz::FloatProperty
snowbot_operating_system::SnowDisplay::points_
std::vector< geometry_msgs::Point > points_
Definition: snow_display.h:70
snowbot_operating_system::SnowDisplay::point_cloud_
rviz::PointCloud * point_cloud_
Definition: snow_display.h:67
snowbot_operating_system::SnowDisplay::flakes_
std::vector< rviz::PointCloud::Point > flakes_
Definition: snow_display.h:68
snowbot_operating_system::SnowDisplay::size_property_
rviz::IntProperty * size_property_
Definition: snow_display.h:77
snowbot_operating_system::SnowDisplay::width_
double width_
Definition: snow_display.h:79
snowbot_operating_system::SnowDisplay::initializeXY
void initializeXY(geometry_msgs::Point &pt) const
Definition: snow_display.cpp:80
snowbot_operating_system::SnowDisplay::onInitialize
void onInitialize() override
Definition: snow_display.cpp:62
snowbot_operating_system::SnowDisplay::letItSnow
void letItSnow()
Definition: snow_display.cpp:139
snowbot_operating_system::SnowDisplay::wind_property_
rviz::FloatProperty * wind_property_
Definition: snow_display.h:75
snowbot_operating_system
Definition: snow_display.h:45
snowbot_operating_system::SnowDisplay::SnowDisplay
SnowDisplay()
Definition: snow_display.cpp:46
snowbot_operating_system::SnowDisplay::update
void update(float wall_dt, float ros_dt) override
Definition: snow_display.cpp:75
snowbot_operating_system::SnowDisplay::updatePosition
void updatePosition()
Definition: snow_display.cpp:103
snowbot_operating_system::SnowDisplay::width_property_
rviz::FloatProperty * width_property_
Definition: snow_display.h:72
rviz::IntProperty


snowbot_operating_system
Author(s):
autogenerated on Wed Mar 2 2022 01:03:22