minisky_multicopter¶
quantities
¶
Physical and dimensionless quantities specific to multicopter performance.
FlatPlateDragAreaM2
module-attribute
¶
Equivalent flat-plate parasite-drag area, \(C_D S\), where \(C_D\) is the drag coefficient and \(S\) is the reference area.
ThrustToWeightRatio
module-attribute
¶
ThrustToWeightRatio: TypeAlias = Annotated[_T, aerospace.THRUST_LOADING]
Dimensionless maximum thrust divided by aircraft weight, \(T_{\max}/(mg)\)
CruiseSpeedFraction
module-attribute
¶
CruiseSpeedFraction: TypeAlias = Annotated[_T, isqx.Dimensionless('cruise_speed_fraction')]
Cruise speed as a fraction of the airframe's maximum speed.
where \(0 < f \le 1\).
Used when deriving battery energy from the configured maximum range for an aircraft whose usable battery energy is not supplied directly.
MulticopterConfig
¶
Bases: BaseModel
Validated [plugins.multicopter] configuration.
model_config
class-attribute
instance-attribute
¶
model_config = ConfigDict(extra='forbid', frozen=True)
capture_radius
class-attribute
instance-attribute
¶
lowbatt_spd_factor
class-attribute
instance-attribute
¶
lowbatt_vs_factor
class-attribute
instance-attribute
¶
alt_capture
class-attribute
instance-attribute
¶
alt_capture: VerticalDistanceM[IsFinite[Gt0[float]]] = 0.5
cruise_speed_fraction
class-attribute
instance-attribute
¶
cruise_speed_fraction: CruiseSpeedFraction[Annotated[IsFinite[Gt0[float]], Le(1)]] = 0.8
MulticopterTypeTable
¶
Bases: BaseModel
model_config
class-attribute
instance-attribute
¶
model_config = ConfigDict(extra='forbid', frozen=True)
MulticopterTypeSpec
¶
RotorAirframeSpec
¶
Bases: BaseModel
Complete rotor-airframe data in MiniSky's internal SI units.
model_config
class-attribute
instance-attribute
¶
model_config = ConfigDict(extra='forbid', frozen=True)
Multicopter
¶
Multicopter(typespecs: Mapping[str, MulticopterTypeSpec] | None = None, config: MulticopterConfig | None = None)
Bases: Entity
Per-aircraft multicopter state.
Source code in packages/minisky-multicopter/src/minisky_multicopter/entity.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | |
typespecs
instance-attribute
¶
typespecs = dict(typespecs) if typespecs is not None else load_type_table()
ismulticopter
instance-attribute
¶
Whether each aircraft uses multicopter kinematics.
swselhdg
instance-attribute
¶
Whether body heading is explicitly selected rather than following track.
create
¶
create(n: int = 1) -> None
Seed multicopter state for n newly created aircraft.
Membership follows from the typecode; the body heading starts unconstrained (nose follows track) at the default yaw rate.
Source code in packages/minisky-multicopter/src/minisky_multicopter/entity.py
103 104 105 106 107 108 109 110 111 112 113 114 115 | |
mask
¶
mask() -> ndarray
Return the boolean row mask of aircraft flown as multicopters.
Source code in packages/minisky-multicopter/src/minisky_multicopter/entity.py
117 118 119 | |
select_implementations
¶
select_implementations() -> None
Swap the multicopter implementations onto the owning traffic.
Equivalent to issuing SELECTIMPL <BASE> <IMPL> for each entry of
IMPLEMENTATIONS; replaces the live instance immediately.
Source code in packages/minisky-multicopter/src/minisky_multicopter/entity.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 | |
ensure_implementations
¶
ensure_implementations() -> None
Select the multicopter implementations on the first step after load.
Replacements are installed when the plugin loads but can only be
selected once the plugin is published, so the initial selection
happens here. A manual SELECTIMPL afterwards is respected until
the next reset.
Source code in packages/minisky-multicopter/src/minisky_multicopter/entity.py
136 137 138 139 140 141 142 143 144 145 146 | |
reselect_implementations
¶
reselect_implementations() -> None
Re-select the multicopter implementations after a reset.
A reset reverts every replaceable to its core default; this hook runs afterwards and restores the multicopter set.
Source code in packages/minisky-multicopter/src/minisky_multicopter/entity.py
148 149 150 151 152 153 154 155 | |
mcopt_status
¶
See stack command:
MCOPT
Report whether multicopter behavior is enabled for an aircraft.
Source code in packages/minisky-multicopter/src/minisky_multicopter/entity.py
157 158 159 160 161 | |
set_mcopt
¶
See stack command:
MCOPT
Enable or disable multicopter behavior for an aircraft.
Source code in packages/minisky-multicopter/src/minisky_multicopter/entity.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | |
yaw
¶
yaw(idx: AcId, hdg: TrueHeadingDeg[IsFinite[float]] | MagneticHeadingDeg[IsFinite[float]]) -> Result[str, str]
See stack command:
YAW
Command the body heading (nose direction) of a multicopter.
The velocity vector keeps following the track command from the FMS or conflict resolution, so this rotates the aircraft in place.
Source code in packages/minisky-multicopter/src/minisky_multicopter/entity.py
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | |
yawrate_status
¶
See stack command:
YAWRATE
Report the maximum yaw rate of a multicopter.
Source code in packages/minisky-multicopter/src/minisky_multicopter/entity.py
201 202 203 204 205 | |
set_yawrate
¶
See stack command:
YAWRATE
Set the maximum yaw rate of a multicopter.
Source code in packages/minisky-multicopter/src/minisky_multicopter/entity.py
207 208 209 210 211 212 213 214 215 216 | |
hover
¶
hover(idx: AcId, duration: TimeS | None = None, alt: StdPressureAltM[IsFinite[float]] | None = None) -> Result[str, str]
See stack command:
HOVER
Hold position, optionally for a fixed time at a given altitude.
Suspends LNAV/VNAV, commands zero ground speed, and holds the given altitude (the current one when omitted) — with an altitude the aircraft moves there vertically, at a fixed position. With a duration, the route resumes once position and altitude have been held that long; without one, the aircraft hovers until LNAV is re-engaged. Repeating the command while hovering updates the hold time and altitude, and a plain ALT command changes the hover altitude as well.
Source code in packages/minisky-multicopter/src/minisky_multicopter/entity.py
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | |
batt
¶
See stack command:
BATT
Report the battery state of charge, power draw and endurance.
Source code in packages/minisky-multicopter/src/minisky_multicopter/entity.py
244 245 246 247 248 249 250 251 252 253 254 255 256 | |
MulticopterAutopilot
¶
MulticopterAutopilot(traffic: Traffic, get_simulation: Callable[[], Simulation])
Bases: Autopilot
Autopilot with a multicopter hover primitive.
Source code in packages/minisky-multicopter/src/minisky_multicopter/autopilot.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
swhover
instance-attribute
¶
Whether each aircraft is in a commanded hover.
hovertimer
instance-attribute
¶
hovertimer: OptionalArray[DurationS[ndarray]] = OptionalArray(np.array([]), np.array([], dtype=bool))
Remaining hold time of an active hover.
resume_airspeed
instance-attribute
¶
resume_airspeed: VariantArray[ndarray] = VariantArray(np.array([]), np.array([], dtype=np.uint8))
CAS in m/s or Mach selection restored when hover ends.
create
¶
create(n: int = 1) -> None
Seed the hover state of n newly created aircraft.
New aircraft start with no hover active; new multicopters get fly-over waypoints by default (they fly point-to-point, without a turn-anticipation arc).
Source code in packages/minisky-multicopter/src/minisky_multicopter/autopilot.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |
update
¶
update() -> None
Run the FMS, then advance any active hovers (vectorized).
A timed hover counts its hold time down only while the position is actually held: stopped, at the selected altitude. A hover ends when that timer expires (the saved route state is restored; the selected altitude stays at the hover altitude) or when LNAV is re-engaged externally (LNAV is then left as commanded).
Source code in packages/minisky-multicopter/src/minisky_multicopter/autopilot.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |
selhdgcmd
¶
selhdgcmd(idx: AcIdSelection, hdg: TrueHeadingDeg | MagneticHeadingDeg) -> Result[str, str]
Select the autopilot heading; for multicopters, yaw the nose only.
For multicopter rows the HDG stack command is an alias of YAW:
it rotates the body without touching the track, and LNAV stays
engaged — the velocity vector keeps following the FMS or conflict
resolution. Other aircraft keep the stock behaviour.
Source code in packages/minisky-multicopter/src/minisky_multicopter/autopilot.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | |
hover
¶
hover(idx: AircraftIndex, duration: DurationS[float] | None = None, alt: StdPressureAltM | None = None) -> Result[str, str]
Hold position, optionally for a fixed time at a given altitude.
Backs the HOVER stack command declared on the Multicopter entity,
which delegates here at call time so the command survives the
autopilot instance being swapped on reset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
duration
|
DurationS[float] | None
|
Hold time; |
None
|
alt
|
StdPressureAltM | None
|
Hover altitude; |
None
|
Source code in packages/minisky-multicopter/src/minisky_multicopter/autopilot.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | |
MulticopterPerf
¶
MulticopterPerf(traffic: Traffic)
Bases: OpenAP
OpenAP performance with an electric model for multicopter rows.
Source code in packages/minisky-multicopter/src/minisky_multicopter/perf.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
soc
instance-attribute
¶
Battery state of charge as a fraction of usable capacity.
capacity
instance-attribute
¶
Usable pack energy; zero disables the battery model.
twr
instance-attribute
¶
twr: ThrustToWeightRatio[ndarray] = np.array([])
Maximum-thrust-to-weight ratio.
create
¶
create(n: int = 1) -> None
Seed the electric state of n newly created aircraft.
Multicopters start on a full battery with their typecode's pack energy, drag area and thrust-to-weight ratio; other rows keep zeros (no battery model). Seeded per row rather than per batch, so a swap onto a mixed fleet stays correct. Membership comes from the performance table because the Multicopter entity may sit after this object in the traffic tree.
Source code in packages/minisky-multicopter/src/minisky_multicopter/perf.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | |
required_thrust
¶
Return the thrust each aircraft would need as a multicopter [N].
The thrust vector supports the weight — including any vertical acceleration, \(m \sqrt{g^2 + a_z^2}\) — while its horizontal component overcomes the flat-plate parasite drag of translation, \(\tfrac{1}{2} \rho v^2 C_D S\). Meaningful for multicopter rows (other rows have a zero drag area).
Source code in packages/minisky-multicopter/src/minisky_multicopter/perf.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
update
¶
update() -> None
Update performance, then the electric model for multicopter rows.
After the base update, computes each multicopter's required thrust, derives the electrical power from the momentum-theory scaling \(P = P_\text{max} (T / T_\text{max})^{1.5}\), and integrates the battery state of charge as an ideal energy tank.
Source code in packages/minisky-multicopter/src/minisky_multicopter/perf.py
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | |
limits
¶
limits(intent_v_tas: TrueAirspeedMps[ndarray], intent_vs: VerticalRateMps[ndarray], intent_h: PressureAltitudeM[ndarray], ax: AccelerationMps2[ndarray]) -> PerformanceLimits
Clip the intended state to the flight envelope.
Runs the base envelope, then tightens the maximum speed and climb
rate of multicopter rows below the state-of-charge threshold (the
soc_low / lowbatt_*_factor plugin settings). Descent stays
unrestricted — a low battery should not keep an aircraft airborne.
Source code in packages/minisky-multicopter/src/minisky_multicopter/perf.py
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | |
batt
¶
batt(idx: AircraftIndex) -> Result[str, str]
Report battery state of charge, power draw and endurance.
Backs the BATT stack command declared on the Multicopter entity,
which delegates here at call time so the command survives the
performance instance being swapped on reset.
Source code in packages/minisky-multicopter/src/minisky_multicopter/perf.py
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | |