ZED Open Capture  v0.6.0
Low level camera driver for the ZED stereo camera family
Classes | Namespaces | Typedefs | Enumerations | Functions | Variables
sensorcapture_def.hpp File Reference

Go to the source code of this file.

Classes

struct  sl_oc::sensors::usb::RawData
 The RAW sensor data structure retrieved from camera MCU by USB. More...
 
struct  sl_oc::sensors::usb::StreamStatus
 Status of the usb data streaming. More...
 
struct  sl_oc::sensors::usb::_ov580_cmd_struct
 OV580 control using the MCU. More...
 

Namespaces

 sl_oc
 
 sl_oc::sensors
 
 sl_oc::sensors::usb
 

Typedefs

typedef enum sl_oc::sensors::usb::CUSTOMHID_REPORT_ID sl_oc::sensors::usb::CUSTOMHID_REPORT_ID
 USB HID communication report IDs. More...
 
typedef enum sl_oc::sensors::usb::CUSTOMHID_REQUEST_ID sl_oc::sensors::usb::CUSTOMHID_REQUEST_ID
 USB HID requests IDs. More...
 
typedef struct sl_oc::sensors::usb::RawData sl_oc::sensors::usb::RawData
 The RAW sensor data structure retrieved from camera MCU by USB. More...
 
typedef struct sl_oc::sensors::usb::StreamStatus sl_oc::sensors::usb::StreamStatus
 Status of the usb data streaming. More...
 
typedef struct sl_oc::sensors::usb::_ov580_cmd_struct sl_oc::sensors::usb::OV580CmdStruct
 OV580 control using the MCU. More...
 

Enumerations

enum  sl_oc::sensors::usb::CUSTOMHID_REPORT_ID { sl_oc::sensors::usb::REP_ID_SENSOR_DATA = 0x01 , sl_oc::sensors::usb::REP_ID_REQUEST_SET = 0x21 , sl_oc::sensors::usb::REP_ID_OV580_CMD = 0x22 , sl_oc::sensors::usb::REP_ID_SENSOR_STREAM_STATUS = 0x32 }
 USB HID communication report IDs. More...
 
enum  sl_oc::sensors::usb::CUSTOMHID_REQUEST_ID { sl_oc::sensors::usb::RQ_CMD_PING = 0xF2 , sl_oc::sensors::usb::RQ_CMD_RST = 0xE1 , sl_oc::sensors::usb::OV580_CMD_RESET = 0x02 }
 USB HID requests IDs. More...
 
enum class  sl_oc::sensors::ZED_M_FW {
  sl_oc::sensors::FW_2_2 = 514 , sl_oc::sensors::FW_2_3 = 515 , sl_oc::sensors::FW_2_4 = 516 , sl_oc::sensors::FW_2_5 = 517 ,
  sl_oc::sensors::LAST
}
 
enum class  sl_oc::sensors::ZED_2_FW {
  sl_oc::sensors::FW_3_4 = 772 , sl_oc::sensors::FW_3_5 = 773 , sl_oc::sensors::FW_3_6 = 774 , sl_oc::sensors::FW_3_7 = 775 ,
  sl_oc::sensors::FW_3_8 = 776 , sl_oc::sensors::FW_3_9 = 777 , sl_oc::sensors::FW_3_10 = 778
}
 

Functions

bool sl_oc::sensors::atLeast (const int &version_current, const ZED_2_FW &version_required)
 Check firmware version for ZED2 camera. More...
 
bool sl_oc::sensors::atLeast (const int &version_current, const ZED_M_FW &version_required)
 Check firmware version for ZED Mini camera. More...
 
std::string wstr2str (const wchar_t *wstr)
 Convert a wchar array to std::string. More...
 

Variables

const size_t sl_oc::sensors::TS_SHIFT_VAL_COUNT = 50
 Number of sensor data to use to update timestamp scaling. More...
 

Function Documentation

◆ wstr2str()

std::string wstr2str ( const wchar_t *  wstr)
inline

Convert a wchar array to std::string.

Parameters
wstrthe wchar array to be converted
Returns

Definition at line 182 of file sensorcapture_def.hpp.

183 {
184  if(wstr==NULL)
185  return std::string();
186 
187  try
188  {
189  std::wstring ws( wstr );
190  std::string str( ws.begin(), ws.end() );
191  return str;
192  }
193  catch(...)
194  {
195  std::cerr << "Failure reading USB data. Please install the udev rules available in the `udev` folder" << std::endl;
196  exit(-1);
197  }
198 
199  return std::string();
200 }