video_capture_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 
36 
37 #ifndef JSK_RVIZ_PLUGIN_VIDEO_CAPTURE_DISPLAY_H_
38 #define JSK_RVIZ_PLUGIN_VIDEO_CAPTURE_DISPLAY_H_
39 
40 #include <rviz/display.h>
45 #include <opencv2/opencv.hpp>
46 
47 #include <ros/ros.h>
48 
49 namespace jsk_rviz_plugins
50 {
51  class VideoCaptureDisplay: public rviz::Display
52  {
53  Q_OBJECT
54  public:
55 #if ROS_VERSION_MINIMUM(1,12,0)
56  typedef std::shared_ptr<VideoCaptureDisplay> Ptr;
57 #else
59 #endif
61  virtual ~VideoCaptureDisplay();
62  protected:
63  virtual void onInitialize();
64  // virtual void subscribe();
65  // virtual void unsubscribe();
66  virtual void onEnable();
67  // virtual void onDisable();
68  virtual void update(float wall_dt, float ros_dt);
69  virtual void startCapture();
70  virtual void stopCapture();
72  // Variables
80  std::string file_name_;
81  bool capturing_;
82  double fps_;
84  int width_;
85  int height_;
86  int frame_counter_;
87  bool first_time_;
88  cv::VideoWriter writer_;
89  protected Q_SLOTS:
90  void updateFileName();
91  void updateStartCapture();
92  void updateFps();
93  void updateUse3DViewerSize();
94  void updateWidth();
95  void updateHeight();
96  private:
97 
98  };
99 }
100 
101 #endif
jsk_rviz_plugins::VideoCaptureDisplay::startCapture
virtual void startCapture()
Definition: video_capture_display.cpp:229
jsk_rviz_plugins::VideoCaptureDisplay::fps_
double fps_
Definition: video_capture_display.h:146
boost::shared_ptr
jsk_rviz_plugins::VideoCaptureDisplay::VideoCaptureDisplay
VideoCaptureDisplay()
Definition: video_capture_display.cpp:87
jsk_rviz_plugins::VideoCaptureDisplay::file_name_property_
rviz::StringProperty * file_name_property_
Definition: video_capture_display.h:138
jsk_rviz_plugins::VideoCaptureDisplay::start_capture_property_
rviz::BoolProperty * start_capture_property_
Definition: video_capture_display.h:139
jsk_rviz_plugins::VideoCaptureDisplay::use_3d_viewer_size_property_
rviz::BoolProperty * use_3d_viewer_size_property_
Definition: video_capture_display.h:141
ros.h
jsk_rviz_plugins::VideoCaptureDisplay::writer_
cv::VideoWriter writer_
Definition: video_capture_display.h:152
rviz::BoolProperty
int_property.h
jsk_rviz_plugins::VideoCaptureDisplay::use_3d_viewer_size_
bool use_3d_viewer_size_
Definition: video_capture_display.h:147
jsk_rviz_plugins::VideoCaptureDisplay::updateWidth
void updateWidth()
Definition: video_capture_display.cpp:219
display.h
jsk_rviz_plugins::VideoCaptureDisplay::updateStartCapture
void updateStartCapture()
Definition: video_capture_display.cpp:177
jsk_rviz_plugins::VideoCaptureDisplay::onInitialize
virtual void onInitialize()
Definition: video_capture_display.cpp:121
float_property.h
rviz::Display
rviz::FloatProperty
bool_property.h
jsk_rviz_plugins::VideoCaptureDisplay::updateFileName
void updateFileName()
Definition: video_capture_display.cpp:139
jsk_rviz_plugins::VideoCaptureDisplay::width_property_
rviz::IntProperty * width_property_
Definition: video_capture_display.h:142
jsk_rviz_plugins::VideoCaptureDisplay::updateFps
void updateFps()
Definition: video_capture_display.cpp:196
jsk_rviz_plugins::VideoCaptureDisplay::Ptr
boost::shared_ptr< VideoCaptureDisplay > Ptr
Definition: video_capture_display.h:122
rviz::StringProperty
jsk_rviz_plugins::VideoCaptureDisplay::capturing_
bool capturing_
Definition: video_capture_display.h:145
jsk_rviz_plugins::VideoCaptureDisplay::updateUse3DViewerSize
void updateUse3DViewerSize()
Definition: video_capture_display.cpp:201
jsk_rviz_plugins::VideoCaptureDisplay::onEnable
virtual void onEnable()
Definition: video_capture_display.cpp:133
jsk_rviz_plugins::VideoCaptureDisplay::height_
int height_
Definition: video_capture_display.h:149
jsk_rviz_plugins::VideoCaptureDisplay::height_property_
rviz::IntProperty * height_property_
Definition: video_capture_display.h:143
jsk_rviz_plugins::VideoCaptureDisplay::stopCapture
virtual void stopCapture()
Definition: video_capture_display.cpp:241
jsk_rviz_plugins::VideoCaptureDisplay::file_name_
std::string file_name_
Definition: video_capture_display.h:144
jsk_rviz_plugins::VideoCaptureDisplay::updateHeight
void updateHeight()
Definition: video_capture_display.cpp:224
jsk_rviz_plugins::VideoCaptureDisplay::frame_counter_
int frame_counter_
Definition: video_capture_display.h:150
jsk_rviz_plugins::VideoCaptureDisplay::update
virtual void update(float wall_dt, float ros_dt)
Definition: video_capture_display.cpp:248
jsk_rviz_plugins::VideoCaptureDisplay::~VideoCaptureDisplay
virtual ~VideoCaptureDisplay()
Definition: video_capture_display.cpp:112
string_property.h
jsk_rviz_plugins::VideoCaptureDisplay::width_
int width_
Definition: video_capture_display.h:148
jsk_rviz_plugins
Definition: __init__.py:1
jsk_rviz_plugins::VideoCaptureDisplay::first_time_
bool first_time_
Definition: video_capture_display.h:151
rviz::IntProperty
jsk_rviz_plugins::VideoCaptureDisplay::fps_property_
rviz::FloatProperty * fps_property_
Definition: video_capture_display.h:140


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