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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Mattia Sandri <mattia.sandri@unipd.it>
7 */
8#ifndef GEOCENTRIC_CONSTANT_POSITION_MOBILITY_MODEL_H
9#define GEOCENTRIC_CONSTANT_POSITION_MOBILITY_MODEL_H
10
12#include "mobility-model.h"
13
14/**
15 * @file
16 * @ingroup mobility
17 * Class GeocentricConstantPositionMobilityModel declaration.
18 */
19
20namespace ns3
21{
22
23/**
24 * @brief Mobility model using geocentric euclidean coordinates, as defined in 38.811 chapter 6.3
25 */
27{
28 public:
29 /**
30 * Register this type with the TypeId system.
31 * @return the object TypeId
32 */
33 static TypeId GetTypeId();
34 /**
35 * Create a position located at coordinates (0,0,0)
36 */
39
40 // Inherited from MobilityModel
45
46 /**
47 * @brief Computes elevation angle between a ground terminal and a HAPS/Satellite.
48 * After calculating the plane perpendicular to a cartesian position vector,
49 * the elevation angle is calculated using
50 * https://www.w3schools.blog/angle-between-a-line-and-a-plane.
51 * The altitude of the position passed as a parameter must be higher than that of the reference
52 * point.
53 * @param other pointer to the HAPS/satellite mobility model
54 * @return the elevation angle
55 * in degrees
56 */
58
59 /**
60 * @brief Get the position using geographic (geodetic) coordinates
61 * @return Vector containing (latitude (degree), longitude (degree), altitude (meter))
62 */
63 virtual Vector GetGeographicPosition() const;
64
65 /**
66 * @brief Set the position using geographic coordinates
67 *
68 * Sets the position, using geographic coordinates and asserting
69 * that the provided parameter falls within the appropriate range.
70 *
71 * @param latLonAlt pointer to a Vector containing (latitude (degree), longitude (degree),
72 * altitude (meter)). The values are expected to be in the ranges [-90, 90], [-180, 180], [0,
73 * +inf[, respectively. These assumptions are enforced with an assert for the latitude and the
74 * altitude, while the longitude is normalized to the expected range.
75 */
76 virtual void SetGeographicPosition(const Vector& latLonAlt);
77
78 /**
79 * @brief Get the position using Geocentric Cartesian coordinates
80 * @return Vector containing (x, y, z) (meter) coordinates
81 */
82 virtual Vector GetGeocentricPosition() const;
83
84 /**
85 * @brief Set the position using Geocentric Cartesian coordinates
86 * @param position pointer to a Vector containing (x, y, z) (meter) coordinates
87 */
88 virtual void SetGeocentricPosition(const Vector& position);
89
90 /**
91 * @brief Set the reference point for coordinate conversion
92 * @param refPoint vector containing the geographic reference point (meter)
93 */
94 virtual void SetCoordinateTranslationReferencePoint(const Vector& refPoint);
95
96 /**
97 * @brief Get the reference point for coordinate conversion
98 * @return Vector containing geographic reference point (meter)
99 */
100 virtual Vector GetCoordinateTranslationReferencePoint() const;
101
102 /**
103 * @return the current position
104 */
105 virtual Vector GetPosition() const;
106
107 /**
108 * @param position the position to set.
109 */
110 virtual void SetPosition(const Vector& position);
111
112 /**
113 * @param other a reference to another mobility model
114 * @return the distance between the two objects. Unit is meters.
115 */
117
118 private:
119 /** @copydoc GetPosition() */
120 Vector DoGetPosition() const override;
121 /** @copydoc SetPosition() */
122 void DoSetPosition(const Vector& position) override;
123 /** @copydoc GetVelocity() */
124 Vector DoGetVelocity() const override;
125 /** @copydoc GetDistanceFrom() */
127 /** @copydoc GetGeographicPosition() */
128 virtual Vector DoGetGeographicPosition() const;
129 /** @copydoc SetGeographicPosition() */
130 virtual void DoSetGeographicPosition(const Vector& latLonAlt);
131 /** @copydoc GetGeocentricPosition() */
132 virtual Vector DoGetGeocentricPosition() const;
133 /** @copydoc SetGeocentricPosition() */
134 virtual void DoSetGeocentricPosition(const Vector& position);
135 /** @copydoc GetElevationAngle() */
137 /** @copydoc SetCoordinateTranslationReferencePoint() */
138 virtual void DoSetCoordinateTranslationReferencePoint(const Vector& refPoint);
139 /** @copydoc GetCoordinateTranslationReferencePoint() */
140 virtual Vector DoGetCoordinateTranslationReferencePoint() const;
141
142 /**
143 * the constant Geographic position,, in order: latitude (degree), longitude (degree), altitude
144 * (meter).
145 */
146 Vector m_position{0, 0, 0};
147
148 /**
149 * This is the point (meter) taken as a reference for converting
150 * from geographic to topographic (also referred to as planar Cartesian)
151 */
153};
154
155} // namespace ns3
156
157#endif /* GEOCENTRIC_CONSTANT_POSITION_MOBILITY_MODEL_H */
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.
Ptr< MobilityModel > Copy() const override
Copy function allows one to copy the underlying MobilityModel from a MobilityModel pointer,...
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.
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:67
a unique identifier for an interface.
Definition type-id.h:49
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:619
Every class exported by the ns3 library is enclosed in the ns3 namespace.