Apollo 10.0
自动驾驶开放平台
apollo::hdmap::MapPathPoint类 参考

#include <path.h>

类 apollo::hdmap::MapPathPoint 继承关系图:
apollo::hdmap::MapPathPoint 的协作图:

Public 成员函数

 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< 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 属性

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

详细描述

在文件 path.h102 行定义.

构造及析构函数说明

◆ MapPathPoint() [1/4]

apollo::hdmap::MapPathPoint::MapPathPoint ( )
default

◆ MapPathPoint() [2/4]

apollo::hdmap::MapPathPoint::MapPathPoint ( const common::math::Vec2d point,
double  heading 
)
inline

在文件 path.h105 行定义.

106 : Vec2d(point.x(), point.y()), heading_(heading) {}
constexpr Vec2d() noexcept
Constructor returning the zero vector.
Definition vec2d.h:48
double heading() const
Definition path.h:118

◆ MapPathPoint() [3/4]

apollo::hdmap::MapPathPoint::MapPathPoint ( const common::math::Vec2d point,
double  heading,
LaneWaypoint  lane_waypoint 
)
inline

在文件 path.h107 行定义.

109 : Vec2d(point.x(), point.y()), heading_(heading) {
110 lane_waypoints_.emplace_back(std::move(lane_waypoint));
111 }
std::vector< LaneWaypoint > lane_waypoints_
Definition path.h:148

◆ MapPathPoint() [4/4]

apollo::hdmap::MapPathPoint::MapPathPoint ( const common::math::Vec2d point,
double  heading,
std::vector< LaneWaypoint lane_waypoints 
)
inline

在文件 path.h112 行定义.

114 : Vec2d(point.x(), point.y()),
116 lane_waypoints_(std::move(lane_waypoints)) {}
const std::vector< LaneWaypoint > & lane_waypoints() const
Definition path.h:121

成员函数说明

◆ add_lane_waypoint()

void apollo::hdmap::MapPathPoint::add_lane_waypoint ( LaneWaypoint  lane_waypoint)
inline

在文件 path.h125 行定义.

125 {
126 lane_waypoints_.emplace_back(std::move(lane_waypoint));
127 }

◆ add_lane_waypoints()

void apollo::hdmap::MapPathPoint::add_lane_waypoints ( const std::vector< LaneWaypoint > &  lane_waypoints)
inline

在文件 path.h128 行定义.

128 {
129 lane_waypoints_.insert(lane_waypoints_.end(), lane_waypoints.begin(),
130 lane_waypoints.end());
131 }

◆ clear_lane_waypoints()

void apollo::hdmap::MapPathPoint::clear_lane_waypoints ( )
inline

在文件 path.h133 行定义.

133{ lane_waypoints_.clear(); }

◆ DebugString()

std::string apollo::hdmap::MapPathPoint::DebugString ( ) const

在文件 path.cc258 行定义.

258 {
259 return absl::StrCat(
260 "x = ", x_, " y = ", y_, " heading = ", heading_,
261 " lwp = "
262 "{(",
263 absl::StrJoin(lane_waypoints_, "), (", DebugStringFormatter()), ")}");
264}

◆ GetPointsFromLane()

std::vector< MapPathPoint > apollo::hdmap::MapPathPoint::GetPointsFromLane ( LaneInfoConstPtr  lane,
const double  start_s,
const double  end_s 
)
static

在文件 path.cc206 行定义.

208 {
209 std::vector<MapPathPoint> points;
210 if (start_s >= end_s) {
211 return points;
212 }
213 double accumulate_s = 0.0;
214 for (size_t i = 0; i < lane->points().size(); ++i) {
215 if (accumulate_s >= start_s && accumulate_s <= end_s) {
216 points.emplace_back(lane->points()[i], lane->headings()[i],
217 LaneWaypoint(lane, accumulate_s));
218 }
219 if (i < lane->segments().size()) {
220 const auto& segment = lane->segments()[i];
221 const double next_accumulate_s = accumulate_s + segment.length();
222 if (start_s > accumulate_s && start_s < next_accumulate_s) {
223 points.emplace_back(segment.start() + segment.unit_direction() *
224 (start_s - accumulate_s),
225 lane->headings()[i], LaneWaypoint(lane, start_s));
226 }
227 if (end_s > accumulate_s && end_s < next_accumulate_s) {
228 points.emplace_back(
229 segment.start() + segment.unit_direction() * (end_s - accumulate_s),
230 lane->headings()[i], LaneWaypoint(lane, end_s));
231 }
232 accumulate_s = next_accumulate_s;
233 }
234 if (accumulate_s > end_s) {
235 break;
236 }
237 }
238 return points;
239}

◆ GetPointsFromSegment()

std::vector< MapPathPoint > apollo::hdmap::MapPathPoint::GetPointsFromSegment ( const LaneSegment segment)
static

在文件 path.cc201 行定义.

202 {
203 return GetPointsFromLane(segment.lane, segment.start_s, segment.end_s);
204}
static std::vector< MapPathPoint > GetPointsFromLane(LaneInfoConstPtr lane, const double start_s, const double end_s)
Definition path.cc:206

◆ heading()

double apollo::hdmap::MapPathPoint::heading ( ) const
inline

在文件 path.h118 行定义.

118{ return heading_; }

◆ lane_waypoints()

const std::vector< LaneWaypoint > & apollo::hdmap::MapPathPoint::lane_waypoints ( ) const
inline

在文件 path.h121 行定义.

121 {
122 return lane_waypoints_;
123 }

◆ RemoveDuplicates()

void apollo::hdmap::MapPathPoint::RemoveDuplicates ( std::vector< MapPathPoint > *  points)
static

在文件 path.cc241 行定义.

241 {
242 static constexpr double kDuplicatedPointsEpsilon = 1e-7;
243 static constexpr double limit =
244 kDuplicatedPointsEpsilon * kDuplicatedPointsEpsilon;
245 CHECK_NOTNULL(points);
246 int count = 0;
247 for (size_t i = 0; i < points->size(); ++i) {
248 if (count == 0 ||
249 (*points)[i].DistanceSquareTo((*points)[count - 1]) > limit) {
250 (*points)[count++] = (*points)[i];
251 } else {
252 (*points)[count - 1].add_lane_waypoints((*points)[i].lane_waypoints());
253 }
254 }
255 points->resize(count);
256}
double DistanceSquareTo(const Vec2d &other) const
Returns the squared distance to the given vector
Definition vec2d.cc:51

◆ set_heading()

void apollo::hdmap::MapPathPoint::set_heading ( const double  heading)
inline

在文件 path.h119 行定义.

119{ heading_ = heading; }

类成员变量说明

◆ heading_

double apollo::hdmap::MapPathPoint::heading_ = 0.0
protected

在文件 path.h147 行定义.

◆ lane_waypoints_

std::vector<LaneWaypoint> apollo::hdmap::MapPathPoint::lane_waypoints_
protected

在文件 path.h148 行定义.


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