Apollo 10.0
自动驾驶开放平台
laneline_calibrator.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2018 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#pragma once
17
18#include <string>
19#include <vector>
20
24
25namespace apollo {
26namespace perception {
27namespace camera {
28
30 public:
31 LaneLineCalibrator() = default;
32
33 virtual ~LaneLineCalibrator() = default;
34
35 bool Init(
36 const CalibratorInitOptions &options = CalibratorInitOptions()) override;
37
38 // @brief: estimate camera-ground plane pitch.
39 // @param [in]: options
40 // @param [in/out]: pitch_angle
41 bool Calibrate(const CalibratorOptions &options, float *pitch_angle) override;
42
43 std::string Name() const override { return "LaneLineCalibrator"; }
44
45 inline float GetTimeDiff() const { return time_diff_; }
46 inline float GetYawRate() const { return yaw_rate_; }
47 inline float GetVelocity() const { return velocity_; }
48 inline float GetVanishingRow() const {
49 return calibrator_.get_vanishing_row();
50 }
51
52 private:
53 // @brief: load ego lane line from camera frame
54 // @param [in]: lane_objects
55 // @param [out]: ego_lane
56 bool LoadEgoLaneline(const std::vector<base::LaneLine> &lane_objects,
57 EgoLane *ego_lane);
58
59 private:
60 int image_width_ = 0;
61 int image_height_ = 0;
62 double cam_coord_pre_pre_[3] = {0.0f};
63 double cam_coord_pre_[3] = {0.0f};
64 double cam_coord_cur_[3] = {0.0f};
65 double timestamp_pre_ = 0.0f;
66 double timestamp_cur_ = 0.0f;
67 bool is_first_frame_ = true;
68 float time_diff_ = kTimeDiffDefault;
69 float yaw_rate_ = kYawRateDefault;
70 float velocity_ = kVelocityDefault;
71 LaneBasedCalibrator calibrator_;
72};
73
74} // namespace camera
75} // namespace perception
76} // namespace apollo
bool Init(const CalibratorInitOptions &options=CalibratorInitOptions()) override
bool Calibrate(const CalibratorOptions &options, float *pitch_angle) override
class register implement
Definition arena_queue.h:37