23#ifndef _ARMARX_COMPONENT_VisionX_IntelRealSenseProvider_H
24#define _ARMARX_COMPONENT_VisionX_IntelRealSenseProvider_H
29#include <opencv2/opencv.hpp>
32#include <ArmarXCore/interface/observers/ObserverInterface.h>
34#include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
39#include <VisionX/interface/components/RGBDImageProvider.h>
41#include <librealsense2/h/rs_option.h>
42#include <librealsense2/rs.hpp>
58 "Resolution", Eigen::Vector2i(1280, 720),
"Resolution of the RGB and depth image.")
59 .map(
"424x240", Eigen::Vector2i(424, 240))
60 .map(
"480x270", Eigen::Vector2i(480, 270))
61 .map(
"640x360", Eigen::Vector2i(640, 360))
62 .map(
"640x480", Eigen::Vector2i(640, 480))
63 .map(
"848x480", Eigen::Vector2i(848, 480))
64 .map(
"960x540", Eigen::Vector2i(960, 540))
65 .map(
"1280x720", Eigen::Vector2i(1280, 720));
68 Eigen::Vector2f(69.4, 42.5),
69 "The horizontal and vertical field of view.");
74 "JSON config file (e.g. from the realsense-viewer) to load. If property is not "
75 "set, the preset property is used.");
78 RS2_RS400_VISUAL_PRESET_MEDIUM_DENSITY,
79 "RealSense preset. Only used if ConfigFile property is not set.")
80 .setCaseInsensitive(
true)
81 .map(
"CUSTOM", RS2_RS400_VISUAL_PRESET_CUSTOM)
82 .map(
"DEFAULT", RS2_RS400_VISUAL_PRESET_DEFAULT)
83 .map(
"HAND", RS2_RS400_VISUAL_PRESET_HAND)
84 .map(
"HIGH_ACCURACY", RS2_RS400_VISUAL_PRESET_HIGH_ACCURACY)
85 .map(
"HIGH_DENSITY", RS2_RS400_VISUAL_PRESET_HIGH_DENSITY)
86 .map(
"MEDIUM_DENSITY", RS2_RS400_VISUAL_PRESET_MEDIUM_DENSITY)
87 .map(
"REMOVE_IR_PATTERN", RS2_RS400_VISUAL_PRESET_REMOVE_IR_PATTERN);
92 "Max depth values allowed in Millimeters. Values above these are set to nan.",
96 "Apply a spatial filter to the depth image.",
100 "Align the depth image with the rgb image.",
104 "Apply a temporal filter that smoothes over several "
105 "frames. Leads to artifacts in combination with motion.",
109 "Apply the disparity transformation filter.",
126 virtual public visionx::RGBDPointCloudProviderInterface,
153 visionx::StereoCalibration
159 visionx::StereoCalibration
182 MetaPointCloudFormatPtr
185 MetaPointCloudFormatPtr info =
new MetaPointCloudFormat();
187 info->type = PointContentType::eColoredPoints;
188 info->capacity = 1280 * 720 *
sizeof(ColoredPoint3D);
189 info->size = info->capacity;
195 rs2::colorizer color_map;
197 using CloudPointType = pcl::PointXYZRGBA;
198 pcl::PointCloud<CloudPointType>::Ptr pointcloud;
200 MetaPointCloudFormatPtr cloudFormat;
202 visionx::StereoCalibration calibration;
209 rs2::spatial_filter spat_filter;
210 std::unique_ptr<rs2::align> alignFilter;
211 rs2::temporal_filter temporal_filter;
212 rs2::disparity_transform depth_to_disparity_filter,
213 disparity_to_depth_filter = rs2::disparity_transform(
false);
215 float depthScale = 1;
PropertyDefinition< EigenVectorType > & defineOptionalPropertyVector(const std::string &name, EigenVectorType defaultValue, const std::string &description="", const std::string &delimiter=" ", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
Define a required property for an Eigen vector type.
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
CapturingPointCloudProviderPropertyDefinitions(std::string prefix)
The CapturingPointCloudProvider provides a callback function to trigger the capturing of point clouds...
ImageProvider abstract class defines a component which provide images via ice or shared memory.
IntelRealSenseProviderPropertyDefinitions(std::string prefix)
Brief description of class IntelRealSenseProvider.
std::string getReferenceFrame(const Ice::Current &c=Ice::emptyCurrent) override
bool hasSharedMemorySupport(const Ice::Current &c=Ice::emptyCurrent) override
void onInitComponent() override
Pure virtual hook for the subclass.
visionx::StereoCalibration createStereoCalibration(const rs2::pipeline_profile &selection) const
bool doCapture() override
Main capturing function.
void onExitCapturingPointCloudProvider() override
This is called when the Component::onExitComponent() setup is called.
void onDisconnectComponent() override
Hook for subclass.
void onStopCapture()
This is called when the point cloud provider capturing has been stopped.
visionx::StereoCalibration getStereoCalibration(const Ice::Current &c=Ice::emptyCurrent) override
virtual armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void onStartCapture(float framesPerSecond)
This is called when the point cloud provider capturing has been started.
void onInitCapturingPointCloudProvider() override
This is called when the Component::onInitComponent() is called.
void onConnectComponent() override
Pure virtual hook for the subclass.
MetaPointCloudFormatPtr getDefaultPointCloudFormat()
default point cloud format used to initialize shared memory
void onInitImageProvider() override
This is called when the Component::onInitComponent() is called.
void onExitComponent()
Hook for subclass.
void onExitImageProvider() override
This is called when the Component::onExitComponent() setup is called.
virtual std::string getDefaultName() const override
bool getImagesAreUndistorted(const ::Ice::Current &c=Ice::emptyCurrent) override
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
std::unique_ptr< CByteImage > CByteImageUPtr