Apollo 11.0
自动驾驶开放平台
target_camera.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2018 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#pragma once
18
20
22 public:
24
25 virtual void UpdateWorld();
26
27 const QVector3D& target_pos(void) const { return target_pos_; }
28 void set_target_pos(float x, float y, float z) {
29 target_pos_.setX(x);
30 target_pos_.setY(y);
31 target_pos_.setZ(z);
32
33 distance_ = position_.distanceToPoint(target_pos_);
34 }
35
36 void set_target_pos(const QVector3D& tgt) {
37 target_pos_ = tgt;
38 distance_ = position_.distanceToPoint(target_pos_);
39 }
40
41 float distance(void) const { return distance_; }
42 void set_distance(float distance) {
43 if (distance < 0.0f) {
44 distance = 0.0f;
45 }
46 distance_ = distance;
47 }
48
49 void Rotate(float xRotateDegrees, float yRotateDegrees,
50 float zRotateDegrees) {
51 SetAttitude(yRotateDegrees, xRotateDegrees, zRotateDegrees);
52 }
53
54 private:
55 QVector3D target_pos_;
56
57 float distance_;
58};
float y(void) const
float z(void) const
void SetAttitude(float yawInDegrees, float pitchInDegrees, float rollInDegrees)
float x(void) const
const QVector3D & target_pos(void) const
void set_target_pos(const QVector3D &tgt)
virtual void UpdateWorld()
float distance(void) const
void Rotate(float xRotateDegrees, float yRotateDegrees, float zRotateDegrees)
void set_distance(float distance)
void set_target_pos(float x, float y, float z)