openstb.simulator.system.ping_times
Ping time calculator plugins for the openSTB simulator.
Classes:
| Name | Description |
|---|---|
ConstantDistance |
Pings at a constant distance. |
ConstantInterval |
Pings at a constant interval. |
ConstantDistance
ConstantDistance(distance, start_offset, end_offset, sampling_factor=10)
Bases: PingTimes
Pings at a constant distance.
The mean speed of the trajectory is used to find the mean interval between pings. The position of the system is sampled at a rate greater than this and the cumulative distance between these positions is calculated to give an estimated mapping between the elapsed time and distance travelled. The ping times are then found by interpolating the mapping at the desired positions using a Piecewise Cubic Hermite Interpolating Polynomial (PCHIP) interpolator.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
distance
|
float
|
The distance between pings in metres. |
required |
start_offset
|
float
|
The distance (in metres) between the start of the trajectory and the position of the first ping. |
required |
end_offset
|
float
|
The minimum distance (in metres) between the position of the final ping and the end of the trajectory. |
required |
sampling_factor
|
int
|
Sample the system position this many times in each mean interval. For example, a mean speed of 2m/s and a distance of 0.5m corresponds to a mean interval of 0.25s. A sampling factor of 10 means the trajectory will be sampled every 0.025s. |
10
|
Source code in openstb/simulator/system/ping_times.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | |
ConstantInterval
ConstantInterval(interval, start_delay, end_delay)
Bases: PingTimes
Pings at a constant interval.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
interval
|
float
|
The ping interval in seconds. |
required |
start_delay
|
float
|
Delay (in seconds) between the start of the trajectory and the first ping. |
required |
end_delay
|
float
|
Delay (in seconds) between the last ping and the end of the trajectory. |
required |
Source code in openstb/simulator/system/ping_times.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |