39 #ifndef _vpOccipitalStructure_h_ 40 #define _vpOccipitalStructure_h_ 42 #include <visp3/core/vpConfig.h> 44 #if defined(VISP_HAVE_OCCIPITAL_STRUCTURE) && (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) 46 #include <condition_variable> 48 #include <ST/CaptureSession.h> 51 #include <pcl/common/common_headers.h> 54 #include <visp3/core/vpCameraParameters.h> 55 #include <visp3/core/vpImage.h> 217 case ST::CaptureSessionEventId::Booting:
break;
218 case ST::CaptureSessionEventId::Connected:
219 printf(
"Starting streams...\n");
220 session->startStreaming();
226 m_USBVersion = session->USBVersion();
227 m_serialNumber = session->sensorInfo().serialNumber;
228 m_cameraType = session->getCameraType();
230 case ST::CaptureSessionEventId::Disconnected:
232 case ST::CaptureSessionEventId::Error:
236 printf(
"Capture session event unhandled\n");
242 std::lock_guard<std::mutex> u(m_sampleLock);
245 if(sample.visibleFrame.isValid())
246 m_visibleFrame = sample.visibleFrame;
248 if(sample.depthFrame.isValid())
249 m_depthFrame = sample.depthFrame;
251 if(sample.infraredFrame.isValid())
252 m_infraredFrame = sample.infraredFrame;
254 if(sample.type == ST::CaptureSessionSample::Type::AccelerometerEvent)
255 m_accelerometerEvent = sample.accelerometerEvent;
257 if(sample.type == ST::CaptureSessionSample::Type::GyroscopeEvent)
258 m_gyroscopeEvent = sample.gyroscopeEvent;
262 cv_sampleLock.notify_one();
281 void acquire(
vpImage<vpRGBa> &rgb,
bool undistorted=
false,
double *ts=NULL);
284 bool undistorted=
false,
double *ts=NULL);
286 bool undistorted=
false,
double *ts=NULL);
288 void acquire(
unsigned char *
const data_image,
unsigned char *
const data_depth,
289 std::vector<vpColVector> *
const data_pointCloud=NULL,
unsigned char *
const data_infrared=NULL,
291 bool undistorted=
true,
double *ts=NULL);
294 void acquire(
unsigned char *
const data_image,
unsigned char *
const data_depth,
295 std::vector<vpColVector> *
const data_pointCloud, pcl::PointCloud<pcl::PointXYZ>::Ptr &pointcloud,
296 unsigned char *
const data_infrared=NULL,
vpColVector *acceleration_data=NULL,
vpColVector *gyroscope_data=NULL,
297 bool undistorted=
true,
double *ts=NULL);
298 void acquire(
unsigned char *
const data_image,
unsigned char *
const data_depth,
299 std::vector<vpColVector> *
const data_pointCloud, pcl::PointCloud<pcl::PointXYZRGB>::Ptr &pointcloud,
300 unsigned char *
const data_infrared=NULL,
vpColVector *acceleration_data=NULL,
vpColVector *gyroscope_data=NULL,
301 bool undistorted=
true,
double *ts=NULL);
304 void getIMUVelocity(
vpColVector *imu_vel,
double *ts);
305 void getIMUAcceleration(
vpColVector *imu_acc,
double *ts);
308 bool open(
const ST::CaptureSessionSettings &settings);
314 ST::StructureCoreCameraType
getCameraType()
const {
return m_delegate.m_cameraType; }
316 ST::CaptureSessionUSBVersion
getUSBVersion()
const {
return m_delegate.m_USBVersion; }
321 unsigned int getWidth(vpOccipitalStructureStream stream_type);
322 unsigned int getHeight(vpOccipitalStructureStream stream_type);
325 float getDepth(
int x,
int y);
327 vpPoint unprojectPoint(
int row,
int col);
329 vpHomogeneousMatrix getTransform(
const vpOccipitalStructureStream from,
const vpOccipitalStructureStream to);
331 ST::Intrinsics getIntrinsics(
const vpOccipitalStructureStream stream_type)
const;
336 void saveDepthImageAsPointCloudMesh(std::string &filename);
348 void getPointcloud(std::vector<vpColVector> &pointcloud);
350 void getPointcloud(pcl::PointCloud<pcl::PointXYZ>::Ptr &pointcloud);
351 void getColoredPointcloud(pcl::PointCloud<pcl::PointXYZRGB>::Ptr &pointcloud);
VISP_EXPORT int wait(double t0, double t)
ST::CaptureSession m_captureSession
float m_invalidDepthValue
vpCameraParameters m_visible_camera_parameters
Implementation of an homogeneous matrix and operations on such kind of matrices.
vpOccipitalStructureStream
ST::StructureCoreCameraType m_cameraType
ST::StructureCoreCameraType getCameraType() const
ST::CaptureSessionUSBVersion m_USBVersion
error that can be emited by ViSP classes.
void captureSessionDidOutputSample(ST::CaptureSession *, const ST::CaptureSessionSample &sample) override
ST::CaptureSessionSettings m_captureSessionSettings
std::condition_variable cv_sampleLock
void captureSessionEventDidOccur(ST::CaptureSession *session, ST::CaptureSessionEventId event) override
std::string getSerialNumber() const
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
SessionDelegate m_delegate
ST::CaptureSessionUSBVersion getUSBVersion() const
ST::DepthFrame m_depthFrame
vpCameraParametersProjType
Generic class defining intrinsic camera parameters.
std::string m_serialNumber
ST::CaptureSessionSettings & getCaptureSessionSettings()
Implementation of column vector and the associated operations.
ST::GyroscopeEvent m_gyroscopeEvent
ST::InfraredFrame m_infraredFrame
ST::CaptureSession & getCaptureSession()
ST::AccelerometerEvent m_accelerometerEvent
ST::ColorFrame m_visibleFrame