|
K-FSW v1.2.1-59-gcaca356
KFSW: modular flight software on Zephyr, for small satellites
|
API Areas | |
| Which spacecraft the rules are for | |
Data Structures | |
| struct | kfsw_gpredict_bearing |
| struct | kfsw_gpredict_status |
Enumerations | |
| enum | kfsw_gpredict_state { KFSW_GPREDICT_PARKED = 0 , KFSW_GPREDICT_TRACKING = 1 , KFSW_GPREDICT_HOLDING = 2 , KFSW_GPREDICT_PARKING = 3 , KFSW_GPREDICT_FAULT = 4 } |
| enum | kfsw_gpredict_event { KFSW_GPREDICT_EVENT_BEARING = 0 , KFSW_GPREDICT_EVENT_SILENCE = 1 , KFSW_GPREDICT_EVENT_PARKED = 2 , KFSW_GPREDICT_EVENT_PARK_COMMANDED = 3 , KFSW_GPREDICT_EVENT_FAULT = 4 , KFSW_GPREDICT_EVENT_CLEARED = 5 } |
Functions | |
| enum kfsw_gpredict_state | kfsw_gpredict_next (enum kfsw_gpredict_state state, enum kfsw_gpredict_event event) |
| const char * | kfsw_gpredict_state_name (enum kfsw_gpredict_state state) |
| int | kfsw_gpredict_init (void) |
| int | kfsw_gpredict_bearing (const struct kfsw_gpredict_bearing *bearing) |
| int | kfsw_gpredict_frequency (uint64_t frequency_hz) |
| int | kfsw_gpredict_park (void) |
| int | kfsw_gpredict_clear (void) |
| int | kfsw_gpredict_get_status (struct kfsw_gpredict_status *status) |
Variables | |
| const struct kfsw_param_definition_set | kfsw_gpredict_param_definitions |
Following a spacecraft across a pass, driven by a predictor on the ground.
Gpredict computes the pass and speaks the hamlib protocols: it sends a bearing to a rotator daemon and a corrected frequency to a radio daemon. This module is the other end of those two conversations, so prediction stays where it already works and this node only has to point and tune.
Every question worth getting right here is about what happens when the conversation stops. A rotator left at the last bearing it was given points at nothing; one that returns to its park position in the middle of a pass is worse, because the pass is lost and nobody is told. So the decision is a state machine with a grace period: a gap shorter than the grace is a gap in the predictor, and the antenna holds; a gap longer than it is the end of the pass, and the antenna parks.
| enum kfsw_gpredict_event |
#include <gpredict.h>
What happened.
The state machine is driven only by these.
| enum kfsw_gpredict_state |
#include <gpredict.h>
Where the tracker is.
| int kfsw_gpredict_bearing | ( | const struct kfsw_gpredict_bearing * | bearing | ) |
#include <gpredict.h>
Offer a bearing from the predictor.
| 0 | Accepted; the antenna is tracking. |
| -EINVAL | A NULL, or a bearing outside the rotator's range. |
| -EPERM | The tracker is in fault and has not been cleared. |
| int kfsw_gpredict_clear | ( | void | ) |
#include <gpredict.h>
Clear a fault and park.
Returns -EALREADY when there is nothing to clear.
| int kfsw_gpredict_frequency | ( | uint64_t | frequency_hz | ) |
#include <gpredict.h>
Offer a Doppler-corrected frequency.
Zero is refused with -EINVAL.
| int kfsw_gpredict_get_status | ( | struct kfsw_gpredict_status * | status | ) |
#include <gpredict.h>
Read the tracker.
Returns -EINVAL for a NULL destination.
| int kfsw_gpredict_init | ( | void | ) |
#include <gpredict.h>
Start the tracker parked, with the compiled grace period.
| enum kfsw_gpredict_state kfsw_gpredict_next | ( | enum kfsw_gpredict_state | state, |
| enum kfsw_gpredict_event | event | ||
| ) |
#include <gpredict.h>
Decide the next state.
Pure: the same state and event always give the same answer, which is what makes the end of a pass testable without a rotator.
| state | Where the tracker is. |
| event | What happened. |
state. | int kfsw_gpredict_park | ( | void | ) |
#include <gpredict.h>
Ask for the park position now, whatever the pass is doing.
| 0 | On the way to the park position. |
| -EPERM | The tracker is in fault. The rotator cannot be trusted to move, so an operator clears the fault first. |
| const char * kfsw_gpredict_state_name | ( | enum kfsw_gpredict_state | state | ) |
#include <gpredict.h>
Human-readable name of a state, for the shell and for a log line.
|
extern |
#include <gpredict.h>
Parameter table of the pass tracker.