PlaybackImageProvider.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @package visionx::components
17  * @author Christian R. G. Dreher <c.dreher@kit.edu>
18  * @date 2018
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 
24 #pragma once
25 
26 
27 // STD/STL
28 #include <string>
29 
30 // IVT
31 #include <Calibration/StereoCalibration.h>
32 
33 // VisionX
35 #include <VisionX/interface/components/Calibration.h>
36 #include <VisionX/libraries/armem/vision/images/server/ImageMemoryServer.h>
39 
41 {
42 
44  virtual public visionx::CapturingImageProvider,
45  // virtual public StereoCalibrationCaptureProviderInterface,
48  {
49  protected:
50  std::vector<visionx::imrec::Playback> m_playbacks;
51  double m_current_frame = 0;
52  double m_frame_advance = 0;
53 
54  bool m_stereo_initialized = false;
57  CStereoCalibration m_stereo_calibration_ivt;
58  visionx::StereoCalibration m_stereo_calibration;
59 
60  public:
62  virtual ~PlaybackImageProvider() override;
63 
64  virtual void onInitCapturingImageProvider() override;
65  virtual void onExitCapturingImageProvider() override;
66  virtual void onStartCapture(float) override;
67  virtual void onStopCapture() override;
68  virtual bool capture(void** imageBuffer) override;
69 
70  virtual visionx::StereoCalibration
71  getStereoCalibration(const Ice::Current& c = Ice::emptyCurrent) override;
72  virtual bool getImagesAreUndistorted(const Ice::Current& c = Ice::emptyCurrent) override;
73  virtual std::string getReferenceFrame(const Ice::Current& c = Ice::emptyCurrent) override;
74 
75  virtual std::string getDefaultName() const override;
77 
78  private:
79  void init_stereo_calibration_file();
80  void init_stereo_calibration();
81  void assert_stereo_initialized();
82  };
83 
84 } // namespace visionx::components
visionx::components::PlaybackImageProvider::getReferenceFrame
virtual std::string getReferenceFrame(const Ice::Current &c=Ice::emptyCurrent) override
Definition: PlaybackImageProvider.cpp:279
visionx::components::PlaybackImageProvider::onInitCapturingImageProvider
virtual void onInitCapturingImageProvider() override
This is called when the Component::onInitComponent() is called.
Definition: PlaybackImageProvider.cpp:65
visionx::components::PlaybackImageProvider::onStartCapture
virtual void onStartCapture(float) override
This is called when the image provider capturing has been started.
Definition: PlaybackImageProvider.cpp:211
visionx::components::PlaybackImageProvider::onExitCapturingImageProvider
virtual void onExitCapturingImageProvider() override
This is called when the Component::onExitComponent() setup is called.
Definition: PlaybackImageProvider.cpp:200
visionx::components::PlaybackImageProvider::~PlaybackImageProvider
virtual ~PlaybackImageProvider() override
Definition: PlaybackImageProvider.cpp:57
visionx::components::PlaybackImageProvider::m_stereo_calibration_ivt
CStereoCalibration m_stereo_calibration_ivt
Definition: PlaybackImageProvider.h:57
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
visionx::components::PlaybackImageProvider::getImagesAreUndistorted
virtual bool getImagesAreUndistorted(const Ice::Current &c=Ice::emptyCurrent) override
Definition: PlaybackImageProvider.cpp:272
visionx::components::PlaybackImageProvider::getDefaultName
virtual std::string getDefaultName() const override
Retrieve default name of component.
Definition: PlaybackImageProvider.cpp:286
visionx::components::PlaybackImageProvider::m_current_frame
double m_current_frame
Definition: PlaybackImageProvider.h:51
visionx::components::PlaybackImageProvider::createPropertyDefinitions
virtual armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: PlaybackImageProvider.cpp:292
visionx::components::PlaybackImageProvider::getStereoCalibration
virtual visionx::StereoCalibration getStereoCalibration(const Ice::Current &c=Ice::emptyCurrent) override
Definition: PlaybackImageProvider.cpp:265
visionx::components::PlaybackImageProvider::m_playbacks
std::vector< visionx::imrec::Playback > m_playbacks
Definition: PlaybackImageProvider.h:50
visionx::components::PlaybackImageProvider::m_stereo_calibration_file
std::string m_stereo_calibration_file
Definition: PlaybackImageProvider.h:55
imrec.h
visionx::components::PlaybackImageProvider
Definition: PlaybackImageProvider.h:43
visionx::armem_images::server::ImageMemoryServer
Definition: ImageMemoryServer.ice:37
visionx::CapturingImageProvider::capture
virtual void capture()
Definition: CapturingImageProvider.cpp:106
visionx::CapturingImageProvider
The CapturingImageProvider provides a callback function to trigger the capturing of images with diffe...
Definition: CapturingImageProvider.h:52
visionx::components::PlaybackImageProvider::m_stereo_initialized
bool m_stereo_initialized
Definition: PlaybackImageProvider.h:54
visionx::armem_images::server::plugins::PluginUser
Definition: PluginUser.h:11
CapturingImageProvider.h
visionx::components::PlaybackImageProvider::onStopCapture
virtual void onStopCapture() override
This is called when the image provider capturing has been stopped.
Definition: PlaybackImageProvider.cpp:217
visionx::components::PlaybackImageProvider::m_stereo_calibration
visionx::StereoCalibration m_stereo_calibration
Definition: PlaybackImageProvider.h:58
IceUtil::Handle< class PropertyDefinitionContainer >
PluginUser.h
visionx::components
Definition: PlaybackImageProvider.h:40
visionx::components::PlaybackImageProvider::m_stereo_reference_frame
std::string m_stereo_reference_frame
Definition: PlaybackImageProvider.h:56
visionx::components::PlaybackImageProvider::PlaybackImageProvider
PlaybackImageProvider()
Definition: PlaybackImageProvider.cpp:52
visionx::components::PlaybackImageProvider::m_frame_advance
double m_frame_advance
Definition: PlaybackImageProvider.h:52