M1M3 Support System
Loading...
Searching...
No Matches
TMA.h
1/*
2 * This file is part of LSST M1M3 support system package.
3 *
4 * Developed for the Vera C. Rubin Telescope and Site System.
5 * This product includes software developed by the LSST Project
6 * (https://www.lsst.org).
7 * See the COPYRIGHT file at the top-level directory of this distribution
8 * for details of code ownership.
9 *
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 */
23
24#ifndef TMA_H_
25#define TMA_H_
26
27#include <SAL_MTMountC.h>
28
29#include <Units.h>
30#include <cRIO/Singleton.h>
31
32#include <cmath>
33
34namespace LSST {
35namespace M1M3 {
36namespace SS {
37
42class TMA : public cRIO::Singleton<TMA> {
43public:
44 TMA(token);
45
52 void checkTimestamps(bool checkAzimuth, bool checkElevation);
53
60 void updateTMAAzimuth(MTMount_azimuthC *data);
61
68 void updateTMAElevation(MTMount_elevationC *data);
69
78 double getElevation(bool forceTelescope = false);
79
84 void getMirrorAngularVelocities(double &x, double &y, double &z);
85
86 void getMirrorAngularAccelerations(double &ax, double &ay, double &az);
87
95 double getElevationSin(bool forceTelescope = false) { return sin(getElevation(forceTelescope) * D2RAD); }
96
104 double getElevationCos(bool forceTelescope = false) { return cos(getElevation(forceTelescope) * D2RAD); }
105
106private:
108 MTMount_azimuthC _last_azimuth_data;
109 MTMount_elevationC _last_elevation_data;
110
111 double _azimuth_demand_acceleration;
112 double _azimuth_actual_acceleration;
113
114 double _elevation_demand_acceleration;
115 double _elevation_actual_acceleration;
116};
117
118} // namespace SS
119} // namespace M1M3
120} // namespace LSST
121
122#endif
Represents Telescope Mount Assembly (TMA).
Definition TMA.h:42
void updateTMAAzimuth(MTMount_azimuthC *data)
Updates azimuth data to match current TMA data.
Definition TMA.cpp:68
void getMirrorAngularVelocities(double &x, double &y, double &z)
Returns mirror angular X, Y and Z velocities.
Definition TMA.cpp:108
double getElevation(bool forceTelescope=false)
Returns mirror elevation.
Definition TMA.cpp:100
double getElevationCos(bool forceTelescope=false)
Returns elevation cos.
Definition TMA.h:104
void checkTimestamps(bool checkAzimuth, bool checkElevation)
Checks that TMA azimuth and elevation timestamps are current.
Definition TMA.cpp:52
void updateTMAElevation(MTMount_elevationC *data)
Updates elevation data to match current TMA data.
Definition TMA.cpp:82
double getElevationSin(bool forceTelescope=false)
Returns elevation sin.
Definition TMA.h:95