Autoware.Auto
camera_settings.hpp
Go to the documentation of this file.
1 // Copyright 2020 Apex.AI, Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //    http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef SPINNAKER_CAMERA_DRIVER__CAMERA_SETTINGS_HPP_
16 #define SPINNAKER_CAMERA_DRIVER__CAMERA_SETTINGS_HPP_
17 
18 #include <common/types.hpp>
20 
21 #include <string>
22 #include <set>
23 #include <stdexcept>
24 
25 namespace autoware
26 {
27 namespace drivers
28 {
29 namespace camera
30 {
31 namespace spinnaker
32 {
33 
35 class SPINNAKER_CAMERA_PUBLIC CameraSettings
36 {
37 public:
38  static const char * kPixelFormatStr_RGGB8;
39  static const char * kPixelFormatStr_GRBG8;
40  static const char * kPixelFormatStr_GBRG8;
41  static const char * kPixelFormatStr_BGGR8;
42  static const char * kPixelFormatStr_RGB8;
43  static const char * kPixelFormatStr_BGR8;
44  static const char * kPixelFormatStr_MONO8;
45  static const char * kPixelFormatStr_UNKNOWN;
46 
48  explicit CameraSettings(
49  std::uint32_t window_width,
50  std::uint32_t window_height,
52  const std::string & pixel_format,
53  const std::string & frame_id = "camera",
54  const std::string & serial_number = "",
55  std::int64_t device_link_throughput_limit = 100000000L);
56 
57  inline std::uint32_t get_window_width() const noexcept {return m_window_width;}
58  inline std::uint32_t get_window_height() const noexcept {return m_window_height;}
59  inline const std::string & get_pixel_format() const noexcept {return m_pixel_format;}
60  inline const std::string & get_frame_id() const noexcept {return m_frame_id;}
61  inline const std::string & get_serial_number() const noexcept {return m_serial_number;}
62  inline common::types::float64_t get_fps() const noexcept {return m_fps;}
63  inline std::int64_t get_device_link_throughput_limit() const noexcept
64  {
65  return m_device_link_throughput_limit;
66  }
67 
68 private:
70  static const std::set<std::string> kValidPixelFormats;
71 
73  std::uint32_t m_window_width;
75  std::uint32_t m_window_height;
76 
78  std::string m_pixel_format;
79 
81  std::string m_frame_id;
82 
84  std::string m_serial_number;
85 
88 
90  std::int64_t m_device_link_throughput_limit;
91 };
92 
93 } // namespace spinnaker
94 } // namespace camera
95 } // namespace drivers
96 } // namespace autoware
97 
98 
99 #endif // SPINNAKER_CAMERA_DRIVER__CAMERA_SETTINGS_HPP_
double float64_t
Definition: types.hpp:37
const std::string & get_frame_id() const noexcept
Definition: camera_settings.hpp:60
std::uint32_t get_window_width() const noexcept
Definition: camera_settings.hpp:57
const std::string & get_pixel_format() const noexcept
Definition: camera_settings.hpp:59
static const char * kPixelFormatStr_GBRG8
Definition: camera_settings.hpp:40
This file includes common type definition.
static const char * kPixelFormatStr_BGGR8
Definition: camera_settings.hpp:41
std::int64_t get_device_link_throughput_limit() const noexcept
Definition: camera_settings.hpp:63
Encapsulate settings that make sense to pass to a camera.
Definition: camera_settings.hpp:35
static const char * kPixelFormatStr_UNKNOWN
Definition: camera_settings.hpp:45
static const char * kPixelFormatStr_RGB8
Definition: camera_settings.hpp:42
static const char * kPixelFormatStr_MONO8
Definition: camera_settings.hpp:44
std::uint32_t get_window_height() const noexcept
Definition: camera_settings.hpp:58
common::types::float64_t get_fps() const noexcept
Definition: camera_settings.hpp:62
static const char * kPixelFormatStr_BGR8
Definition: camera_settings.hpp:43
static const char * kPixelFormatStr_GRBG8
Definition: camera_settings.hpp:39
static const char * kPixelFormatStr_RGGB8
Definition: camera_settings.hpp:38
const std::string & get_serial_number() const noexcept
Definition: camera_settings.hpp:61
This file defines the lanelet2_map_provider_node class.
Definition: quick_sort.hpp:24