Apollo  6.0
Open source self driving car software
trajectory_stitcher.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 
21 #pragma once
22 
23 #include <string>
24 #include <utility>
25 #include <vector>
26 
27 #include "modules/common/proto/pnc_point.pb.h"
28 #include "modules/common/vehicle_state/proto/vehicle_state.pb.h"
31 
32 namespace apollo {
33 namespace planning {
34 
36  public:
37  TrajectoryStitcher() = delete;
38 
40  const double x_diff, const double y_diff, const double theta_diff,
41  PublishableTrajectory* prev_trajectory);
42 
43  static std::vector<common::TrajectoryPoint> ComputeStitchingTrajectory(
44  const common::VehicleState& vehicle_state, const double current_timestamp,
45  const double planning_cycle_time, const size_t preserved_points_num,
46  const bool replan_by_offset, const PublishableTrajectory* prev_trajectory,
47  std::string* replan_reason);
48 
49  static std::vector<common::TrajectoryPoint> ComputeReinitStitchingTrajectory(
50  const double planning_cycle_time,
51  const common::VehicleState& vehicle_state);
52 
53  private:
54  static std::pair<double, double> ComputePositionProjection(
55  const double x, const double y,
56  const common::TrajectoryPoint& matched_trajectory_point);
57 
58  static common::TrajectoryPoint ComputeTrajectoryPointFromVehicleState(
59  const double planning_cycle_time,
60  const common::VehicleState& vehicle_state);
61 };
62 
63 } // namespace planning
64 } // namespace apollo
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Planning module main class. It processes GPS and IMU as input, to generate planning info...
static std::vector< common::TrajectoryPoint > ComputeStitchingTrajectory(const common::VehicleState &vehicle_state, const double current_timestamp, const double planning_cycle_time, const size_t preserved_points_num, const bool replan_by_offset, const PublishableTrajectory *prev_trajectory, std::string *replan_reason)
Definition: publishable_trajectory.h:29
static std::vector< common::TrajectoryPoint > ComputeReinitStitchingTrajectory(const double planning_cycle_time, const common::VehicleState &vehicle_state)
Definition: trajectory_stitcher.h:35
static void TransformLastPublishedTrajectory(const double x_diff, const double y_diff, const double theta_diff, PublishableTrajectory *prev_trajectory)