![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
RealSense camera discovery, configuration, streaming and recording. More...
#include <RealSenseSensor.h>


Public Member Functions | |
| RealSenseSensor () | |
| Default constructor. Initialize with default settings. More... | |
| RealSenseSensor (const RealSenseSensor &)=delete | |
| RealSenseSensor & | operator= (const RealSenseSensor &)=delete |
| virtual | ~RealSenseSensor () override |
| virtual bool | InitSensor (const RealSenseSensorConfig &sensor_config=RealSenseSensorConfig{}, size_t sensor_index=0, const std::string &filename="") |
| virtual bool | InitSensor (const RGBDSensorConfig &sensor_config, size_t sensor_index=0, const std::string &filename="") override |
| virtual bool | StartCapture (bool start_record=false) override |
| virtual void | PauseRecord () override |
| virtual void | ResumeRecord () override |
| virtual geometry::RGBDImage | CaptureFrame (bool wait=true, bool align_depth_to_color=true) override |
| virtual uint64_t | GetTimestamp () const override |
| virtual void | StopCapture () override |
| Stop capturing frames. More... | |
| virtual const RGBDVideoMetadata & | GetMetadata () const override |
| Get metadata of the RealSense video capture. More... | |
| virtual std::string | GetFilename () const override |
| Get filename being written. More... | |
| virtual const std::string | ToString () const |
| Text Description. More... | |
Public Member Functions inherited from cloudViewer::t::io::RGBDSensor | |
| RGBDSensor () | |
| Default constructor. Initialize with default settings. More... | |
| virtual | ~RGBDSensor () |
| virtual const std::string | ToString () const |
| Text Description. More... | |
Static Public Member Functions | |
| static std::vector< RealSenseValidConfigs > | EnumerateDevices () |
| static bool | ListDevices () |
RealSense camera discovery, configuration, streaming and recording.
Definition at line 28 of file RealSenseSensor.h.
| cloudViewer::t::io::RealSenseSensor::RealSenseSensor | ( | ) |
Default constructor. Initialize with default settings.
Definition at line 116 of file RealSenseSensor.cpp.
References cloudViewer::t::io::RealSenseSensorConfig::ConvertToNativeConfig().
|
delete |
|
overridevirtual |
Definition at line 123 of file RealSenseSensor.cpp.
References StopCapture().
|
overridevirtual |
Acquire the next synchronized RGBD frameset from the camera.
| wait | If true wait for the next frame set, else return immediately with an empty RGBDImage if it is not yet available. |
| align_depth_to_color | Enable aligning WFOV depth image to the color image in visualizer. |
Implements cloudViewer::t::io::RGBDSensor.
Definition at line 256 of file RealSenseSensor.cpp.
References cloudViewer::t::geometry::RGBDImage::color_, cloudViewer::t::io::RGBDVideoMetadata::color_dt_, cloudViewer::t::geometry::RGBDImage::depth_, cloudViewer::t::io::RGBDVideoMetadata::depth_dt_, error(), and LogError.
Referenced by cloudViewer::t::io::pybind_sensor().
|
static |
Query all connected RealSense cameras for their capabilities.
Definition at line 46 of file RealSenseSensor.cpp.
References context, format, patch::to_string(), and cloudViewer::t::io::RealSenseValidConfigs::valid_configs.
Referenced by ListDevices(), and cloudViewer::t::io::pybind_sensor().
|
inlineoverridevirtual |
Get filename being written.
Implements cloudViewer::t::io::RGBDSensor.
Definition at line 111 of file RealSenseSensor.h.
Referenced by cloudViewer::t::io::pybind_sensor().
|
inlineoverridevirtual |
Get metadata of the RealSense video capture.
Implements cloudViewer::t::io::RGBDSensor.
Definition at line 106 of file RealSenseSensor.h.
Referenced by cloudViewer::t::io::pybind_sensor().
|
inlineoverridevirtual |
Get current timestamp (in us)
See https://intelrealsense.github.io/librealsense/doxygen/classrs2_1_1frame.html#a25f71d45193f2f4d77960320276b83f1 for more details.
Implements cloudViewer::t::io::RGBDSensor.
Definition at line 100 of file RealSenseSensor.h.
Referenced by cloudViewer::t::io::pybind_sensor().
|
virtual |
Initialize sensor (optional).
Configure sensor with custom settings. If this is skipped, default settings will be used. You can enable recording to a bag file by specifying a filename.
| sensor_config | Camera configuration, such as resolution and framerate. A serial number can be entered here to connect to a specific camera. |
| sensor_index | Connect to a camera at this position in the enumeration of RealSense cameras that are currently connected. Use EnumerateDevices() or ListDevices() to obtain a list of connected cameras. This is ignored if sensor_config contains a serial entry. |
| filename | Save frames to a bag file |
Definition at line 125 of file RealSenseSensor.cpp.
References cloudViewer::t::io::RealSenseSensorConfig::config_, context, cloudViewer::t::io::RGBDVideoMetadata::ConvertFromJsonValue(), cloudViewer::t::io::RealSenseSensorConfig::ConvertToNativeConfig(), cloudViewer::utility::filesystem::DirectoryExists(), cloudViewer::utility::filesystem::FileExists(), filename, cloudViewer::utility::filesystem::GetFileParentDirectory(), cloudViewer::t::io::RealSenseSensorConfig::GetMetadataJson(), cloudViewer::t::io::RealSenseSensorConfig::GetPixelDtypes(), LogError, cloudViewer::utility::filesystem::MakeDirectoryHierarchy(), and profile.
Referenced by InitSensor(), and cloudViewer::t::io::pybind_sensor().
|
inlineoverridevirtual |
Initialize sensor (optional).
Configure sensor with custom settings. If this is skipped, default settings will be used. You can enable recording to a file by specifying a filename.
| sensor_config | Camera configuration, such as resolution and framerate. A serial number can be entered here to connect to a specific camera. |
| sensor_index | Connect to a camera at this position in the enumeration of RealSense cameras that are currently connected. Use EnumerateDevices() or ListDevices() to obtain a list of connected cameras and their capabilities. This is ignored if sensor_config contains a "serial" entry. |
| filename | Save frames to this file. |
Implements cloudViewer::t::io::RGBDSensor.
Definition at line 64 of file RealSenseSensor.h.
References filename, and InitSensor().
|
static |
List all RealSense cameras connected to the system along with their capabilities. Use this listing to select an appropriate configuration for a camera.
Definition at line 24 of file RealSenseSensor.cpp.
References EnumerateDevices(), LogInfo, and LogWarning.
Referenced by cloudViewer::t::io::pybind_sensor().
|
delete |
|
overridevirtual |
Pause recording to the bag file.
StartCapture(), the bag file may have an incorrect end time. Implements cloudViewer::t::io::RGBDSensor.
Definition at line 228 of file RealSenseSensor.cpp.
References LogDebug.
Referenced by cloudViewer::t::io::pybind_sensor().
|
overridevirtual |
Resume recording to the bag file. The file will contain discontinuous segments.
Implements cloudViewer::t::io::RGBDSensor.
Definition at line 235 of file RealSenseSensor.cpp.
References error(), LogDebug, and LogError.
Referenced by cloudViewer::t::io::pybind_sensor().
|
overridevirtual |
Start capturing synchronized depth and color frames.
| start_record | start recording to the specified bag file as well. |
Implements cloudViewer::t::io::RGBDSensor.
Definition at line 198 of file RealSenseSensor.cpp.
References cloudViewer::t::io::RGBDVideoMetadata::ConvertFromJsonValue(), error(), cloudViewer::t::io::RealSenseSensorConfig::GetMetadataJson(), cloudViewer::t::io::RealSenseSensorConfig::GetPixelDtypes(), LogError, LogInfo, LogWarning, and profile.
Referenced by cloudViewer::t::io::pybind_sensor().
|
overridevirtual |
Stop capturing frames.
Implements cloudViewer::t::io::RGBDSensor.
Definition at line 289 of file RealSenseSensor.cpp.
References LogInfo.
Referenced by cloudViewer::t::io::pybind_sensor(), and ~RealSenseSensor().
|
inline |
Text Description.
Definition at line 81 of file RGBDSensor.h.
Referenced by cloudViewer::t::io::pybind_sensor().