parameters.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "ensenso_camera_msgs/Parameter.h"
4 
5 #include <map>
6 #include <string>
7 #include <tuple>
8 #include <utility>
9 #include <vector>
10 
11 #include "nxLib.h"
12 
16 enum class ParameterType
17 {
18  Bool,
19  Number, // Used for integers and floats.
20  String
21 };
22 
24 {
26 
27  // The path to the corresponding NxLib node, relative to the camera's parameter node.
28  std::vector<std::string> path;
29 
33  NxLibItem node(NxLibItem const& cameraNode)
34  {
35  auto node = cameraNode[itmParameters];
36  for (auto const& pathElement : path)
37  {
38  node = node[pathElement];
39  }
40 
41  return node;
42  }
43 };
44 
52 std::map<std::string, ParameterMapping> const parameterInformation{ //NOLINT
53  // Capture parameters.
54  { ensenso_camera_msgs::Parameter::AUTO_EXPOSURE, { ParameterType::Bool, { itmCapture, itmAutoExposure } } },
55  { ensenso_camera_msgs::Parameter::AUTO_GAIN, { ParameterType::Bool, { itmCapture, itmAutoGain } } },
56  { ensenso_camera_msgs::Parameter::BINNING, { ParameterType::Number, { itmCapture, itmBinning } } },
57  { ensenso_camera_msgs::Parameter::EXPOSURE, { ParameterType::Number, { itmCapture, itmExposure } } },
58  { ensenso_camera_msgs::Parameter::FRONT_LIGHT, { ParameterType::Bool, { itmCapture, itmFrontLight } } },
59  { ensenso_camera_msgs::Parameter::GAIN, { ParameterType::Number, { itmCapture, itmGain } } },
60  { ensenso_camera_msgs::Parameter::GAIN_BOOST, { ParameterType::Bool, { itmCapture, itmGainBoost } } },
61  { ensenso_camera_msgs::Parameter::HARDWARE_GAMMA, { ParameterType::Bool, { itmCapture, itmHardwareGamma } } },
62  { ensenso_camera_msgs::Parameter::MAX_GAIN, { ParameterType::Number, { itmCapture, itmMaxGain } } },
63  { ensenso_camera_msgs::Parameter::PIXEL_CLOCK, { ParameterType::Number, { itmCapture, itmPixelClock } } },
64  { ensenso_camera_msgs::Parameter::PROJECTOR, { ParameterType::Bool, { itmCapture, itmProjector } } },
65  { ensenso_camera_msgs::Parameter::TARGET_BRIGHTNESS, { ParameterType::Number, { itmCapture, itmTargetBrightness } } },
66  { ensenso_camera_msgs::Parameter::TRIGGER_DELAY, { ParameterType::Number, { itmCapture, itmTriggerDelay } } },
67  { ensenso_camera_msgs::Parameter::TRIGGER_MODE, { ParameterType::String, { itmCapture, itmTriggerMode } } },
68 
69  // Matching parameters.
70  { ensenso_camera_msgs::Parameter::MATCHING_METHOD,
71  { ParameterType::String, { itmDisparityMap, itmStereoMatching, itmMethod } } },
72  { ensenso_camera_msgs::Parameter::MINIMUM_DISPARITY,
73  { ParameterType::Number, { itmDisparityMap, itmStereoMatching, itmMinimumDisparity } } },
74  { ensenso_camera_msgs::Parameter::NUMBER_OF_DISPARITIES,
75  { ParameterType::Number, { itmDisparityMap, itmStereoMatching, itmNumberOfDisparities } } },
76  { ensenso_camera_msgs::Parameter::MEASUREMENT_VOLUME_NEAR,
77  { ParameterType::Number, { itmDisparityMap, itmMeasurementVolume, itmNear, itmLeftBottom, "\2" } } },
78  { ensenso_camera_msgs::Parameter::MEASUREMENT_VOLUME_FAR,
79  { ParameterType::Number, { itmDisparityMap, itmMeasurementVolume, itmFar, itmLeftBottom, "\2" } } },
80  { ensenso_camera_msgs::Parameter::UNIQUENESS_RATIO,
81  { ParameterType::Number, { itmDisparityMap, itmPostProcessing, itmUniquenessRatio } } },
82  { ensenso_camera_msgs::Parameter::SCALING, { ParameterType::Number, { itmDisparityMap, itmScaling } } },
83  { ensenso_camera_msgs::Parameter::PADDING,
84  { ParameterType::Bool, { itmDisparityMap, itmStereoMatching, itmPadding } } },
85 };
86 
87 inline bool parameterExists(std::string const& key)
88 {
89  return parameterInformation.count(key) > 0;
90 }
bool parameterExists(std::string const &key)
Definition: parameters.h:87
ParameterType
Definition: parameters.h:16
std::map< std::string, ParameterMapping > const parameterInformation
Definition: parameters.h:52
NxLibItem node(NxLibItem const &cameraNode)
Definition: parameters.h:33
std::vector< std::string > path
Definition: parameters.h:28
ParameterType type
Definition: parameters.h:25


ensenso_camera
Author(s): Ensenso
autogenerated on Thu May 6 2021 02:50:06