mirror of
https://gitlab.ibr.cs.tu-bs.de/tschuber/ns-3-leo.git
synced 2025-06-09 02:23:57 +02:00
Add mobility model for circular orbits
This commit is contained in:
parent
0834c06e31
commit
0a9aa411ef
4 changed files with 326 additions and 0 deletions
107
model/leo-circular-orbit-mobility-model.h
Normal file
107
model/leo-circular-orbit-mobility-model.h
Normal file
|
@ -0,0 +1,107 @@
|
|||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
|
||||
#ifndef LEO_CIRCULAR_ORBIT_MOBILITY_MODEL_H
|
||||
#define LEO_CIRCULAR_ORBIT_MOBILITY_MODEL_H
|
||||
|
||||
#include "ns3/vector.h"
|
||||
#include "ns3/object.h"
|
||||
#include "ns3/log.h"
|
||||
#include "ns3/mobility-model.h"
|
||||
#include "ns3/nstime.h"
|
||||
|
||||
#define LEO_EARTH_RAD_M 6371009.0
|
||||
#define LEO_EARTH_GM 3.98600436e14
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
/**
|
||||
* \ingroup leo
|
||||
* \brief Keep track of the orbital postion and velocity of a satellite.
|
||||
*
|
||||
* This uses simple circular orbits based on the inclination of the orbital
|
||||
* plane and the height of the satellite.
|
||||
*/
|
||||
class LeoCircularOrbitMobilityModel : public MobilityModel
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Register this type with the TypeId system.
|
||||
* \return the object TypeId
|
||||
*/
|
||||
static TypeId GetTypeId (void);
|
||||
LeoCircularOrbitMobilityModel ();
|
||||
virtual ~LeoCircularOrbitMobilityModel ();
|
||||
|
||||
/**
|
||||
* km/s
|
||||
*/
|
||||
double GetSpeed () const;
|
||||
|
||||
double GetAltitude () const;
|
||||
void SetAltitude (double h);
|
||||
|
||||
double GetLatitude () const;
|
||||
void SetLatitude (double lat);
|
||||
|
||||
double GetOffset () const;
|
||||
void SetOffset (double off);
|
||||
|
||||
double GetInclination () const;
|
||||
void SetInclination (double incl);
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
* Orbit height in m
|
||||
*/
|
||||
double m_orbitHeight;
|
||||
|
||||
/**
|
||||
* Inclination in rad
|
||||
*/
|
||||
double m_inclination;
|
||||
|
||||
/**
|
||||
* Latitude in rad
|
||||
*/
|
||||
double m_latitude;
|
||||
|
||||
/**
|
||||
* Offset on the orbital plane in rad
|
||||
*/
|
||||
double m_offset;
|
||||
|
||||
/**
|
||||
* Normal vector of orbital plane.
|
||||
*/
|
||||
Vector3D m_plane;
|
||||
|
||||
/**
|
||||
* \return the current position.
|
||||
*/
|
||||
virtual Vector DoGetPosition (void) const;
|
||||
/**
|
||||
* \param position the position to set.
|
||||
*/
|
||||
virtual void DoSetPosition (const Vector &position);
|
||||
/**
|
||||
* \return the current velocity.
|
||||
*/
|
||||
virtual Vector DoGetVelocity (void) const;
|
||||
|
||||
/**
|
||||
* Get the normal vector of the orbital plane
|
||||
*/
|
||||
Vector3D PlaneNorm () const;
|
||||
|
||||
double GetProgress (Time t) const;
|
||||
|
||||
/**
|
||||
* Advances a satellite by a degrees on the orbital plane
|
||||
*/
|
||||
Vector3D RotatePlane (double a, const Vector3D &x) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue