Apollo  6.0
Open source self driving car software
st_graph_data.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2017 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 
22 #pragma once
23 
24 #include <tuple>
25 #include <vector>
26 
27 #include "modules/common/proto/pnc_point.pb.h"
30 #include "modules/planning/proto/st_drivable_boundary.pb.h"
31 
32 namespace apollo {
33 namespace planning {
34 
35 constexpr double kObsSpeedIgnoreThreshold = 100.0;
36 
37 class StGraphData {
38  public:
39  StGraphData() = default;
40 
41  void LoadData(const std::vector<const STBoundary*>& st_boundaries,
42  const double min_s_on_st_boundaries,
43  const apollo::common::TrajectoryPoint& init_point,
44  const SpeedLimit& speed_limit, const double cruise_speed,
45  const double path_data_length, const double total_time_by_conf,
46  planning_internal::STGraphDebug* st_graph_debug);
47 
48  bool is_initialized() const { return init_; }
49 
50  const std::vector<const STBoundary*>& st_boundaries() const;
51 
52  double min_s_on_st_boundaries() const;
53 
54  const apollo::common::TrajectoryPoint& init_point() const;
55 
56  const SpeedLimit& speed_limit() const;
57 
58  double cruise_speed() const;
59 
60  double path_length() const;
61 
62  double total_time_by_conf() const;
63 
64  planning_internal::STGraphDebug* mutable_st_graph_debug();
65 
67  const std::vector<std::tuple<double, double, double>>& s_boundary,
68  const std::vector<std::tuple<double, double, double>>& v_obs_info);
69 
70  const STDrivableBoundary& st_drivable_boundary() const;
71 
72  private:
73  bool init_ = false;
74  std::vector<const STBoundary*> st_boundaries_;
75  double min_s_on_st_boundaries_ = 0.0;
76  apollo::common::TrajectoryPoint init_point_;
77  SpeedLimit speed_limit_;
78  double cruise_speed_ = 0.0;
79  double path_data_length_ = 0.0;
80  double path_length_by_conf_ = 0.0;
81  double total_time_by_conf_ = 0.0;
82  planning_internal::STGraphDebug* st_graph_debug_ = nullptr;
83 
84  STDrivableBoundary st_drivable_boundary_;
85 };
86 
87 } // namespace planning
88 } // namespace apollo
planning_internal::STGraphDebug * mutable_st_graph_debug()
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
const STDrivableBoundary & st_drivable_boundary() const
Planning module main class. It processes GPS and IMU as input, to generate planning info...
void LoadData(const std::vector< const STBoundary *> &st_boundaries, const double min_s_on_st_boundaries, const apollo::common::TrajectoryPoint &init_point, const SpeedLimit &speed_limit, const double cruise_speed, const double path_data_length, const double total_time_by_conf, planning_internal::STGraphDebug *st_graph_debug)
const apollo::common::TrajectoryPoint & init_point() const
constexpr double kObsSpeedIgnoreThreshold
Definition: st_graph_data.h:35
double min_s_on_st_boundaries() const
Definition: speed_limit.h:29
bool is_initialized() const
Definition: st_graph_data.h:48
double total_time_by_conf() const
const SpeedLimit & speed_limit() const
const std::vector< const STBoundary * > & st_boundaries() const
bool SetSTDrivableBoundary(const std::vector< std::tuple< double, double, double >> &s_boundary, const std::vector< std::tuple< double, double, double >> &v_obs_info)
Definition: st_graph_data.h:37