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 return "OpenNIPointCloudProvider";
130 std::vector<imrec::ChannelPreferences>
208 void callbackFunctionForOpenNIGrabberPointCloudWithRGB(
209 const pcl::PointCloud<pcl::PointXYZRGBA>::ConstPtr& newCloud);
210 void callbackFunctionForOpenNIGrabberPointCloud(
211 const pcl::PointCloud<pcl::PointXYZ>::ConstPtr& newCloud);
212 void callbackFunctionForOpenNIGrabberImage(
const pcl::io::Image::Ptr& newImage);
213 void grabImages(
const pcl::io::Image::Ptr& RGBImage,
214 const pcl::io::DepthImage::Ptr& depthImage,
215 float reciprocalFocalLength);
216 void grabDepthImage(
const pcl::io::IRImage::Ptr& RGBImage,
217 const pcl::io::DepthImage::Ptr& depthImage,
221 bool loadCalibrationFile(std::string fileName, visionx::CameraParameters& calibration);
223 ImageProviderInterfacePrx imageProviderPrx;
224 std::string providerName;
225 CByteImage** rgbImages;
227 mutable std::mutex syncMutex;
229 pcl::io::OpenNI2Grabber::Ptr grabberInterface;
230 std::condition_variable condition;
231 bool newPointCloudCapturingRequested, newImageCapturingRequested;
232 long timeOfLastImageCapture, timeOfLastPointCloudCapture;
233 pcl::PointCloud<pcl::PointXYZRGBA>::Ptr pointcloudBuffer;
234 StereoCalibration calibration;
235 long captureTimeOffset;
237 armarx::RobotHealthInterfacePrx robotHealthTopic;
239 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
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
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.