33#include <VisionX/interface/components/RGBDImageProvider.h>
36#include <condition_variable>
39#include <Eigen/Geometry>
41#include <pcl/common/transforms.h>
42#include <pcl/io/openni2_grabber.h>
43#include <pcl/point_cloud.h>
44#include <pcl/point_types.h>
46#include <opencv2/opencv.hpp>
50#include <RobotAPI/interface/components/RobotHealthInterface.h>
53#include <Image/IplImageAdaptor.h>
70 .map(
"320x240", Eigen::Vector2i(320, 240))
71 .map(
"640x480", Eigen::Vector2i(640, 480))
72 .map(
"800x600", Eigen::Vector2i(800, 600))
73 .map(
"1280x1024", Eigen::Vector2i(1280, 1024))
74 .map(
"1600x1200", Eigen::Vector2i(1600, 1200));
77 "VisionX/camera_calibration/asus_xtion_depth.yaml",
80 "RGBCameraCalibrationFile",
"VisionX/camera_calibration/asus_xtion_rgb.yaml",
"");
84 "EnableAutoWhiteBalance",
true,
"enable auto white balance.");
87 "ReferenceFrameName",
"DepthCamera",
"Optional reference frame name.");
90 "Device id of the openni device, e.g. empty for "
91 "first device, or index in the format #n, e.g. 0");
95 "In Milliseconds. Time offset between capturing the image on the hardware and "
96 "receiving the image in this process.",
99 "RobotHealthTopicName",
"RobotHealthTopic",
"Name of the RobotHealth topic");
102 "Name of the topic the DebugObserver listens on");
114 virtual public RGBDPointCloudProviderInterface,
127 std::vector<imrec::ChannelPreferences>
205 void callbackFunctionForOpenNIGrabberPointCloudWithRGB(
206 const pcl::PointCloud<pcl::PointXYZRGBA>::ConstPtr& newCloud);
207 void callbackFunctionForOpenNIGrabberPointCloud(
208 const pcl::PointCloud<pcl::PointXYZ>::ConstPtr& newCloud);
209 void callbackFunctionForOpenNIGrabberImage(
const pcl::io::Image::Ptr& newImage);
210 void grabImages(
const pcl::io::Image::Ptr& RGBImage,
211 const pcl::io::DepthImage::Ptr& depthImage,
212 float reciprocalFocalLength);
213 void grabDepthImage(
const pcl::io::IRImage::Ptr& RGBImage,
214 const pcl::io::DepthImage::Ptr& depthImage,
218 bool loadCalibrationFile(std::string fileName, visionx::CameraParameters& calibration);
220 ImageProviderInterfacePrx imageProviderPrx;
221 std::string providerName;
222 CByteImage** rgbImages;
224 mutable std::mutex syncMutex;
226 pcl::io::OpenNI2Grabber::Ptr grabberInterface;
227 std::condition_variable condition;
228 bool newPointCloudCapturingRequested, newImageCapturingRequested;
229 long timeOfLastImageCapture, timeOfLastPointCloudCapture;
230 pcl::PointCloud<pcl::PointXYZRGBA>::Ptr pointcloudBuffer;
231 StereoCalibration calibration;
232 long captureTimeOffset;
234 armarx::RobotHealthInterfacePrx robotHealthTopic;
236 IceUtil::Time lastReportTimestamp;
Property< PropertyType > getProperty(const std::string &name)
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...
float frameRate
Required frame rate.
ImageProvider abstract class defines a component which provide images via ice or shared memory.
OpenNIPointCloudProviderPropertyDefinitions(std::string prefix)
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.
bool doCapture() override
void onExitCapturingPointCloudProvider() override
void onDisconnectComponent() override
Hook for subclass.
OpenNIPointCloudProvider()
void onConnectPointCloudProvider() override
void onStartCapture(float frameRate) override
void onInitCapturingPointCloudProvider() override
void onConnectComponent() override
Pure virtual hook for the subclass.
StereoCalibration getStereoCalibration(const Ice::Current &c=Ice::emptyCurrent) override
void onStopCapture() override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
static std::string GetDefaultName()
std::vector< imrec::ChannelPreferences > getImageRecordingChannelPreferences(const Ice::Current &) override
void onInitImageProvider() override
void onExitComponent() override
Hook for subclass.
void onExitImageProvider() override
std::string getDefaultName() const override
Retrieve default name of component.
bool getImagesAreUndistorted(const ::Ice::Current &c=Ice::emptyCurrent) override
This file offers overloads of toIce() and fromIce() functions for STL container types.
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface > DebugObserverInterfacePrx
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.