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 /**
41 * \brief Computes elevation angle between a ground terminal and a HAPS/Satellite.
42 * After calculating the plane perpendicular to a cartesian position vector,
43 * the elevation angle is calculated using
44 * https://www.w3schools.blog/angle-between-a-line-and-a-plane.
45 * The altitude of the position passed as a parameter must be higher than that of the reference
46 * point.
47 * \param other pointer to the HAPS/satellite mobility model
48 * \return the elevation angle
49 * in degrees
50 */
52
53 /**
54 * \brief Get the position using geographic (geodetic) coordinates
55 * \return Vector containing (latitude (degree), longitude (degree), altitude (meter))
56 */
57 virtual Vector GetGeographicPosition() const;
58
59 /**
60 * \brief Set the position using geographic coordinates
61 *
62 * Sets the position, using geographic coordinates and asserting
63 * that the provided parameter falls within the appropriate range.
64 *
65 * \param latLonAlt pointer to a Vector containing (latitude (degree), longitude (degree),
66 * altitude (meter)). The values are expected to be in the ranges [-90, 90], [-180, 180], [0,
67 * +inf[, respectively. These assumptions are enforced with an assert for the latitude and the
68 * altitude, while the longitude is normalized to the expected range.
69 */
70 virtual void SetGeographicPosition(const Vector& latLonAlt);
71
72 /**
73 * \brief Get the position using Geocentric Cartesian coordinates
74 * \return Vector containing (x, y, z) (meter) coordinates
75 */
76 virtual Vector GetGeocentricPosition() const;
77
78 /**
79 * \brief Set the position using Geocentric Cartesian coordinates
80 * \param position pointer to a Vector containing (x, y, z) (meter) coordinates
81 */
82 virtual void SetGeocentricPosition(const Vector& position);
83
84 /**
85 * \brief Set the reference point for coordinate conversion
86 * \param refPoint vector containing the geographic reference point (meter)
87 */
88 virtual void SetCoordinateTranslationReferencePoint(const Vector& refPoint);
89
90 /**
91 * \brief Get the reference point for coordinate conversion
92 * \return Vector containing geographic reference point (meter)
93 */
94 virtual Vector GetCoordinateTranslationReferencePoint() const;
95
96 /**
97 * \return the current position
98 */
99 virtual Vector GetPosition() const;
100
101 /**
102 * \param position the position to set.
103 */
104 virtual void SetPosition(const Vector& position);
105
106 /**
107 * \param other a reference to another mobility model
108 * \return the distance between the two objects. Unit is meters.
109 */
111
112 private:
113 /** \copydoc GetPosition() */
114 Vector DoGetPosition() const override;
115 /** \copydoc SetPosition() */
116 void DoSetPosition(const Vector& position) override;
117 /** \copydoc GetVelocity() */
118 Vector DoGetVelocity() const override;
119 /** \copydoc GetDistanceFrom() */
121 /** \copydoc GetGeographicPosition() */
122 virtual Vector DoGetGeographicPosition() const;
123 /** \copydoc SetGeographicPosition() */
124 virtual void DoSetGeographicPosition(const Vector& latLonAlt);
125 /** \copydoc GetGeocentricPosition() */
126 virtual Vector DoGetGeocentricPosition() const;
127 /** \copydoc SetGeocentricPosition() */
128 virtual void DoSetGeocentricPosition(const Vector& position);
129 /** \copydoc GetElevationAngle() */
131 /** \copydoc SetCoordinateTranslationReferencePoint() */
132 virtual void DoSetCoordinateTranslationReferencePoint(const Vector& refPoint);
133 /** \copydoc GetCoordinateTranslationReferencePoint() */
134 virtual Vector DoGetCoordinateTranslationReferencePoint() const;
135
136 /**
137 * the constant Geographic position,, in order: latitude (degree), longitude (degree), altitude
138 * (meter).
139 */
140 Vector m_position{0, 0, 0};
141
142 /**
143 * This is the point (meter) taken as a reference for converting
144 * from geographic to topographic (also referred to as planar Cartesian)
145 */
147};
148
149} // namespace ns3
150
151#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.
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.