Apollo  6.0
Open source self driving car software
lattice_trajectory1d.h
Go to the documentation of this file.
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 
21 #pragma once
22 
23 #include <memory>
24 #include <string>
25 
27 
28 namespace apollo {
29 namespace planning {
30 
31 class LatticeTrajectory1d : public Curve1d {
32  public:
33  explicit LatticeTrajectory1d(std::shared_ptr<Curve1d> ptr_trajectory1d);
34 
35  virtual ~LatticeTrajectory1d() = default;
36 
37  virtual double Evaluate(const std::uint32_t order, const double param) const;
38 
39  virtual double ParamLength() const;
40 
41  virtual std::string ToString() const;
42 
43  bool has_target_position() const;
44 
45  bool has_target_velocity() const;
46 
47  bool has_target_time() const;
48 
49  double target_position() const;
50 
51  double target_velocity() const;
52 
53  double target_time() const;
54 
55  void set_target_position(double target_position);
56 
57  void set_target_velocity(double target_velocity);
58 
59  void set_target_time(double target_time);
60 
61  private:
62  std::shared_ptr<Curve1d> ptr_trajectory1d_;
63 
64  double target_position_ = 0.0;
65 
66  double target_velocity_ = 0.0;
67 
68  double target_time_ = 0.0;
69 
70  bool has_target_position_ = false;
71 
72  bool has_target_velocity_ = false;
73 
74  bool has_target_time_ = false;
75 };
76 
77 } // namespace planning
78 } // namespace apollo
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Definition: curve1d.h:30
Planning module main class. It processes GPS and IMU as input, to generate planning info...
LatticeTrajectory1d(std::shared_ptr< Curve1d > ptr_trajectory1d)
virtual double Evaluate(const std::uint32_t order, const double param) const
virtual std::string ToString() const
void set_target_velocity(double target_velocity)
Definition: lattice_trajectory1d.h:31
void set_target_time(double target_time)
void set_target_position(double target_position)
virtual double ParamLength() const