MaskRobotInImage.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-2018, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package VisionX
19  * @author Julian Zimmer ( urdbu at student dot kit dot edu )
20  * @date 2018
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 #ifndef _H_VISIONX_MaskRobotInImage_
25 #define _H_VISIONX_MaskRobotInImage_
26 
27 
30 #include <RobotAPI/interface/core/RobotState.h>
32 
33 #include <Eigen/Core>
34 
35 
36 #include <Image/ByteImage.h>
37 #include <Image/ImageProcessor.h>
38 
39 #include <VisionX/interface/core/DataTypes.h>
40 
41 
42 #include <Inventor/actions/SoGLRenderAction.h>
43 #include <Inventor/SoInteraction.h>
44 #include <Inventor/nodes/SoSelection.h>
45 #include <Inventor/nodes/SoUnits.h>
46 
47 #include <VirtualRobot/Robot.h>
48 #include <VirtualRobot/Visualization/CoinVisualization/CoinVisualizationFactory.h>
49 #include <VirtualRobot/Visualization/CoinVisualization/CoinVisualization.h>
50 
52 
53 
54 namespace armarx
55 {
56  /**
57  * @class MaskRobotInImage
58  * @brief A brief description
59  *
60  * Detailed Description
61  */
63  {
64  public:
65  /**
66  * MaskRobotInImage Constructor
67  */
68  MaskRobotInImage(RobotStateComponentInterfacePrx robotStateComponent, std::string cameraFrameName, visionx::ImageFormatInfo imageFormat, float fov, SbColor backgroundColor = SbColor(0.f, (177.f / 255.f), (64.f / 255.f)), bool flipImages = true, bool useFullModel = true, float collisionModelInflationMargin = 0.f);
69 
70  /**
71  * MaskRobotInImage Destructor
72  */
74 
75  CByteImage* getMaskImage(Ice::Long timestamp);
76 
77  void setBackgroundColor(SbColor newBackgroundColor);
78 
79  private:
80 
81  int imageWidth;
82  int imageHeight;
83  std::string cameraFrameName;
84  float fov;
85 
86  SbColor backgroundColor;
87  bool flipImages;
88  bool useFullModel;
89  float collisionModelInflationMargin;
90 
91  RobotStateComponentInterfacePrx robotStateComponent;
92  VirtualRobot::RobotPtr localRobot;
93 
94  std::shared_ptr<SoOffscreenRenderer> renderer;
95  std::vector<unsigned char> renderBuffer;
96 
97  CByteImage* renderedImage;
98  CByteImage* maskImage;
99  };
100 }
101 #endif
RemoteRobot.h
Pose.h
armarx::MaskRobotInImage::~MaskRobotInImage
~MaskRobotInImage()
MaskRobotInImage Destructor.
Definition: MaskRobotInImage.cpp:105
FramedPose.h
armarx::VariantType::Long
const VariantTypeId Long
Definition: Variant.h:917
Component.h
armarx::MaskRobotInImage
A brief description.
Definition: MaskRobotInImage.h:62
armarx::MaskRobotInImage::MaskRobotInImage
MaskRobotInImage(RobotStateComponentInterfacePrx robotStateComponent, std::string cameraFrameName, visionx::ImageFormatInfo imageFormat, float fov, SbColor backgroundColor=SbColor(0.f,(177.f/255.f),(64.f/255.f)), bool flipImages=true, bool useFullModel=true, float collisionModelInflationMargin=0.f)
MaskRobotInImage Constructor.
Definition: MaskRobotInImage.cpp:38
IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface >
armarx::MaskRobotInImage::setBackgroundColor
void setBackgroundColor(SbColor newBackgroundColor)
Definition: MaskRobotInImage.cpp:202
armarx::MaskRobotInImage::getMaskImage
CByteImage * getMaskImage(Ice::Long timestamp)
Definition: MaskRobotInImage.cpp:110
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:18