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