Apollo 11.0
自动驾驶开放平台
apollo::planning::ReferencePoint类 参考

#include <reference_point.h>

类 apollo::planning::ReferencePoint 继承关系图:
apollo::planning::ReferencePoint 的协作图:

Public 成员函数

 ReferencePoint ()=default
 
 ReferencePoint (const MapPathPoint &map_path_point, const double kappa, const double dkappa)
 
common::PathPoint ToPathPoint (double s) const
 
double kappa () const
 
double dkappa () const
 
std::string DebugString () const
 
- Public 成员函数 继承自 apollo::hdmap::MapPathPoint
 MapPathPoint ()=default
 
 MapPathPoint (const common::math::Vec2d &point, double heading)
 
 MapPathPoint (const common::math::Vec2d &point, double heading, LaneWaypoint lane_waypoint)
 
 MapPathPoint (const common::math::Vec2d &point, double heading, std::vector< LaneWaypoint > lane_waypoints)
 
double heading () const
 
void set_heading (const double heading)
 
const std::vector< LaneWaypoint > & lane_waypoints () const
 
void add_lane_waypoint (LaneWaypoint lane_waypoint)
 
void add_lane_waypoints (const std::vector< LaneWaypoint > &lane_waypoints)
 
void clear_lane_waypoints ()
 
std::string DebugString () const
 
- Public 成员函数 继承自 apollo::common::math::Vec2d
constexpr Vec2d (const double x, const double y) noexcept
 Constructor which takes x- and y-coordinates.
 
constexpr Vec2d () noexcept
 Constructor returning the zero vector.
 
double x () const
 Getter for x component
 
double y () const
 Getter for y component
 
void set_x (const double x)
 Setter for x component
 
void set_y (const double y)
 Setter for y component
 
double Length () const
 Gets the length of the vector
 
double LengthSquare () const
 Gets the squared length of the vector
 
double Angle () const
 Gets the angle between the vector and the positive x semi-axis
 
void Normalize ()
 Returns the unit vector that is co-linear with this vector
 
double DistanceTo (const Vec2d &other) const
 Returns the distance to the given vector
 
double DistanceSquareTo (const Vec2d &other) const
 Returns the squared distance to the given vector
 
double CrossProd (const Vec2d &other) const
 Returns the "cross" product between these two Vec2d (non-standard).
 
double InnerProd (const Vec2d &other) const
 Returns the inner product between these two Vec2d.
 
Vec2d rotate (const double angle) const
 rotate the vector by angle.
 
void SelfRotate (const double angle)
 rotate the vector itself by angle.
 
Vec2d operator+ (const Vec2d &other) const
 Sums two Vec2d
 
Vec2d operator- (const Vec2d &other) const
 Subtracts two Vec2d
 
Vec2d operator* (const double ratio) const
 Multiplies Vec2d by a scalar
 
Vec2d operator/ (const double ratio) const
 Divides Vec2d by a scalar
 
Vec2doperator+= (const Vec2d &other)
 Sums another Vec2d to the current one
 
Vec2doperator-= (const Vec2d &other)
 Subtracts another Vec2d to the current one
 
Vec2doperator*= (const double ratio)
 Multiplies this Vec2d by a scalar
 
Vec2doperator/= (const double ratio)
 Divides this Vec2d by a scalar
 
bool operator== (const Vec2d &other) const
 Compares two Vec2d
 
std::string DebugString () const
 Returns a human-readable string representing this object
 

静态 Public 成员函数

static void RemoveDuplicates (std::vector< ReferencePoint > *points)
 
- 静态 Public 成员函数 继承自 apollo::hdmap::MapPathPoint
static void RemoveDuplicates (std::vector< MapPathPoint > *points)
 
static std::vector< MapPathPointGetPointsFromSegment (const LaneSegment &segment)
 
static std::vector< MapPathPointGetPointsFromLane (LaneInfoConstPtr lane, const double start_s, const double end_s)
 
- 静态 Public 成员函数 继承自 apollo::common::math::Vec2d
static Vec2d CreateUnitVec2d (const double angle)
 Creates a unit-vector with a given angle to the positive x semi-axis
 

额外继承的成员函数

- Protected 属性 继承自 apollo::hdmap::MapPathPoint
double heading_ = 0.0
 
std::vector< LaneWaypointlane_waypoints_
 
- Protected 属性 继承自 apollo::common::math::Vec2d
double x_ = 0.0
 
double y_ = 0.0
 

详细描述

在文件 reference_point.h33 行定义.

构造及析构函数说明

◆ ReferencePoint() [1/2]

apollo::planning::ReferencePoint::ReferencePoint ( )
default

◆ ReferencePoint() [2/2]

apollo::planning::ReferencePoint::ReferencePoint ( const MapPathPoint map_path_point,
const double  kappa,
const double  dkappa 
)

在文件 reference_point.cc34 行定义.

36 : hdmap::MapPathPoint(map_path_point), kappa_(kappa), dkappa_(dkappa) {}

成员函数说明

◆ DebugString()

std::string apollo::planning::ReferencePoint::DebugString ( ) const

在文件 reference_point.cc47 行定义.

47 {
48 return absl::StrCat("{x: ", x(), ", y: ", y(), ", theta: ", heading(),
49 ", kappa: ", kappa(), ", dkappa: ", dkappa(), "}");
50}
double y() const
Getter for y component
Definition vec2d.h:57
double x() const
Getter for x component
Definition vec2d.h:54
double heading() const
Definition path.h:118

◆ dkappa()

double apollo::planning::ReferencePoint::dkappa ( ) const

在文件 reference_point.cc45 行定义.

45{ return dkappa_; }

◆ kappa()

double apollo::planning::ReferencePoint::kappa ( ) const

在文件 reference_point.cc43 行定义.

43{ return kappa_; }

◆ RemoveDuplicates()

void apollo::planning::ReferencePoint::RemoveDuplicates ( std::vector< ReferencePoint > *  points)
static

在文件 reference_point.cc52 行定义.

52 {
53 CHECK_NOTNULL(points);
54 int count = 0;
55 for (size_t i = 0; i < points->size(); ++i) {
56 auto& last_point = (*points)[count - 1];
57 const auto& this_point = (*points)[i];
58 // Use manhattan distance for save computation time.
59 if (count == 0 ||
60 std::abs(last_point.x() - this_point.x()) > kDuplicatedPointsEpsilon ||
61 std::abs(last_point.y() - this_point.y()) > kDuplicatedPointsEpsilon) {
62 (*points)[count++] = this_point;
63 } else {
64 last_point.add_lane_waypoints(this_point.lane_waypoints());
65 }
66 }
67 points->resize(count);
68}

◆ ToPathPoint()

common::PathPoint apollo::planning::ReferencePoint::ToPathPoint ( double  s) const

在文件 reference_point.cc38 行定义.

38 {
40 kappa_, dkappa_);
41}
static PathPoint ToPathPoint(const double x, const double y, const double z=0, const double s=0, const double theta=0, const double kappa=0, const double dkappa=0, const double ddkappa=0)

该类的文档由以下文件生成: