Apollo  6.0
Open source self driving car software
smartereye_handler.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2020 The Apollo Authors. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *****************************************************************************/
16 
17 #pragma once
18 
19 #include <functional>
20 #include <iostream>
21 #include <string>
22 
23 #include "cyber/cyber.h"
24 #include "third_party/camera_library/smartereye/include/calibrationparams.h"
25 #include "third_party/camera_library/smartereye/include/camerahandler.h"
26 #include "third_party/camera_library/smartereye/include/rotationmatrix.h"
27 
28 namespace apollo {
29 namespace drivers {
30 namespace smartereye {
31 
32 typedef std::function<bool(RawImageFrame *rawFrame)> CallbackFunc;
33 
34 class SmartereyeHandler : public CameraHandler {
35  public:
36  explicit SmartereyeHandler(std::string name);
38  void handleRawFrame(const RawImageFrame *rawFrame);
39  bool SetCallback(CallbackFunc ptr);
40  void handleUpdateFinished(Result result) {}
41 
42  protected:
43  void handleDisparityPointByPoint(unsigned char *image, int width, int height,
44  int bitNum) {}
45  void handleDisparityByLookupTable(unsigned char *image, int width, int height,
46  int bitNum) {}
47 
48  private:
49  std::string mName = nullptr;
50  CallbackFunc pCallbackFunc = nullptr;
51 };
52 
53 } // namespace smartereye
54 } // namespace drivers
55 } // namespace apollo
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
void handleDisparityByLookupTable(unsigned char *image, int width, int height, int bitNum)
Definition: smartereye_handler.h:45
Definition: smartereye_handler.h:34
void handleUpdateFinished(Result result)
Definition: smartereye_handler.h:40
std::function< bool(RawImageFrame *rawFrame)> CallbackFunc
Definition: smartereye_handler.h:32
void handleRawFrame(const RawImageFrame *rawFrame)
void handleDisparityPointByPoint(unsigned char *image, int width, int height, int bitNum)
Definition: smartereye_handler.h:43