77 lines
2.0 KiB
C++
77 lines
2.0 KiB
C++
#pragma once
|
|
|
|
/* MOUNT CONTROL COMPONENTS LIBRARY */
|
|
|
|
|
|
/* MOUNT TELEMETRY OBJECT CONCEPT AND DEFAULT IMPLEMENTATION */
|
|
|
|
#include <chrono>
|
|
|
|
namespace mcc
|
|
{
|
|
|
|
|
|
namespace traits
|
|
{
|
|
|
|
template <typename T>
|
|
concept mcc_mount_telemetry_c = requires(T t) {
|
|
typename T::mount_telemetry_data_t;
|
|
{ t.update() } -> std::same_as<typename T::mount_telemetry_data_t>;
|
|
};
|
|
|
|
} // namespace traits
|
|
|
|
|
|
class MccMountTelemetry
|
|
{
|
|
public:
|
|
// mount current telemetry data: time, position and related quantities
|
|
struct mount_telemetry_data_t {
|
|
typedef double mnt_coord_t;
|
|
typedef double mnt_speed_t;
|
|
typedef double time_point_t;
|
|
|
|
// time-related
|
|
std::chrono::system_clock::time_point utc;
|
|
time_point_t mjd; // modified Julian date
|
|
time_point_t ut1;
|
|
time_point_t tt;
|
|
time_point_t siderTime; // sideral time (in radians)
|
|
|
|
// apparent target (user-input) current coordinates (in radians)
|
|
mnt_coord_t tagRA, tagDEC;
|
|
mnt_coord_t tagHA;
|
|
mnt_coord_t tagAZ, tagZD;
|
|
mnt_coord_t tagPA; // paralactic angle
|
|
|
|
// encoder-measured current mount coordinates (in radians)
|
|
mnt_coord_t mntRA, mntDEC;
|
|
mnt_coord_t mntHA;
|
|
mnt_coord_t mntAZ, mntZD;
|
|
mnt_coord_t mntPA;
|
|
|
|
// encoder-measured (non-corrected for PCS) current mount position and moving speed (in radians, radians/s)
|
|
// X - HA, Y - DEC for equatorial-type mount; X - AZ, Y - ZD for horizontal-type one
|
|
mnt_coord_t mntPosX, mntPosY;
|
|
mnt_speed_t mntSpeedX, mntSpeedY;
|
|
|
|
// current refraction coefficient (for tagZD)
|
|
mnt_coord_t currRefr;
|
|
|
|
// PCS (pointing correction system) corrections
|
|
// X - HA, Y - DEC for equatorial-type mount; X - AZ, Y - ZD for horizontal-type one
|
|
mnt_coord_t pcsX, pcsY;
|
|
};
|
|
|
|
mount_telemetry_data_t update()
|
|
{
|
|
return _data;
|
|
}
|
|
|
|
protected:
|
|
mount_telemetry_data_t _data;
|
|
};
|
|
|
|
} // namespace mcc
|