1 #ifndef __ENSENSO_ENSENSO_GRABBER__ 2 #define __ENSENSO_ENSENSO_GRABBER__ 5 #include <pcl/pcl_config.h> 6 #include <pcl/common/io.h> 7 #include <pcl/common/time.h> 8 #include <pcl/io/eigen.h> 9 #include <pcl/io/boost.h> 10 #include <pcl/io/grabber.h> 11 #include <pcl/common/synchronizer.h> 13 #include <Eigen/Geometry> 14 #include <boost/thread.hpp> 15 #include <sensor_msgs/CameraInfo.h> 16 #include <geometry_msgs/TransformStamped.h> 31 double tx, ty,
tz, qx, qy, qz, qw;
42 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
50 (sig_cb_ensenso_point_cloud)(
const pcl::PointCloud<pcl::PointXYZ>::Ptr &);
53 (sig_cb_ensenso_point_cloud_rgb)(
const pcl::PointCloud<pcl::PointXYZRGBA>::Ptr &);
59 (sig_cb_ensenso_images_rgb)(
const boost::shared_ptr<PairOfImages>&,
const boost::shared_ptr<PairOfImages>&,
const boost::shared_ptr<PairOfImages>&);
91 bool calibrateHandEye ( const
std::vector<
Eigen::Affine3d,
Eigen::aligned_allocator<
Eigen::Affine3d> > &robot_poses,
92 const
Eigen::Affine3d &camera_seed,
93 const
Eigen::Affine3d &pattern_seed,
95 Eigen::Affine3d &estimated_camera_pose,
96 Eigen::Affine3d &estimated_pattern_pose,
98 double &reprojection_error) const;
102 bool closeDevices ();
108 bool closeTcpPort (
void);
114 int collectPattern (const
bool buffer=true) const;
118 double decodePattern () const;
123 bool discardPatterns () const;
127 int enumDevices () const;
138 bool estimatePatternPose (
Eigen::Affine3d &pose, const
bool average=false) const;
142 std::
string getName () const;
150 bool getCameraInfo(
std::
string cam,
sensor_msgs::CameraInfo &cam_info) const;
166 bool getLastCalibrationPattern (
std::vector<
int> &grid_size,
double &grid_spacing,
167 std::vector<
Eigen::Vector2d> &left_points,
168 std::vector<
Eigen::Vector2d> &right_points,
169 Eigen::Affine3d &pose) const;
172 float getFramesPerSecond () const;
176 int getPatternCount () const;
186 bool isRunning () const;
190 bool isTcpPortOpen () const;
195 bool openDevice (
std::
string serial);
201 bool openMonoDevice (
std::
string serial);
207 bool openTcpPort (const
int port = 24000);
211 bool restoreDefaultConfiguration () const;
217 bool setEnableCUDA (const
bool enable=true) const;
222 bool setFindPattern (const
bool enable=true);
227 bool setUseRGB (const
bool enable=true);
232 bool setAutoBlackLevel (const
bool enable=true) const;
237 bool setAutoExposure (const
bool enable=true) const;
242 bool setAutoGain (const
bool enable=true) const;
252 bool setBinning (const
int binning=1) const;
259 bool setBlackLevelOffset (const
float offset=1.0) const;
266 bool setExposure (const
float exposure=1.0) const;
281 bool setFlexView (const
bool enable=false, const
int imagepairs=2) const;
289 bool setFrontLight (const
bool enable=false) const;
296 bool setGain (const
float gain=1.0) const;
301 bool setGainBoost (const
bool enable=false) const;
306 bool setGridSpacing (const
double grid_spacing) const;
312 bool setHardwareGamma (const
bool enable=true) const;
318 bool setHdr (const
bool enable=false) const;
326 bool setMinimumDisparity (const
int disparity=-64) const;
334 bool setNumberOfDisparities (const
int number=128) const;
348 bool setOptimizationProfile (const
std::
string profile="AlignedAndDiagonal") const;
356 bool setPixelClock (const
int pixel_clock=24) const;
363 bool setProjector (const
bool enable=true) const;
376 bool setScaling (const
float scaling=1.0) const;
381 bool setTargetBrightness (const
int target=80) const;
393 bool setTriggerMode (const
std::
string mode="Software") const;
399 bool setRGBTriggerDelay (const
float delay=10) const;
405 bool setUseOpenGL (const
bool enable) const;
419 bool setUseDisparityMapAreaOfInterest (const
bool enable=false) const;
426 bool setDepthChangeCost(const
int changecost) const;
435 bool setDepthStepCost(const
int stepcost) const;
447 bool setShadowingThreshold(const
int shadowingthreshold) const;
455 bool setUniquenessRatio(const
int ratio) const;
464 bool setMedianFilterRadius(const
int radius) const;
476 bool setSpeckleComponentThreshold(const
int threshold) const;
484 bool setSpeckleRegionSize(const
int threshold) const;
491 bool setFillBorderSpread(const
int maximumspread) const;
498 bool setFillRegionSize(const
int regionsize) const;
503 bool setSurfaceConnectivity(const
int threshold) const;
509 bool setNearPlane(const
int near);
515 bool setFarPlane(const
int far);
527 void storeCalibrationPattern (const
bool enable);
534 boost::signals2::signal<sig_cb_ensenso_point_cloud>* point_cloud_signal_;
537 boost::signals2::signal<sig_cb_ensenso_point_cloud_rgb>* point_cloud_rgb_signal_;
540 boost::signals2::signal<sig_cb_ensenso_images>* images_signal_;
543 boost::signals2::signal<sig_cb_ensenso_images_rgb>* images_rgb_signal_;
546 boost::signals2::signal<sig_cb_ensenso_image_depth>* image_depth_signal_;
554 boost::shared_ptr<const NxLibItem> root_;
567 bool mono_device_open_;
576 std::
string last_stereo_pattern_;
579 bool store_calibration_pattern_;
582 mutable
boost::mutex pattern_mutex_;
612 pcl::uint64_t static getPCLStamp (const
double ensenso_stamp);
619 std::
string static getOpenCVType (const
int channels, const
int bpe, const
bool isFlt);
626 bool jsonToMatrix (const
std::
string json,
Eigen::Affine3d &matrix) const;
634 bool matrixToJson (const
Eigen::Affine3d &matrix,
std::
string &json, const
bool pretty_format=true) const;
639 void processGrabbing ();
644 void triggerCameras();
650 void getImage(const NxLibItem& image_node,
pcl::
PCLGenImage<
pcl::uint8_t>& image_out);
665 #endif // __PCL_IO_ENSENSO_GRABBER__
sensor_msgs::PointCloud2 PointCloud
pcl::PointXYZRGBA PointXYZRGBA
std::pair< pcl::PCLGenImage< pcl::uint8_t >, pcl::PCLGenImage< pcl::uint8_t > > PairOfImages
Grabber for IDS-Imaging Ensenso's devices.
boost::shared_ptr< ::pcl::PCLGenImage< T > const > ConstPtr
boost::shared_ptr< ::pcl::PCLGenImage< T > > Ptr