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:
18
19 // =========================================================================
20 // -- Public data members --------------------------------------------------
21 // =========================================================================
22
23 double latitude = 0.0;
24
25 double longitude = 0.0;
26
27 double altitude = 0.0;
28
29 // =========================================================================
30 // -- Constructors ---------------------------------------------------------
31 // =========================================================================
32
33 GeoLocation() = default;
34
39
40 // =========================================================================
41 // -- Transform locations --------------------------------------------------
42 // =========================================================================
43
44 /// Transform the given @a location to a GeoLocation using this as
45 /// geo-reference.
46 GeoLocation Transform(const Location &location) const;
47
48 // =========================================================================
49 // -- Comparison operators -------------------------------------------------
50 // =========================================================================
51
52 bool operator==(const GeoLocation &rhs) const {
53 return (latitude == rhs.latitude) && (longitude == rhs.longitude) && (altitude == rhs.altitude);
54 }
55
56 bool operator!=(const GeoLocation &rhs) const {
57 return !(*this == rhs);
58 }
59
61 };
62
63} // namespace geom
64} // namespace carla
MSGPACK_DEFINE_ARRAY(latitude, longitude, altitude)
GeoLocation Transform(const Location &location) const
Transform the given location to a GeoLocation using this as geo-reference.
GeoLocation(double latitude, double longitude, double altitude)
Definition GeoLocation.h:35
bool operator!=(const GeoLocation &rhs) const
Definition GeoLocation.h:56
bool operator==(const GeoLocation &rhs) const
Definition GeoLocation.h:52
geom::Location Location
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133