![]() |
QP
0.7-SNAPSHOT
Control software for the ??SRT telescope
|
The State class holds the state of the system while it is slewing or tracking. More...
#include <state.h>
Public Member Functions | |
State (Schedule *schedule, const ms_t current_time, const Position *obs=NULL) | |
Initialise the state. More... | |
State () | |
No-arg constructor. More... | |
ms_t | step (ms_t t) |
Retrospectively update the state by incrementally rotating the pointing. More... | |
void | alt_click (ms_t t, double current_speed, double angle) |
Report a click in altitude. More... | |
void | az_click (ms_t t, double current_speed, double angle) |
Return the current pointing of the state, as a vector in AzAlt coordinates. More... | |
double | suggested_phidot_frac (void) |
Return the suggested rate of change in longitude, in units of fractional speed. More... | |
double | suggested_thetadot_frac (void) |
Return the suggested rate of change in altitude, in units of fractional speed. More... | |
void | set_schedule (Schedule *) |
Sets the schedule which the state is to follow. More... | |
The State class holds the state of the system while it is slewing or tracking.
Initialise the state.
schedule | the schedule which this state is to follow |
current_time | the current millis() time |
observatory | a System::Geog location for the observatory, or NULL if the position is to be taken to be in AzAlt coordinates |
State::State | ( | ) |
No-arg constructor.
This isn't able to do anything useful, and is only for the case where we have no option but to initialise a static State object without complete information.
void State::alt_click | ( | ms_t | t, |
double | current_speed, | ||
double | angle | ||
) |
Report a click in altitude.
The caller is responsible for keeping track of the number of clicks received, and thus being able to calculate the actual position of the telescope at this point.
t | the time the click was registered |
current_speed | the current commanded speed of the telescope, as a fraction of full speed |
angle | the angular position of the telescope at the point this click was received |
void State::az_click | ( | ms_t | t, |
double | current_speed, | ||
double | angle | ||
) |
Return the current pointing of the state, as a vector in AzAlt coordinates.
Return the current position of the state, as a Position object. Report an azimuthal click. The caller is responsible for keeping track of the number of clicks received, and thus being able to calculate the actual position of the telescope at this point.
t | the time the click was registered |
current_speed | the current commanded speed of the telescope, as a fraction of full speed |
angle | the angular position of the telescope at the point this click was received |
void State::set_schedule | ( | Schedule * | sch | ) |
Sets the schedule which the state is to follow.
The state retains a pointer to this schedule, but does not take a copy of it.
ms_t State::step | ( | ms_t | actual_reftime_ms | ) |
Retrospectively update the state by incrementally rotating the pointing.
This updates the phidot
and thetadot
values. This steps the state by the rotation corresponding to the controller's actual phi and theta speeds, which are presumed to have been applied for the given number of ms.
Because this updates the state's notion of its position, this method should be called before any change in commanded speed. XXX NO
actual_reftime_ms | the current reference time, in ms. |
double State::suggested_phidot_frac | ( | void | ) |
Return the suggested rate of change in longitude, in units of fractional speed.
This is a suggestion to the controller, made by this state's internal schedule, of what commanded (fractional) speed would keep the telescope working on that schedule. Longitude increases east of south.
double State::suggested_thetadot_frac | ( | void | ) |
Return the suggested rate of change in altitude, in units of fractional speed.
Positive moves towards the zenith.