hfl_driver  0.0.20
ROS driver for Continental's HFL110 3D Flash Lidar
base_hfl110dcu.h
Go to the documentation of this file.
1 // Copyright 2020 Continental AG
2 // All rights reserved.
3 //
4 // Software License Agreement (BSD 2-Clause Simplified License)
5 //
6 // Redistribution and use in source and binary forms, with or without
7 // modification, are permitted provided that the following conditions
8 // are met:
9 //
10 // * Redistributions of source code must retain the above copyright
11 // notice, this list of conditions and the following disclaimer.
12 // * Redistributions in binary form must reproduce the above
13 // copyright notice, this list of conditions and the following
14 // disclaimer in the documentation and/or other materials provided
15 // with the distribution.
16 //
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21 // COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
27 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 // POSSIBILITY OF SUCH DAMAGE.
29 
30 
36 #ifndef BASE_HFL110DCU_H_
37 #define BASE_HFL110DCU_H_
38 #include <hfl_interface.h>
39 #include <string>
40 #include <vector>
41 
42 namespace hfl
43 {
45 const uint16_t FRAME_ROWS{ 32 };
47 const uint16_t FRAME_COLUMNS{ 128 };
49 const uint16_t PIXEL_RETURNS{ 1 };
51 const uint16_t PIXEL_SLICES{ 128 };
53 const uint32_t WORDS_PER_PACKET{ 0x168 };
55 const uint8_t INTENSITY_BITS{ 5 };
57 const uint8_t RANGE_BITS{ 8 };
59 const uint8_t RANGE_PRECISION_BITS{ 6 };
61 const uint8_t INTENSITY_PUBLISH_BITS{ 12 };
63 const char FRAME_ID[] = "hfl110dcu";
65 const char CAMERA_INTRINSICS[] = "min000000";
67 const uint32_t EXPECTED_ADDRESS{ 0xffffffff };
68 
73 {
74 public:
82  bool setFrameRate(double rate) override
83  {
84  return false;
85  }
86 
92  double getFrameRate(bool reg_format = false) const
93  {
94  return 25.0;
95  };
96 
104  bool setGlobalRangeOffset(double offset);
105 
114  bool setChannelRangeOffset(uint8_t ch, double offset);
115 
124  virtual bool setIntensityRangeOffset(uint8_t band, double offset);
125 
126 protected:
129 
132 
134  std::function<void(const std::vector<uint8_t>&)> udp_send_function_;
135 
138  {
139  mem_ri = 0,
140  types_size
141  };
142 
152  bool getConfiguration(std::string model, std::string version);
153 
161  virtual bool parseObjects(int start_byte, const std::vector<uint8_t>& packet) = 0;
162 
170  virtual bool processObjectData(const std::vector<uint8_t>& data) = 0;
171 };
172 } // namespace hfl
173 
174 #endif // BASE_HFL110DCU_H_
Base class for the HFL110DCU cameras.
Definition: base_hfl110dcu.h:73
virtual bool parseObjects(int start_byte, const std::vector< uint8_t > &packet)=0
bool setGlobalRangeOffset(double offset)
Definition: base_hfl110dcu.cpp:78
double range_magic_number_
Range Magic Number.
Definition: base_hfl110dcu.h:128
HFL110DCU_memory_types
HFL110DCU camera memory_types.
Definition: base_hfl110dcu.h:138
@ types_size
Definition: base_hfl110dcu.h:140
@ mem_ri
Definition: base_hfl110dcu.h:139
bool setFrameRate(double rate) override
Definition: base_hfl110dcu.h:82
virtual bool setIntensityRangeOffset(uint8_t band, double offset)
Definition: base_hfl110dcu.cpp:112
bool getConfiguration(std::string model, std::string version)
Definition: base_hfl110dcu.cpp:42
double getFrameRate(bool reg_format=false) const
Definition: base_hfl110dcu.h:92
Attribs_map mode_parameters
Current mode parameters.
Definition: base_hfl110dcu.h:131
bool setChannelRangeOffset(uint8_t ch, double offset)
Definition: base_hfl110dcu.cpp:88
virtual bool processObjectData(const std::vector< uint8_t > &data)=0
std::function< void(const std::vector< uint8_t > &)> udp_send_function_
UDP sender function.
Definition: base_hfl110dcu.h:134
Base class for all of the HFL cameras.
Definition: hfl_interface.h:96
This file defines the HFL camera's interface class.
Definition: camera_commander.h:56
std::map< std::string, float > Attribs_map
Mode parameters map.
Definition: hfl_configs.h:50
const uint16_t PIXEL_SLICES
Default frame cols.
Definition: base_hfl110dcu.h:51
const uint8_t RANGE_PRECISION_BITS
Default bits used for range presicion.
Definition: base_hfl110dcu.h:59
const char CAMERA_INTRINSICS[]
Default camera intrinsics.
Definition: base_hfl110dcu.h:65
const uint32_t WORDS_PER_PACKET
Default words per UDP packet.
Definition: base_hfl110dcu.h:53
const uint32_t EXPECTED_ADDRESS
Default expected memory address.
Definition: base_hfl110dcu.h:67
const uint8_t INTENSITY_PUBLISH_BITS
Default bits used for intensity publishing.
Definition: base_hfl110dcu.h:61
const char FRAME_ID[]
Default frame ID.
Definition: base_hfl110dcu.h:63
const uint8_t INTENSITY_BITS
Default bits used for intensity.
Definition: base_hfl110dcu.h:55
const uint16_t FRAME_ROWS
Default frame rows.
Definition: base_hfl110dcu.h:45
const uint8_t RANGE_BITS
Default bits used for range.
Definition: base_hfl110dcu.h:57
const uint16_t PIXEL_RETURNS
Default frame cols.
Definition: base_hfl110dcu.h:49
const uint16_t FRAME_COLUMNS
Default frame cols.
Definition: base_hfl110dcu.h:47