CARLA
 
载入中...
搜索中...
未找到
GeoLocation.h
浏览该文件的文档.
1// Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma
2// de Barcelona (UAB).
3//
4// This work is licensed under the terms of the MIT license.
5// For a copy, see <https://opensource.org/licenses/MIT>.
6
7#pragma once
8
9#include "carla/MsgPack.h"
10
11namespace carla {
12namespace geom {
13
14 class Location;
15
17 public: ///定义 GeoLocation 类,它是一个公开的成员。
18
19 // =========================================================================
20 // -- 公共数据成员 --------------------------------------------------
21 // =========================================================================
22
23 double latitude = 0.0; ///纬度,初始化为0.0。
24
25 double longitude = 0.0; ///经度,初始化为0.0。
26
27 double altitude = 0.0; ///海拔,初始化为0.0。
28
29 // =========================================================================
30 // -- 构造函数 ---------------------------------------------------------
31 // =========================================================================
32
33 GeoLocation() = default; // 默认构造函数:使用默认值初始化。
34
35 GeoLocation(double latitude, double longitude, double altitude) // 参数化构造函数:接受纬度、经度和海拔作为参数,并初始化对象。
39
40 // =========================================================================
41 // -- 变换位置 --------------------------------------------------------------
42 // =========================================================================
43
44 /// 使用此对象作为地理参考,将给定的 @a location 转换为 GeoLocation。
45 ///
46 GeoLocation Transform(const Location &location) const;
47
48 // =========================================================================
49 // -- 比较运算符 -------------------------------------------------
50 // =========================================================================
51
52 bool operator==(const GeoLocation &rhs) const {
53 return (latitude == rhs.latitude) && (longitude == rhs.longitude) && (altitude == rhs.altitude);
54 } ///等于运算符:如果两个 GeoLocation 对象的纬度、经度和海拔都相等,则返回 true。
55
56 bool operator!=(const GeoLocation &rhs) const {
57 return !(*this == rhs);
58 } ///不等于运算符:如果两个 GeoLocation 对象的纬度、经度或海拔不相等,则返回 true。
59
61 };
62
63} // namespace geom
64} // namespace carla
double altitude
经度,初始化为0.0。
Definition GeoLocation.h:27
MSGPACK_DEFINE_ARRAY(latitude, longitude, altitude)
不等于运算符:如果两个 GeoLocation 对象的纬度、经度或海拔不相等,则返回 true。
GeoLocation Transform(const Location &location) const
使用此对象作为地理参考,将给定的 location 转换为 GeoLocation。
GeoLocation(double latitude, double longitude, double altitude)
Definition GeoLocation.h:35
double latitude
定义 GeoLocation 类,它是一个公开的成员。
Definition GeoLocation.h:23
bool operator!=(const GeoLocation &rhs) const
等于运算符:如果两个 GeoLocation 对象的纬度、经度和海拔都相等,则返回 true。
Definition GeoLocation.h:56
GeoLocation()=default
海拔,初始化为0.0。
bool operator==(const GeoLocation &rhs) const
Definition GeoLocation.h:52
double longitude
纬度,初始化为0.0。
Definition GeoLocation.h:25
geom::Location Location
CARLA模拟器的主命名空间。
Definition Carla.cpp:139