Apollo
10.0
自动驾驶开放平台
sim_control_base.cc
浏览该文件的文档.
1
/******************************************************************************
2
* Copyright 2019 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
17
#include "
modules/dreamview/backend/common/sim_control_manager/core/sim_control_base.h
"
18
19
namespace
apollo
{
20
namespace
dreamview {
21
using
apollo::common::Point3D
;
22
using
apollo::common::Quaternion
;
23
using
apollo::common::math::HeadingToQuaternion
;
24
using
apollo::common::math::InverseQuaternionRotate
;
25
using
apollo::common::math::NormalizeAngle
;
26
using
apollo::common::math::QuaternionToHeading
;
27
28
void
SimControlBase::TransformToVRF
(
const
Point3D
& point_mrf,
29
const
Quaternion
& orientation,
30
Point3D
* point_vrf) {
31
Eigen::Vector3d v_mrf(point_mrf.
x
(), point_mrf.
y
(), point_mrf.
z
());
32
auto
v_vrf = InverseQuaternionRotate(orientation, v_mrf);
33
point_vrf->set_x(v_vrf.x());
34
point_vrf->set_y(v_vrf.y());
35
point_vrf->set_z(v_vrf.z());
36
}
37
38
}
// namespace dreamview
39
}
// namespace apollo
apollo::dreamview::SimControlBase::TransformToVRF
void TransformToVRF(const apollo::common::Point3D &point_mrf, const apollo::common::Quaternion &orientation, apollo::common::Point3D *point_vrf)
Definition
sim_control_base.cc:28
apollo::common::math::HeadingToQuaternion
Eigen::Quaternion< T > HeadingToQuaternion(T heading)
Definition
quaternion.h:88
apollo::common::math::InverseQuaternionRotate
Eigen::Vector3d InverseQuaternionRotate(const Quaternion &orientation, const Eigen::Vector3d &rotated)
Definition
quaternion.h:110
apollo::common::math::QuaternionToHeading
double QuaternionToHeading(const double qw, const double qx, const double qy, const double qz)
Definition
quaternion.h:56
apollo::common::math::NormalizeAngle
double NormalizeAngle(const double angle)
Normalize angle to [-PI, PI).
Definition
math_utils.cc:53
apollo
class register implement
Definition
arena_queue.h:37
sim_control_base.h
apollo::common::Point3D
Definition
geometry.proto:41
apollo::common::Point3D::z
optional double z
Definition
geometry.proto:44
apollo::common::Point3D::y
optional double y
Definition
geometry.proto:43
apollo::common::Point3D::x
optional double x
Definition
geometry.proto:42
apollo::common::Quaternion
Definition
geometry.proto:52
modules
dreamview
backend
common
sim_control_manager
core
sim_control_base.cc