A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
geocentric-constant-position-mobility-model.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2006,2007 INRIA
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Mattia Sandri <mattia.sandri@unipd.it>
18 */
19#ifndef GEOCENTRIC_CONSTANT_POSITION_MOBILITY_MODEL_H
20#define GEOCENTRIC_CONSTANT_POSITION_MOBILITY_MODEL_H
21
23#include "mobility-model.h"
24
25/**
26 * \file
27 * \ingroup mobility
28 * Class GeocentricConstantPositionMobilityModel declaration.
29 */
30
31namespace ns3
32{
33
34/**
35 * \brief Mobility model using geocentric euclidean coordinates, as defined in 38.811 chapter 6.3
36 */
38{
39 public:
40 /**
41 * Register this type with the TypeId system.
42 * \return the object TypeId
43 */
44 static TypeId GetTypeId();
45 /**
46 * Create a position located at coordinates (0,0,0)
47 */
50
51 /**
52 * \brief Computes elevation angle between a ground terminal and a HAPS/Satellite.
53 * After calculating the plane perpendicular to a cartesian position vector,
54 * the elevation angle is calculated using
55 * https://www.w3schools.blog/angle-between-a-line-and-a-plane.
56 * The altitude of the position passed as a parameter must be higher than that of the reference
57 * point.
58 * \param other pointer to the HAPS/satellite mobility model
59 * \return the elevation angle
60 * in degrees
61 */
63
64 /**
65 * \brief Get the position using geographic (geodetic) coordinates
66 * \return Vector containing (latitude (degree), longitude (degree), altitude (meter))
67 */
68 virtual Vector GetGeographicPosition() const;
69
70 /**
71 * \brief Set the position using geographic coordinates
72 *
73 * Sets the position, using geographic coordinates and asserting
74 * that the provided parameter falls within the appropriate range.
75 *
76 * \param latLonAlt pointer to a Vector containing (latitude (degree), longitude (degree),
77 * altitude (meter)). The values are expected to be in the ranges [-90, 90], [-180, 180], [0,
78 * +inf[, respectively. These assumptions are enforced with an assert for the latitude and the
79 * altitude, while the longitude is normalized to the expected range.
80 */
81 virtual void SetGeographicPosition(const Vector& latLonAlt);
82
83 /**
84 * \brief Get the position using Geocentric Cartesian coordinates
85 * \return Vector containing (x, y, z) (meter) coordinates
86 */
87 virtual Vector GetGeocentricPosition() const;
88
89 /**
90 * \brief Set the position using Geocentric Cartesian coordinates
91 * \param position pointer to a Vector containing (x, y, z) (meter) coordinates
92 */
93 virtual void SetGeocentricPosition(const Vector& position);
94
95 /**
96 * \brief Set the reference point for coordinate conversion
97 * \param refPoint vector containing the geographic reference point (meter)
98 */
99 virtual void SetCoordinateTranslationReferencePoint(const Vector& refPoint);
100
101 /**
102 * \brief Get the reference point for coordinate conversion
103 * \return Vector containing geographic reference point (meter)
104 */
105 virtual Vector GetCoordinateTranslationReferencePoint() const;
106
107 /**
108 * \return the current position
109 */
110 virtual Vector GetPosition() const;
111
112 /**
113 * \param position the position to set.
114 */
115 virtual void SetPosition(const Vector& position);
116
117 /**
118 * \param other a reference to another mobility model
119 * \return the distance between the two objects. Unit is meters.
120 */
122
123 private:
124 /** \copydoc GetPosition() */
125 Vector DoGetPosition() const override;
126 /** \copydoc SetPosition() */
127 void DoSetPosition(const Vector& position) override;
128 /** \copydoc GetVelocity() */
129 Vector DoGetVelocity() const override;
130 /** \copydoc GetDistanceFrom() */
132 /** \copydoc GetGeographicPosition() */
133 virtual Vector DoGetGeographicPosition() const;
134 /** \copydoc SetGeographicPosition() */
135 virtual void DoSetGeographicPosition(const Vector& latLonAlt);
136 /** \copydoc GetGeocentricPosition() */
137 virtual Vector DoGetGeocentricPosition() const;
138 /** \copydoc SetGeocentricPosition() */
139 virtual void DoSetGeocentricPosition(const Vector& position);
140 /** \copydoc GetElevationAngle() */
142 /** \copydoc SetCoordinateTranslationReferencePoint() */
143 virtual void DoSetCoordinateTranslationReferencePoint(const Vector& refPoint);
144 /** \copydoc GetCoordinateTranslationReferencePoint() */
145 virtual Vector DoGetCoordinateTranslationReferencePoint() const;
146
147 /**
148 * the constant Geographic position,, in order: latitude (degree), longitude (degree), altitude
149 * (meter).
150 */
151 Vector m_position{0, 0, 0};
152
153 /**
154 * This is the point (meter) taken as a reference for converting
155 * from geographic to topographic (also referred to as planar Cartesian)
156 */
158};
159
160} // namespace ns3
161
162#endif /* GEOCENTRIC_CONSTANT_POSITION_MOBILITY_MODEL_H */
Mobility model using geocentric euclidean coordinates, as defined in 38.811 chapter 6....
virtual void SetGeographicPosition(const Vector &latLonAlt)
Set the position using geographic coordinates.
virtual Vector GetGeographicPosition() const
Get the position using geographic (geodetic) coordinates.
Vector m_geographicReferencePoint
This is the point (meter) taken as a reference for converting from geographic to topographic (also re...
virtual Vector GetGeocentricPosition() const
Get the position using Geocentric Cartesian coordinates.
virtual Vector GetCoordinateTranslationReferencePoint() const
Get the reference point for coordinate conversion.
static TypeId GetTypeId()
Register this type with the TypeId system.
virtual Vector DoGetGeographicPosition() const
Get the position using geographic (geodetic) coordinates.
~GeocentricConstantPositionMobilityModel() override=default
virtual void DoSetCoordinateTranslationReferencePoint(const Vector &refPoint)
Set the reference point for coordinate conversion.
virtual void DoSetGeographicPosition(const Vector &latLonAlt)
Set the position using geographic coordinates.
virtual void SetCoordinateTranslationReferencePoint(const Vector &refPoint)
Set the reference point for coordinate conversion.
double GetDistanceFrom(Ptr< const GeocentricConstantPositionMobilityModel > other) const
virtual void SetGeocentricPosition(const Vector &position)
Set the position using Geocentric Cartesian coordinates.
virtual Vector DoGetGeocentricPosition() const
Get the position using Geocentric Cartesian coordinates.
virtual void DoSetGeocentricPosition(const Vector &position)
Set the position using Geocentric Cartesian coordinates.
Vector m_position
the constant Geographic position,, in order: latitude (degree), longitude (degree),...
GeocentricConstantPositionMobilityModel()=default
Create a position located at coordinates (0,0,0)
virtual Vector DoGetCoordinateTranslationReferencePoint() const
Get the reference point for coordinate conversion.
double DoGetDistanceFrom(Ptr< const GeocentricConstantPositionMobilityModel > other) const
virtual double GetElevationAngle(Ptr< const GeocentricConstantPositionMobilityModel > other)
Computes elevation angle between a ground terminal and a HAPS/Satellite.
virtual double DoGetElevationAngle(Ptr< const GeocentricConstantPositionMobilityModel > other)
Computes elevation angle between a ground terminal and a HAPS/Satellite.
Keep track of the current position and velocity of an object.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.