@@ -16,24 +16,24 @@ namespace FreenectDriver
1616 class DepthStream : public VideoStream
1717 {
1818 public:
19+ static constexpr OniSensorType SENSOR_TYPE = ONI_SENSOR_DEPTH;
1920 // from NUI library and converted to radians
20- static const float DIAGONAL_FOV = 70 * (M_PI / 180 );
21- static const float HORIZONTAL_FOV = 58.5 * (M_PI / 180 );
22- static const float VERTICAL_FOV = 45.6 * (M_PI / 180 );
21+ static constexpr float DIAGONAL_FOV = 70 * (M_PI / 180 );
22+ static constexpr float HORIZONTAL_FOV = 58.5 * (M_PI / 180 );
23+ static constexpr float VERTICAL_FOV = 45.6 * (M_PI / 180 );
2324 // from DepthKinectStream.cpp
24- static const int MAX_VALUE = 10000 ;
25- static const unsigned long long GAIN_VAL = 42 ;
26- static const unsigned long long CONST_SHIFT_VAL = 200 ;
27- static const unsigned long long MAX_SHIFT_VAL = 2047 ;
28- static const unsigned long long PARAM_COEFF_VAL = 4 ;
29- static const unsigned long long SHIFT_SCALE_VAL = 10 ;
30- static const unsigned long long ZERO_PLANE_DISTANCE_VAL = 120 ;
31- static const double ZERO_PLANE_PIXEL_SIZE_VAL = 0.10520000010728836 ;
32- static const double EMITTER_DCMOS_DISTANCE_VAL = 7.5 ;
25+ static constexpr int MAX_VALUE = 10000 ;
26+ static constexpr unsigned long long GAIN_VAL = 42 ;
27+ static constexpr unsigned long long CONST_SHIFT_VAL = 200 ;
28+ static constexpr unsigned long long MAX_SHIFT_VAL = 2047 ;
29+ static constexpr unsigned long long PARAM_COEFF_VAL = 4 ;
30+ static constexpr unsigned long long SHIFT_SCALE_VAL = 10 ;
31+ static constexpr unsigned long long ZERO_PLANE_DISTANCE_VAL = 120 ;
32+ static constexpr double ZERO_PLANE_PIXEL_SIZE_VAL = 0.10520000010728836 ;
33+ static constexpr double EMITTER_DCMOS_DISTANCE_VAL = 7.5 ;
3334
3435 private:
3536 typedef std::map< OniVideoMode, std::pair<freenect_depth_format, freenect_resolution> > FreenectDepthModeMap;
36- static const OniSensorType sensor_type = ONI_SENSOR_DEPTH;
3737 OniImageRegistrationMode image_registration_mode;
3838
3939 static FreenectDepthModeMap getSupportedVideoModes ();
@@ -49,7 +49,7 @@ namespace FreenectDriver
4949 FreenectDepthModeMap supported_modes = getSupportedVideoModes ();
5050 OniVideoMode* modes = new OniVideoMode[supported_modes.size ()];
5151 std::transform (supported_modes.begin (), supported_modes.end (), modes, ExtractKey ());
52- OniSensorInfo sensors = { sensor_type , static_cast <int >(supported_modes.size ()), modes };
52+ OniSensorInfo sensors = { SENSOR_TYPE , static_cast <int >(supported_modes.size ()), modes };
5353 return sensors;
5454 }
5555
0 commit comments