Apollo 10.0
自动驾驶开放平台
trajectory_analyzer.h
浏览该文件的文档.
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 <vector>
25
26#include "modules/common_msgs/basic_msgs/pnc_point.pb.h"
27#include "modules/common_msgs/planning_msgs/planning.pb.h"
28
32
37namespace apollo {
38namespace control {
39
45 public:
49 TrajectoryAnalyzer() = default;
50
57 const planning::ADCTrajectory *planning_published_trajectory);
58
63
68 unsigned int seq_num() { return seq_num_; }
69
77
85
94 const double y) const;
95
104 common::PathPoint QueryMatchedPathPoint(const double x, const double y) const;
105
119 void ToTrajectoryFrame(const double x, const double y, const double theta,
120 const double v, const common::PathPoint &matched_point,
121 double *ptr_s, double *ptr_s_dot, double *ptr_d,
122 double *ptr_d_dot) const;
123
130 void TrajectoryTransformToCOM(const double rear_to_com_distance);
131
141 const double rear_to_com_distance,
142 const common::PathPoint &path_point) const;
143
148 const std::vector<common::TrajectoryPoint> &trajectory_points() const;
149
150 protected:
151 std::vector<common::TrajectoryPoint> trajectory_points_;
152
153 double header_time_ = 0.0;
154 unsigned int seq_num_ = 0;
155
156 private:
157 common::PathPoint FindMinDistancePoint(const common::TrajectoryPoint &p0,
158 const common::TrajectoryPoint &p1,
159 const double x, const double y) const;
160};
161
162} // namespace control
163} // namespace apollo
The class of Box2d.
Implements a class of 2-dimensional vectors.
Definition vec2d.h:42
process point query and conversion related to trajectory
common::TrajectoryPoint QueryNearestPointByPosition(const double x, const double y) const
query a point of trajectory that its position is closest to the given position.
common::math::Vec2d ComputeCOMPosition(const double rear_to_com_distance, const common::PathPoint &path_point) const
Compute the position of center of mass(COM) of the vehicle, given the distance from rear wheels to th...
TrajectoryAnalyzer()=default
constructor
const std::vector< common::TrajectoryPoint > & trajectory_points() const
get all points of the trajectory
void TrajectoryTransformToCOM(const double rear_to_com_distance)
Transform the current trajectory points to the center of mass(COM) of the vehicle,...
common::PathPoint QueryMatchedPathPoint(const double x, const double y) const
query a point on trajectory that its position is closest to the given position.
common::TrajectoryPoint QueryNearestPointByAbsoluteTime(const double t) const
query a point of trajectory that its absolute time is closest to the give time.
void ToTrajectoryFrame(const double x, const double y, const double theta, const double v, const common::PathPoint &matched_point, double *ptr_s, double *ptr_s_dot, double *ptr_d, double *ptr_d_dot) const
convert a position with theta and speed to trajectory frame,
std::vector< common::TrajectoryPoint > trajectory_points_
~TrajectoryAnalyzer()=default
destructor
common::TrajectoryPoint QueryNearestPointByRelativeTime(const double t) const
query a point of trajectory that its relative time is closest to the give time.
unsigned int seq_num()
get sequence number of the trajectory
class register implement
Definition arena_queue.h:37
Defines the Vec2d class.