Apollo 10.0
自动驾驶开放平台
util.cc
浏览该文件的文档.
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
18
19#include <cmath>
20#include <vector>
21
22namespace apollo {
23namespace common {
24namespace util {
25
26PointENU operator+(const PointENU enu, const math::Vec2d& xy) {
27 PointENU point;
28 point.set_x(enu.x() + xy.x());
29 point.set_y(enu.y() + xy.y());
30 point.set_z(enu.z());
31 return point;
32}
33
35 const PathPoint& p2,
36 const double w1, const double w2) {
37 PathPoint p;
38 p.set_x(p1.x() * w1 + p2.x() * w2);
39 p.set_y(p1.y() * w1 + p2.y() * w2);
40 p.set_z(p1.z() * w1 + p2.z() * w2);
41 p.set_theta(p1.theta() * w1 + p2.theta() * w2);
42 p.set_kappa(p1.kappa() * w1 + p2.kappa() * w2);
43 p.set_dkappa(p1.dkappa() * w1 + p2.dkappa() * w2);
44 p.set_ddkappa(p1.ddkappa() * w1 + p2.ddkappa() * w2);
45 p.set_s(p1.s() * w1 + p2.s() * w2);
46 return p;
47}
48
49} // namespace util
50} // namespace common
51} // namespace apollo
Implements a class of 2-dimensional vectors.
Definition vec2d.h:42
double y() const
Getter for y component
Definition vec2d.h:57
double x() const
Getter for x component
Definition vec2d.h:54
Some util functions.
PathPoint GetWeightedAverageOfTwoPathPoints(const PathPoint &p1, const PathPoint &p2, const double w1, const double w2)
Definition util.cc:34
class register implement
Definition arena_queue.h:37