JMOT.craft
1from JMOT import connect, extra 2from typing import Literal 3import numpy as np 4 5_CRAFT_INFO_SIGNAL = { 6 'name' : 200, 7 'target_craftname' : 201, 8 'craftname_of_craftID' : 202, 9 'part_count_of_craftID' : 203, 10 'craftID_of_craftname' : 204, 11 'planet_of_craft' : 205 12} 13 14class info: 15 def name()->str: 16 '''Get the current vessel's name.''' 17 rec = connect._send_message(f"true<<{_CRAFT_INFO_SIGNAL['name']}") 18 return rec[0] 19 def target_craftname()->str: 20 '''Get the name of the current vessel's target.''' 21 rec = connect._send_message(f"true<<{_CRAFT_INFO_SIGNAL['target_craftname']}") 22 return rec[0] 23 def craftname_of_craftID(craft_ID:int)->str: 24 '''Get the name of a vessel by its craft ID.''' 25 rec = connect._send_message(f"true<<{_CRAFT_INFO_SIGNAL['craftname_of_craftID']}<<{craft_ID}") 26 return rec[0] 27 def part_count_of_craftID(craft_ID:int)->int: 28 '''Get the part count of a vessel by its craft ID.''' 29 rec = connect._send_message(f"true<<{_CRAFT_INFO_SIGNAL['part_count_of_craftID']}<<{craft_ID}") 30 return rec[0] 31 def craftID_of_craftname(craft_name:str)->int: 32 '''Get the craft ID of a vessel by its name.''' 33 rec = connect._send_message(f"true<<{_CRAFT_INFO_SIGNAL['craftID_of_craftname']}<<{craft_name}") 34 return rec[0] 35 def planet_of_craft(craft_ID:int)->str: 36 '''Get the name of the planet that a vessel is currently orbiting.''' 37 rec = connect._send_message(f"true<<{_CRAFT_INFO_SIGNAL['planet_of_craft']}<<{craft_ID}") 38 return rec[0] 39 40_CRAFT_FUEL_SIGNAL = { 41 'battery' : 225, 42 'stage_fuel' : 226, 43 'mono_fuel' : 227, 44 'all_stage_fuel' : 228 45} 46 47class fuel: 48 def battery()->float: 49 '''Get the current total battery percentage of the vessel.''' 50 rec = connect._send_message(f"true<<{_CRAFT_FUEL_SIGNAL['battery']}") 51 return rec[0] 52 def stage_fuel()->float: 53 '''Get the current fuel mass percentage of the active stage.''' 54 rec = connect._send_message(f"true<<{_CRAFT_FUEL_SIGNAL['stage_fuel']}") 55 return rec[0] 56 def mono_fuel()->float: 57 '''Get the current monopropellant mass percentage of the vessel.''' 58 rec = connect._send_message(f"true<<{_CRAFT_FUEL_SIGNAL['mono_fuel']}") 59 return rec[0] 60 def all_stage_fuel()->float: 61 '''Get the current fuel mass percentage of all stages.''' 62 rec = connect._send_message(f"true<<{_CRAFT_FUEL_SIGNAL['all_stage_fuel']}") 63 return rec[0] 64 65_CRAFT_PERFORMANCE_SIGNAL = { 66 'current_engine_thrust' : 230, 67 'mass' : 231, 68 'dry_mass' : 232, 69 'fuel_mass' : 233, 70 'max_engine_thrust' : 234, 71 'TWR' : 235, 72 'ISP' : 236, 73 'stage_delta_v' : 237, 74 'stage_burn_time' : 238, 75 'solar_radition' : 239, 76 'craft_mass' : 240 77} 78 79class performance: 80 def current_engine_thrust()->float: 81 '''Get the current total thrust of all active engines in N.''' 82 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['current_engine_thrust']}") 83 return rec[0] 84 def mass()->float: 85 '''Get the current mass of the vessel in kg.''' 86 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['mass']}") 87 return rec[0] 88 def dry_mass()->float: 89 '''Get the current dry mass of the vessel in kg.''' 90 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['dry_mass']}") 91 return rec[0] 92 def fuel_mass()->float: 93 '''Get the current fuel mass of the vessel in kg.''' 94 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['fuel_mass']}") 95 return rec[0] 96 def max_engine_thrust()->float: 97 '''Get the maximum total thrust of all engines in N.''' 98 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['max_engine_thrust']}") 99 return rec[0] 100 def TWR()->float: 101 '''Get the current TWR of the vessel.''' 102 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['TWR']}") 103 return rec[0] 104 def ISP()->float: 105 '''Get the current ISP of the vessel in seconds.''' 106 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['ISP']}") 107 return rec[0] 108 def stage_delta_v()->float: 109 '''Get the delta-v of the current stage in m/s.''' 110 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['stage_delta_v']}") 111 return rec[0] 112 def stage_burn_time()->float: 113 '''Get the burn time of the current stage in seconds.''' 114 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['stage_burn_time']}") 115 return rec[0] 116 def solar_radition()->float: 117 '''Get the solar radiation at the current vessel's location in W/m^2.''' 118 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['solar_radition']}") 119 return rec[0] 120 def craft_mass(craft_ID:int)->float: 121 '''Get the mass of a vessel by its craft ID in kg.''' 122 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['craft_mass']}<<{craft_ID}") 123 return rec[0] 124 125 126_CRAFT_ATTITUDE_SIGNAL = { 127 'craft_heading' : 250, 128 'craft_pitching' : 251, 129 'craft_autopilot_heading' : 252, 130 'craft_autopilot_pitching' : 253, 131 'craft_bank_angle' : 254, 132 'craft_AOA' : 265, 133 'craft_side_slip': 256, 134 'craft_north_vector' : 257, 135 'craft_east_vector' : 258, 136 'craft_roll_axis' : 259, 137 'craft_pitch_axis' : 260, 138 'craft_yaw_axis' : 261 139} 140 141class attitude: 142 def craft_heading()->float: 143 ''' 144 Get the current vessel's heading in degrees.\n 145 0 degrees means the vessel is heading towards the north 146 and the angle increases clockwise. 147 ''' 148 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_heading']}") 149 return rec[0] 150 def craft_pitching()->float: 151 ''' 152 Get the current vessel's pitching in degrees.\n 153 90 degrees means the vessel is flying vertically, 154 0 degrees means the vessel is flying horizontally. 155 ''' 156 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_pitching']}") 157 return rec[0] 158 def craft_autopilot_heading()->float: 159 '''Get the current vessel's autopilot heading in degrees.''' 160 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_autopilot_heading']}") 161 return rec[0] 162 def craft_autopilot_pitching()->float: 163 '''Get the current vessel's autopilot pitching in degrees.''' 164 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_autopilot_pitching']}") 165 return rec[0] 166 def craft_bank_angle()->float: 167 '''Get the current vessel's bank angle in degrees.''' 168 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_bank_angle']}") 169 return rec[0] 170 def craft_AOA()->float: 171 '''Get the current vessel's angle of attack in degrees.''' 172 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_AOA']}") 173 return rec[0] 174 def craft_side_slip()->float: 175 '''Get the current vessel's side slip angle in degrees.''' 176 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_side_slip']}") 177 return rec[0] 178 def craft_north_vector()->np.ndarray: 179 '''Get the current vessel's north vector in ECI coordinates.''' 180 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_north_vector']}") 181 vec = extra.tuple2array(rec[0]) 182 return vec 183 def craft_east_vector()->np.ndarray: 184 '''Get the current vessel's east vector in ECI coordinates.''' 185 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_east_vector']}") 186 vec = extra.tuple2array(rec[0]) 187 return vec 188 def craft_roll_axis()->np.ndarray: 189 '''Get the current vessel's roll axis in ECI coordinates.''' 190 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_roll_axis']}") 191 vec = extra.tuple2array(rec[0]) 192 return vec 193 def craft_pitch_axis()->np.ndarray: 194 '''Get the current vessel's pitch axis in ECI coordinates.''' 195 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_pitch_axis']}") 196 vec = extra.tuple2array(rec[0]) 197 return vec 198 def craft_yaw_axis()->np.ndarray: 199 '''Get the current vessel's yaw axis in ECI coordinates.''' 200 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_yaw_axis']}") 201 vec = extra.tuple2array(rec[0]) 202 return vec 203 204_CRAFT_VELOCITY_SIGNAL = { 205 'surface_velocity' : 270, 206 'orbit_velocity' : 271, 207 'target_velocity' : 272, 208 'gravity' : 273, 209 'drag' : 274, 210 'acceleration' : 275, 211 'angular' : 276, 212 'lateral' : 277, 213 'vertical' : 278, 214 'mach_number' : 279, 215 'craft_velocity' : 280 216} 217 218class velocity: 219 def surface_velocity()->np.ndarray: 220 '''Get the current vessel's surface velocity in ECI coordinates.''' 221 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['surface_velocity']}") 222 vec = extra.tuple2array(rec[0]) 223 return vec 224 def orbit_velocity()->np.ndarray: 225 '''Get the current vessel's orbit velocity in ECI coordinates.''' 226 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['orbit_velocity']}") 227 vec = extra.tuple2array(rec[0]) 228 return vec 229 def target_velocity()->np.ndarray: 230 '''Get the current vessel's target velocity in ECI coordinates.''' 231 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['target_velocity']}") 232 vec = extra.tuple2array(rec[0]) 233 return vec 234 def gravity()->np.ndarray: 235 '''Get the current vessel's gravity in ECI coordinates.''' 236 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['gravity']}") 237 vec = extra.tuple2array(rec[0]) 238 return vec 239 def drag()->np.ndarray: 240 '''Get the current vessel's drag in ECI coordinates.''' 241 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['drag']}") 242 vec = extra.tuple2array(rec[0]) 243 return vec 244 def acceleration()->np.ndarray: 245 '''Get the current vessel's acceleration in ECI coordinates.''' 246 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['acceleration']}") 247 vec = extra.tuple2array(rec[0]) 248 return vec 249 def angular()->np.ndarray: 250 '''Get the current vessel's angular velocity in ECI coordinates.''' 251 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['angular']}") 252 vec = extra.tuple2array(rec[0]) 253 return vec 254 def lateral()->float: 255 '''Get the current vessel's lateral velocity in m/s.''' 256 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['lateral']}") 257 return rec[0] 258 def vertical()->float: 259 '''Get the current vessel's vertical velocity in m/s.''' 260 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['vertical']}") 261 return rec[0] 262 def mach_number()->float: 263 '''Get the current vessel's Mach number.''' 264 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['mach_number']}") 265 return rec[0] 266 def craft_velocity(craft_ID:int)->np.ndarray: 267 '''Get the velocity of a vessel by its craft ID in ECI coordinates.''' 268 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['craft_velocity']}") 269 vec = extra.tuple2array(rec[0]) 270 return vec 271 272_CRAFT_POSITION_SIGNAL = { 273 'AGL' : 290, 274 'ASL' : 291, 275 'ASF' : 292, 276 'craft_ASL' : 293, 277 'is_ground' : 294, 278 'craft_is_ground' : 295, 279 'ECI_position' : 296, 280 'target_ECI_position' : 297, 281 'craft_ECI_position' : 298 282} 283 284class position: 285 def AGL()->float: 286 '''Get the current vessel's altitude above ground level in meters.''' 287 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['AGL']}") 288 return rec[0] 289 def ASL()->float: 290 '''Get the current vessel's altitude above sea level in meters.''' 291 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['ASL']}") 292 return rec[0] 293 def ASF()->float: 294 '''Get the current vessel's altitude above seabed in meters.''' 295 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['ASF']}") 296 return rec[0] 297 def craft_ASL(craft_ID:int)->float: 298 '''Get the altitude above sea level of a vessel in meters.''' 299 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['craft_ASL']}<<{craft_ID}") 300 return rec[0] 301 def is_ground()->bool: 302 '''Get whether the current vessel is on the ground.\n 303 T means the vessel is on the ground, F means it's not. 304 ''' 305 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['is_ground']}") 306 return rec[0] 307 def craft_is_ground(craft_id:int)->bool: 308 '''Get whether a vessel is on the ground.\n 309 T means the vessel is on the ground, F means it's not. 310 ''' 311 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['craft_is_ground']}<<{craft_id}") 312 return rec[0] 313 def ECI_position()->np.ndarray: 314 '''Get the current vessel's position in ECI coordinates.''' 315 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['ECI_position']}") 316 vec = extra.tuple2array(rec[0]) 317 return vec 318 def target_ECI_position()->np.ndarray: 319 '''Get the target vessel's position in ECI coordinates.''' 320 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['target_ECI_position']}") 321 vec = extra.tuple2array(rec[0]) 322 return vec 323 def craft_ECI_position(craft_ID:int)->np.ndarray: 324 '''Get the position of a vessel by its craft ID in ECI coordinates.''' 325 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['craft_ECI_position']}<<{craft_ID}") 326 vec = extra.tuple2array(rec[0]) 327 return vec 328 329 330_CRAFT_ORBIT_SIGNAL = { 331 'apoapsis' : 305, 332 'periapsis' : 306, 333 'apoapsis_time' : 307, 334 'periapsis_time' : 308, 335 'eccentricity' : 309, 336 'inclination' : 310, 337 'period' : 311, 338 'craft_apoapsis_position' : 312, 339 'craft_periapsis_position' : 313, 340 'craft_period' : 314, 341 'craft_apoapsis_time' : 315, 342 'craft_periapsis_time' : 316, 343 'craft_inclination' : 317, 344 'craft_eccentricity' : 318, 345 'craft_mean_anomaly' : 319, 346 'craft_mean_motion' : 320, 347 'craft_periapsis_argument' : 321, 348 'craft_right_ascension' : 322, 349 'craft_true_anomaly' : 323, 350 'craft_SMA' : 324 351} 352 353class orbit: 354 def apoapsis()->float: 355 '''Get the current vessel's apoapsis altitude in meters.''' 356 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['apoapsis']}") 357 return rec[0] 358 def periapsis()->float: 359 '''Get the current vessel's periapsis altitude in meters.''' 360 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['periapsis']}") 361 return rec[0] 362 def apoapsis_time()->float: 363 '''Get the time to current vessel's apoapsis in seconds.''' 364 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['apoapsis_time']}") 365 return rec[0] 366 def periapsis_time()->float: 367 '''Get the time to current vessel's periapsis in seconds.''' 368 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['periapsis_time']}") 369 return rec[0] 370 def eccentricity()->float: 371 '''Get the eccentricity of the current vessel's orbit.''' 372 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['eccentricity']}") 373 return rec[0] 374 def inclination()->float: 375 '''Get the inclination of the current vessel's orbit in radians.''' 376 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['inclination']}") 377 return rec[0] 378 def period()->float: 379 '''Get the current vessel's orbital period in seconds.''' 380 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['period']}") 381 return rec[0] 382 def craft_apoapsis_position(craft_ID:int)->np.ndarray: 383 '''Get the apoapsis position of a vessel by its craft ID in ECI coordinates.''' 384 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_apoapsis_position']}<<{craft_ID}") 385 vec = extra.tuple2array(rec[0]) 386 return vec 387 def craft_periapsis_position(craft_ID:int)->np.ndarray: 388 '''Get the periapsis position of a vessel by its craft ID in ECI coordinates.''' 389 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_periapsis_position']}<<{craft_ID}") 390 vec = extra.tuple2array(rec[0]) 391 return vec 392 def craft_period(craft_ID:int)->float: 393 '''Get the orbital period of a vessel by its craft ID in seconds.''' 394 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_period']}<<{craft_ID}") 395 return rec[0] 396 def craft_apoapsis_time(craft_ID:int)->float: 397 '''Get the time to current vessel''' 398 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_apoapsis_time']}<<{craft_ID}") 399 return rec[0] 400 def craft_periapsis_time(craft_ID:int)->float: 401 '''Get the time to current vessel's periapsis in seconds.''' 402 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_periapsis_time']}<<{craft_ID}") 403 return rec[0] 404 def craft_inclination(craft_ID:int)->float: 405 '''Get the inclination of a vessel by its craft ID in radians.''' 406 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_inclination']}<<{craft_ID}") 407 return rec[0] 408 def craft_eccentricity(craft_ID:int)->float: 409 '''Get the eccentricity of a vessel by its craft ID.''' 410 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_eccentricity']}<<{craft_ID}") 411 return rec[0] 412 def craft_mean_anomaly(craft_ID:int)->float: 413 '''Get the mean anomaly of a vessel by its craft ID in radians.''' 414 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_mean_anomaly']}<<{craft_ID}") 415 return rec[0] 416 def craft_mean_motion(craft_ID:int)->float: 417 '''Get the mean motion of a vessel by its craft ID in radians/second.''' 418 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_mean_motion']}<<{craft_ID}") 419 return rec[0] 420 def craft_periapsis_argument(craft_ID:int)->float: 421 '''Get the argument of periapsis of a vessel by its craft ID in radians.''' 422 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_periapsis_argument']}<<{craft_ID}") 423 return rec[0] 424 def craft_right_ascension(craft_ID:int)->float: 425 '''Get the right ascension of a vessel by its craft ID in radians.''' 426 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_right_ascension']}<<{craft_ID}") 427 return rec[0] 428 def craft_true_anomaly(craft_ID:int)->float: 429 '''Get the true anomaly of a vessel by its craft ID in radians.''' 430 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_true_anomaly']}<<{craft_ID}") 431 return rec[0] 432 def craft_SMA(craft_ID:int)->float: 433 '''Get the semi-major axis of a vessel by its craft ID in meters.''' 434 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_SMA']}<<{craft_ID}") 435 return rec[0] 436 437_CRAFT_INPUT_SIGNAL = { 438 'roll' : 330, 439 'pitch' : 331, 440 'yaw' : 332, 441 'throttle' : 333, 442 'brake' : 334, 443 'slider1' : 335, 444 'slider2' : 336, 445 'slider3' : 337, 446 'slider4' : 338, 447 'translate_foraward' : 339, 448 'translate_right' : 340, 449 'translate_up' : 341, 450 'translate_mode' : 342, 451 'pitch_pids' : 343, 452 'roll_pids' : 344 453} 454 455class input: 456 def roll()->float: 457 '''Get the current vessel's roll input value.''' 458 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['roll']}") 459 return rec[0] 460 def pitch()->float: 461 '''Get the current vessel's pitch input value.''' 462 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['pitch']}") 463 return rec[0] 464 def yaw()->float: 465 '''Get the current vessel's yaw input value.''' 466 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['yaw']}") 467 return rec[0] 468 def throttle()->float: 469 '''Get the current vessel's throttle input value.''' 470 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['throttle']}") 471 return rec[0] 472 def brake()->float: 473 '''Get the current vessel's brake input value.''' 474 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['brake']}") 475 return rec[0] 476 def slider1()->float: 477 '''Get the current vessel's slider1 input value.''' 478 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['slider1']}") 479 return rec[0] 480 def slider2()->float: 481 '''Get the current vessel's slider2 input value.''' 482 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['slider2']}") 483 return rec[0] 484 def slider3()->float: 485 '''Get the current vessel's slider3 input value.''' 486 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['slider3']}") 487 return rec[0] 488 def slider4()->float: 489 '''Get the current vessel's slider4 input value.''' 490 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['slider4']}") 491 return rec[0] 492 def translate_foraward()->float: 493 '''Get the current vessel's forward translation input value.''' 494 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['translate_foraward']}") 495 return rec[0] 496 def translate_right()->float: 497 '''Get the current vessel's right translation input value.''' 498 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['translate_right']}") 499 return rec[0] 500 def translate_up()->float: 501 '''Get the current vessel's up translation input value.''' 502 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['translate_up']}") 503 return rec[0] 504 def translate_mode()->float: 505 ''' 506 Get the current vessel's translation mode input value.\n 507 0.0 is attitude mode, 1.0 is translate_mode. 508 ''' 509 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['translate_mode']}") 510 return rec[0] 511 def pitch_pids()->np.ndarray: 512 '''Get the current vessel's pitch PID values as a numpy array.''' 513 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['pitch_pids']}") 514 vec = extra.tuple2array(rec[0]) 515 return vec 516 def roll_pids()->np.ndarray: 517 '''Get the current vessel's roll PID values as a numpy array.''' 518 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['roll_pids']}") 519 vec = extra.tuple2array(rec[0]) 520 return vec 521 522_CRAFT_STATUS_SIGNAL = { 523 'activing_stage' : 340, 524 'num_of_stage' : 341, 525 'ag_status' : 342, 526 'craft_is_destroyed' : 343, 527 'craft_is_player' : 344 528} 529 530class status: 531 def activing_stage()->int: 532 '''Get the current active stage number.''' 533 rec = connect._send_message(f"true<<{_CRAFT_STATUS_SIGNAL['activing_stage']}") 534 return rec[0] 535 def num_of_stage()->int: 536 '''Get the total number of stages.''' 537 rec = connect._send_message(f"true<<{_CRAFT_STATUS_SIGNAL['num_of_stage']}") 538 return rec[0] 539 def ag_status(ag:int)->bool: 540 '''Get the status of an action group.\n''' 541 rec = connect._send_message(f"true<<{_CRAFT_STATUS_SIGNAL['ag_status']}<<{ag}") 542 return rec[0] 543 def craft_is_destroyed(craft_ID:int)->bool: 544 '''Get the status of whether a vessel is destroyed.\n''' 545 rec = connect._send_message(f"true<<{_CRAFT_STATUS_SIGNAL['craft_is_destroyed']}<<{craft_ID}") 546 return rec[0] 547 def craft_is_player(craft_ID:int)->bool: 548 '''Get the status of whether a vessel is a player vessel.\n''' 549 rec = connect._send_message(f"true<<{_CRAFT_STATUS_SIGNAL['craft_is_player']}<<{craft_ID}") 550 return rec[0]
15class info: 16 def name()->str: 17 '''Get the current vessel's name.''' 18 rec = connect._send_message(f"true<<{_CRAFT_INFO_SIGNAL['name']}") 19 return rec[0] 20 def target_craftname()->str: 21 '''Get the name of the current vessel's target.''' 22 rec = connect._send_message(f"true<<{_CRAFT_INFO_SIGNAL['target_craftname']}") 23 return rec[0] 24 def craftname_of_craftID(craft_ID:int)->str: 25 '''Get the name of a vessel by its craft ID.''' 26 rec = connect._send_message(f"true<<{_CRAFT_INFO_SIGNAL['craftname_of_craftID']}<<{craft_ID}") 27 return rec[0] 28 def part_count_of_craftID(craft_ID:int)->int: 29 '''Get the part count of a vessel by its craft ID.''' 30 rec = connect._send_message(f"true<<{_CRAFT_INFO_SIGNAL['part_count_of_craftID']}<<{craft_ID}") 31 return rec[0] 32 def craftID_of_craftname(craft_name:str)->int: 33 '''Get the craft ID of a vessel by its name.''' 34 rec = connect._send_message(f"true<<{_CRAFT_INFO_SIGNAL['craftID_of_craftname']}<<{craft_name}") 35 return rec[0] 36 def planet_of_craft(craft_ID:int)->str: 37 '''Get the name of the planet that a vessel is currently orbiting.''' 38 rec = connect._send_message(f"true<<{_CRAFT_INFO_SIGNAL['planet_of_craft']}<<{craft_ID}") 39 return rec[0]
16 def name()->str: 17 '''Get the current vessel's name.''' 18 rec = connect._send_message(f"true<<{_CRAFT_INFO_SIGNAL['name']}") 19 return rec[0]
Get the current vessel's name.
20 def target_craftname()->str: 21 '''Get the name of the current vessel's target.''' 22 rec = connect._send_message(f"true<<{_CRAFT_INFO_SIGNAL['target_craftname']}") 23 return rec[0]
Get the name of the current vessel's target.
24 def craftname_of_craftID(craft_ID:int)->str: 25 '''Get the name of a vessel by its craft ID.''' 26 rec = connect._send_message(f"true<<{_CRAFT_INFO_SIGNAL['craftname_of_craftID']}<<{craft_ID}") 27 return rec[0]
Get the name of a vessel by its craft ID.
28 def part_count_of_craftID(craft_ID:int)->int: 29 '''Get the part count of a vessel by its craft ID.''' 30 rec = connect._send_message(f"true<<{_CRAFT_INFO_SIGNAL['part_count_of_craftID']}<<{craft_ID}") 31 return rec[0]
Get the part count of a vessel by its craft ID.
32 def craftID_of_craftname(craft_name:str)->int: 33 '''Get the craft ID of a vessel by its name.''' 34 rec = connect._send_message(f"true<<{_CRAFT_INFO_SIGNAL['craftID_of_craftname']}<<{craft_name}") 35 return rec[0]
Get the craft ID of a vessel by its name.
36 def planet_of_craft(craft_ID:int)->str: 37 '''Get the name of the planet that a vessel is currently orbiting.''' 38 rec = connect._send_message(f"true<<{_CRAFT_INFO_SIGNAL['planet_of_craft']}<<{craft_ID}") 39 return rec[0]
Get the name of the planet that a vessel is currently orbiting.
48class fuel: 49 def battery()->float: 50 '''Get the current total battery percentage of the vessel.''' 51 rec = connect._send_message(f"true<<{_CRAFT_FUEL_SIGNAL['battery']}") 52 return rec[0] 53 def stage_fuel()->float: 54 '''Get the current fuel mass percentage of the active stage.''' 55 rec = connect._send_message(f"true<<{_CRAFT_FUEL_SIGNAL['stage_fuel']}") 56 return rec[0] 57 def mono_fuel()->float: 58 '''Get the current monopropellant mass percentage of the vessel.''' 59 rec = connect._send_message(f"true<<{_CRAFT_FUEL_SIGNAL['mono_fuel']}") 60 return rec[0] 61 def all_stage_fuel()->float: 62 '''Get the current fuel mass percentage of all stages.''' 63 rec = connect._send_message(f"true<<{_CRAFT_FUEL_SIGNAL['all_stage_fuel']}") 64 return rec[0]
49 def battery()->float: 50 '''Get the current total battery percentage of the vessel.''' 51 rec = connect._send_message(f"true<<{_CRAFT_FUEL_SIGNAL['battery']}") 52 return rec[0]
Get the current total battery percentage of the vessel.
53 def stage_fuel()->float: 54 '''Get the current fuel mass percentage of the active stage.''' 55 rec = connect._send_message(f"true<<{_CRAFT_FUEL_SIGNAL['stage_fuel']}") 56 return rec[0]
Get the current fuel mass percentage of the active stage.
80class performance: 81 def current_engine_thrust()->float: 82 '''Get the current total thrust of all active engines in N.''' 83 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['current_engine_thrust']}") 84 return rec[0] 85 def mass()->float: 86 '''Get the current mass of the vessel in kg.''' 87 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['mass']}") 88 return rec[0] 89 def dry_mass()->float: 90 '''Get the current dry mass of the vessel in kg.''' 91 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['dry_mass']}") 92 return rec[0] 93 def fuel_mass()->float: 94 '''Get the current fuel mass of the vessel in kg.''' 95 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['fuel_mass']}") 96 return rec[0] 97 def max_engine_thrust()->float: 98 '''Get the maximum total thrust of all engines in N.''' 99 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['max_engine_thrust']}") 100 return rec[0] 101 def TWR()->float: 102 '''Get the current TWR of the vessel.''' 103 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['TWR']}") 104 return rec[0] 105 def ISP()->float: 106 '''Get the current ISP of the vessel in seconds.''' 107 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['ISP']}") 108 return rec[0] 109 def stage_delta_v()->float: 110 '''Get the delta-v of the current stage in m/s.''' 111 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['stage_delta_v']}") 112 return rec[0] 113 def stage_burn_time()->float: 114 '''Get the burn time of the current stage in seconds.''' 115 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['stage_burn_time']}") 116 return rec[0] 117 def solar_radition()->float: 118 '''Get the solar radiation at the current vessel's location in W/m^2.''' 119 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['solar_radition']}") 120 return rec[0] 121 def craft_mass(craft_ID:int)->float: 122 '''Get the mass of a vessel by its craft ID in kg.''' 123 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['craft_mass']}<<{craft_ID}") 124 return rec[0]
81 def current_engine_thrust()->float: 82 '''Get the current total thrust of all active engines in N.''' 83 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['current_engine_thrust']}") 84 return rec[0]
Get the current total thrust of all active engines in N.
85 def mass()->float: 86 '''Get the current mass of the vessel in kg.''' 87 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['mass']}") 88 return rec[0]
Get the current mass of the vessel in kg.
89 def dry_mass()->float: 90 '''Get the current dry mass of the vessel in kg.''' 91 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['dry_mass']}") 92 return rec[0]
Get the current dry mass of the vessel in kg.
93 def fuel_mass()->float: 94 '''Get the current fuel mass of the vessel in kg.''' 95 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['fuel_mass']}") 96 return rec[0]
Get the current fuel mass of the vessel in kg.
97 def max_engine_thrust()->float: 98 '''Get the maximum total thrust of all engines in N.''' 99 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['max_engine_thrust']}") 100 return rec[0]
Get the maximum total thrust of all engines in N.
101 def TWR()->float: 102 '''Get the current TWR of the vessel.''' 103 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['TWR']}") 104 return rec[0]
Get the current TWR of the vessel.
105 def ISP()->float: 106 '''Get the current ISP of the vessel in seconds.''' 107 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['ISP']}") 108 return rec[0]
Get the current ISP of the vessel in seconds.
109 def stage_delta_v()->float: 110 '''Get the delta-v of the current stage in m/s.''' 111 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['stage_delta_v']}") 112 return rec[0]
Get the delta-v of the current stage in m/s.
113 def stage_burn_time()->float: 114 '''Get the burn time of the current stage in seconds.''' 115 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['stage_burn_time']}") 116 return rec[0]
Get the burn time of the current stage in seconds.
117 def solar_radition()->float: 118 '''Get the solar radiation at the current vessel's location in W/m^2.''' 119 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['solar_radition']}") 120 return rec[0]
Get the solar radiation at the current vessel's location in W/m^2.
121 def craft_mass(craft_ID:int)->float: 122 '''Get the mass of a vessel by its craft ID in kg.''' 123 rec = connect._send_message(f"true<<{_CRAFT_PERFORMANCE_SIGNAL['craft_mass']}<<{craft_ID}") 124 return rec[0]
Get the mass of a vessel by its craft ID in kg.
142class attitude: 143 def craft_heading()->float: 144 ''' 145 Get the current vessel's heading in degrees.\n 146 0 degrees means the vessel is heading towards the north 147 and the angle increases clockwise. 148 ''' 149 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_heading']}") 150 return rec[0] 151 def craft_pitching()->float: 152 ''' 153 Get the current vessel's pitching in degrees.\n 154 90 degrees means the vessel is flying vertically, 155 0 degrees means the vessel is flying horizontally. 156 ''' 157 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_pitching']}") 158 return rec[0] 159 def craft_autopilot_heading()->float: 160 '''Get the current vessel's autopilot heading in degrees.''' 161 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_autopilot_heading']}") 162 return rec[0] 163 def craft_autopilot_pitching()->float: 164 '''Get the current vessel's autopilot pitching in degrees.''' 165 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_autopilot_pitching']}") 166 return rec[0] 167 def craft_bank_angle()->float: 168 '''Get the current vessel's bank angle in degrees.''' 169 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_bank_angle']}") 170 return rec[0] 171 def craft_AOA()->float: 172 '''Get the current vessel's angle of attack in degrees.''' 173 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_AOA']}") 174 return rec[0] 175 def craft_side_slip()->float: 176 '''Get the current vessel's side slip angle in degrees.''' 177 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_side_slip']}") 178 return rec[0] 179 def craft_north_vector()->np.ndarray: 180 '''Get the current vessel's north vector in ECI coordinates.''' 181 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_north_vector']}") 182 vec = extra.tuple2array(rec[0]) 183 return vec 184 def craft_east_vector()->np.ndarray: 185 '''Get the current vessel's east vector in ECI coordinates.''' 186 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_east_vector']}") 187 vec = extra.tuple2array(rec[0]) 188 return vec 189 def craft_roll_axis()->np.ndarray: 190 '''Get the current vessel's roll axis in ECI coordinates.''' 191 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_roll_axis']}") 192 vec = extra.tuple2array(rec[0]) 193 return vec 194 def craft_pitch_axis()->np.ndarray: 195 '''Get the current vessel's pitch axis in ECI coordinates.''' 196 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_pitch_axis']}") 197 vec = extra.tuple2array(rec[0]) 198 return vec 199 def craft_yaw_axis()->np.ndarray: 200 '''Get the current vessel's yaw axis in ECI coordinates.''' 201 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_yaw_axis']}") 202 vec = extra.tuple2array(rec[0]) 203 return vec
143 def craft_heading()->float: 144 ''' 145 Get the current vessel's heading in degrees.\n 146 0 degrees means the vessel is heading towards the north 147 and the angle increases clockwise. 148 ''' 149 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_heading']}") 150 return rec[0]
Get the current vessel's heading in degrees.
0 degrees means the vessel is heading towards the north and the angle increases clockwise.
151 def craft_pitching()->float: 152 ''' 153 Get the current vessel's pitching in degrees.\n 154 90 degrees means the vessel is flying vertically, 155 0 degrees means the vessel is flying horizontally. 156 ''' 157 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_pitching']}") 158 return rec[0]
Get the current vessel's pitching in degrees.
90 degrees means the vessel is flying vertically, 0 degrees means the vessel is flying horizontally.
159 def craft_autopilot_heading()->float: 160 '''Get the current vessel's autopilot heading in degrees.''' 161 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_autopilot_heading']}") 162 return rec[0]
Get the current vessel's autopilot heading in degrees.
163 def craft_autopilot_pitching()->float: 164 '''Get the current vessel's autopilot pitching in degrees.''' 165 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_autopilot_pitching']}") 166 return rec[0]
Get the current vessel's autopilot pitching in degrees.
167 def craft_bank_angle()->float: 168 '''Get the current vessel's bank angle in degrees.''' 169 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_bank_angle']}") 170 return rec[0]
Get the current vessel's bank angle in degrees.
171 def craft_AOA()->float: 172 '''Get the current vessel's angle of attack in degrees.''' 173 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_AOA']}") 174 return rec[0]
Get the current vessel's angle of attack in degrees.
175 def craft_side_slip()->float: 176 '''Get the current vessel's side slip angle in degrees.''' 177 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_side_slip']}") 178 return rec[0]
Get the current vessel's side slip angle in degrees.
179 def craft_north_vector()->np.ndarray: 180 '''Get the current vessel's north vector in ECI coordinates.''' 181 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_north_vector']}") 182 vec = extra.tuple2array(rec[0]) 183 return vec
Get the current vessel's north vector in ECI coordinates.
184 def craft_east_vector()->np.ndarray: 185 '''Get the current vessel's east vector in ECI coordinates.''' 186 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_east_vector']}") 187 vec = extra.tuple2array(rec[0]) 188 return vec
Get the current vessel's east vector in ECI coordinates.
189 def craft_roll_axis()->np.ndarray: 190 '''Get the current vessel's roll axis in ECI coordinates.''' 191 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_roll_axis']}") 192 vec = extra.tuple2array(rec[0]) 193 return vec
Get the current vessel's roll axis in ECI coordinates.
194 def craft_pitch_axis()->np.ndarray: 195 '''Get the current vessel's pitch axis in ECI coordinates.''' 196 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_pitch_axis']}") 197 vec = extra.tuple2array(rec[0]) 198 return vec
Get the current vessel's pitch axis in ECI coordinates.
199 def craft_yaw_axis()->np.ndarray: 200 '''Get the current vessel's yaw axis in ECI coordinates.''' 201 rec = connect._send_message(f"true<<{_CRAFT_ATTITUDE_SIGNAL['craft_yaw_axis']}") 202 vec = extra.tuple2array(rec[0]) 203 return vec
Get the current vessel's yaw axis in ECI coordinates.
219class velocity: 220 def surface_velocity()->np.ndarray: 221 '''Get the current vessel's surface velocity in ECI coordinates.''' 222 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['surface_velocity']}") 223 vec = extra.tuple2array(rec[0]) 224 return vec 225 def orbit_velocity()->np.ndarray: 226 '''Get the current vessel's orbit velocity in ECI coordinates.''' 227 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['orbit_velocity']}") 228 vec = extra.tuple2array(rec[0]) 229 return vec 230 def target_velocity()->np.ndarray: 231 '''Get the current vessel's target velocity in ECI coordinates.''' 232 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['target_velocity']}") 233 vec = extra.tuple2array(rec[0]) 234 return vec 235 def gravity()->np.ndarray: 236 '''Get the current vessel's gravity in ECI coordinates.''' 237 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['gravity']}") 238 vec = extra.tuple2array(rec[0]) 239 return vec 240 def drag()->np.ndarray: 241 '''Get the current vessel's drag in ECI coordinates.''' 242 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['drag']}") 243 vec = extra.tuple2array(rec[0]) 244 return vec 245 def acceleration()->np.ndarray: 246 '''Get the current vessel's acceleration in ECI coordinates.''' 247 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['acceleration']}") 248 vec = extra.tuple2array(rec[0]) 249 return vec 250 def angular()->np.ndarray: 251 '''Get the current vessel's angular velocity in ECI coordinates.''' 252 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['angular']}") 253 vec = extra.tuple2array(rec[0]) 254 return vec 255 def lateral()->float: 256 '''Get the current vessel's lateral velocity in m/s.''' 257 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['lateral']}") 258 return rec[0] 259 def vertical()->float: 260 '''Get the current vessel's vertical velocity in m/s.''' 261 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['vertical']}") 262 return rec[0] 263 def mach_number()->float: 264 '''Get the current vessel's Mach number.''' 265 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['mach_number']}") 266 return rec[0] 267 def craft_velocity(craft_ID:int)->np.ndarray: 268 '''Get the velocity of a vessel by its craft ID in ECI coordinates.''' 269 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['craft_velocity']}") 270 vec = extra.tuple2array(rec[0]) 271 return vec
220 def surface_velocity()->np.ndarray: 221 '''Get the current vessel's surface velocity in ECI coordinates.''' 222 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['surface_velocity']}") 223 vec = extra.tuple2array(rec[0]) 224 return vec
Get the current vessel's surface velocity in ECI coordinates.
225 def orbit_velocity()->np.ndarray: 226 '''Get the current vessel's orbit velocity in ECI coordinates.''' 227 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['orbit_velocity']}") 228 vec = extra.tuple2array(rec[0]) 229 return vec
Get the current vessel's orbit velocity in ECI coordinates.
230 def target_velocity()->np.ndarray: 231 '''Get the current vessel's target velocity in ECI coordinates.''' 232 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['target_velocity']}") 233 vec = extra.tuple2array(rec[0]) 234 return vec
Get the current vessel's target velocity in ECI coordinates.
235 def gravity()->np.ndarray: 236 '''Get the current vessel's gravity in ECI coordinates.''' 237 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['gravity']}") 238 vec = extra.tuple2array(rec[0]) 239 return vec
Get the current vessel's gravity in ECI coordinates.
240 def drag()->np.ndarray: 241 '''Get the current vessel's drag in ECI coordinates.''' 242 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['drag']}") 243 vec = extra.tuple2array(rec[0]) 244 return vec
Get the current vessel's drag in ECI coordinates.
245 def acceleration()->np.ndarray: 246 '''Get the current vessel's acceleration in ECI coordinates.''' 247 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['acceleration']}") 248 vec = extra.tuple2array(rec[0]) 249 return vec
Get the current vessel's acceleration in ECI coordinates.
250 def angular()->np.ndarray: 251 '''Get the current vessel's angular velocity in ECI coordinates.''' 252 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['angular']}") 253 vec = extra.tuple2array(rec[0]) 254 return vec
Get the current vessel's angular velocity in ECI coordinates.
255 def lateral()->float: 256 '''Get the current vessel's lateral velocity in m/s.''' 257 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['lateral']}") 258 return rec[0]
Get the current vessel's lateral velocity in m/s.
259 def vertical()->float: 260 '''Get the current vessel's vertical velocity in m/s.''' 261 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['vertical']}") 262 return rec[0]
Get the current vessel's vertical velocity in m/s.
263 def mach_number()->float: 264 '''Get the current vessel's Mach number.''' 265 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['mach_number']}") 266 return rec[0]
Get the current vessel's Mach number.
267 def craft_velocity(craft_ID:int)->np.ndarray: 268 '''Get the velocity of a vessel by its craft ID in ECI coordinates.''' 269 rec = connect._send_message(f"true<<{_CRAFT_VELOCITY_SIGNAL['craft_velocity']}") 270 vec = extra.tuple2array(rec[0]) 271 return vec
Get the velocity of a vessel by its craft ID in ECI coordinates.
285class position: 286 def AGL()->float: 287 '''Get the current vessel's altitude above ground level in meters.''' 288 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['AGL']}") 289 return rec[0] 290 def ASL()->float: 291 '''Get the current vessel's altitude above sea level in meters.''' 292 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['ASL']}") 293 return rec[0] 294 def ASF()->float: 295 '''Get the current vessel's altitude above seabed in meters.''' 296 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['ASF']}") 297 return rec[0] 298 def craft_ASL(craft_ID:int)->float: 299 '''Get the altitude above sea level of a vessel in meters.''' 300 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['craft_ASL']}<<{craft_ID}") 301 return rec[0] 302 def is_ground()->bool: 303 '''Get whether the current vessel is on the ground.\n 304 T means the vessel is on the ground, F means it's not. 305 ''' 306 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['is_ground']}") 307 return rec[0] 308 def craft_is_ground(craft_id:int)->bool: 309 '''Get whether a vessel is on the ground.\n 310 T means the vessel is on the ground, F means it's not. 311 ''' 312 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['craft_is_ground']}<<{craft_id}") 313 return rec[0] 314 def ECI_position()->np.ndarray: 315 '''Get the current vessel's position in ECI coordinates.''' 316 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['ECI_position']}") 317 vec = extra.tuple2array(rec[0]) 318 return vec 319 def target_ECI_position()->np.ndarray: 320 '''Get the target vessel's position in ECI coordinates.''' 321 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['target_ECI_position']}") 322 vec = extra.tuple2array(rec[0]) 323 return vec 324 def craft_ECI_position(craft_ID:int)->np.ndarray: 325 '''Get the position of a vessel by its craft ID in ECI coordinates.''' 326 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['craft_ECI_position']}<<{craft_ID}") 327 vec = extra.tuple2array(rec[0]) 328 return vec
286 def AGL()->float: 287 '''Get the current vessel's altitude above ground level in meters.''' 288 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['AGL']}") 289 return rec[0]
Get the current vessel's altitude above ground level in meters.
290 def ASL()->float: 291 '''Get the current vessel's altitude above sea level in meters.''' 292 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['ASL']}") 293 return rec[0]
Get the current vessel's altitude above sea level in meters.
294 def ASF()->float: 295 '''Get the current vessel's altitude above seabed in meters.''' 296 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['ASF']}") 297 return rec[0]
Get the current vessel's altitude above seabed in meters.
298 def craft_ASL(craft_ID:int)->float: 299 '''Get the altitude above sea level of a vessel in meters.''' 300 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['craft_ASL']}<<{craft_ID}") 301 return rec[0]
Get the altitude above sea level of a vessel in meters.
302 def is_ground()->bool: 303 '''Get whether the current vessel is on the ground.\n 304 T means the vessel is on the ground, F means it's not. 305 ''' 306 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['is_ground']}") 307 return rec[0]
Get whether the current vessel is on the ground.
T means the vessel is on the ground, F means it's not.
308 def craft_is_ground(craft_id:int)->bool: 309 '''Get whether a vessel is on the ground.\n 310 T means the vessel is on the ground, F means it's not. 311 ''' 312 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['craft_is_ground']}<<{craft_id}") 313 return rec[0]
Get whether a vessel is on the ground.
T means the vessel is on the ground, F means it's not.
314 def ECI_position()->np.ndarray: 315 '''Get the current vessel's position in ECI coordinates.''' 316 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['ECI_position']}") 317 vec = extra.tuple2array(rec[0]) 318 return vec
Get the current vessel's position in ECI coordinates.
319 def target_ECI_position()->np.ndarray: 320 '''Get the target vessel's position in ECI coordinates.''' 321 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['target_ECI_position']}") 322 vec = extra.tuple2array(rec[0]) 323 return vec
Get the target vessel's position in ECI coordinates.
324 def craft_ECI_position(craft_ID:int)->np.ndarray: 325 '''Get the position of a vessel by its craft ID in ECI coordinates.''' 326 rec = connect._send_message(f"true<<{_CRAFT_POSITION_SIGNAL['craft_ECI_position']}<<{craft_ID}") 327 vec = extra.tuple2array(rec[0]) 328 return vec
Get the position of a vessel by its craft ID in ECI coordinates.
354class orbit: 355 def apoapsis()->float: 356 '''Get the current vessel's apoapsis altitude in meters.''' 357 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['apoapsis']}") 358 return rec[0] 359 def periapsis()->float: 360 '''Get the current vessel's periapsis altitude in meters.''' 361 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['periapsis']}") 362 return rec[0] 363 def apoapsis_time()->float: 364 '''Get the time to current vessel's apoapsis in seconds.''' 365 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['apoapsis_time']}") 366 return rec[0] 367 def periapsis_time()->float: 368 '''Get the time to current vessel's periapsis in seconds.''' 369 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['periapsis_time']}") 370 return rec[0] 371 def eccentricity()->float: 372 '''Get the eccentricity of the current vessel's orbit.''' 373 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['eccentricity']}") 374 return rec[0] 375 def inclination()->float: 376 '''Get the inclination of the current vessel's orbit in radians.''' 377 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['inclination']}") 378 return rec[0] 379 def period()->float: 380 '''Get the current vessel's orbital period in seconds.''' 381 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['period']}") 382 return rec[0] 383 def craft_apoapsis_position(craft_ID:int)->np.ndarray: 384 '''Get the apoapsis position of a vessel by its craft ID in ECI coordinates.''' 385 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_apoapsis_position']}<<{craft_ID}") 386 vec = extra.tuple2array(rec[0]) 387 return vec 388 def craft_periapsis_position(craft_ID:int)->np.ndarray: 389 '''Get the periapsis position of a vessel by its craft ID in ECI coordinates.''' 390 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_periapsis_position']}<<{craft_ID}") 391 vec = extra.tuple2array(rec[0]) 392 return vec 393 def craft_period(craft_ID:int)->float: 394 '''Get the orbital period of a vessel by its craft ID in seconds.''' 395 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_period']}<<{craft_ID}") 396 return rec[0] 397 def craft_apoapsis_time(craft_ID:int)->float: 398 '''Get the time to current vessel''' 399 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_apoapsis_time']}<<{craft_ID}") 400 return rec[0] 401 def craft_periapsis_time(craft_ID:int)->float: 402 '''Get the time to current vessel's periapsis in seconds.''' 403 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_periapsis_time']}<<{craft_ID}") 404 return rec[0] 405 def craft_inclination(craft_ID:int)->float: 406 '''Get the inclination of a vessel by its craft ID in radians.''' 407 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_inclination']}<<{craft_ID}") 408 return rec[0] 409 def craft_eccentricity(craft_ID:int)->float: 410 '''Get the eccentricity of a vessel by its craft ID.''' 411 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_eccentricity']}<<{craft_ID}") 412 return rec[0] 413 def craft_mean_anomaly(craft_ID:int)->float: 414 '''Get the mean anomaly of a vessel by its craft ID in radians.''' 415 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_mean_anomaly']}<<{craft_ID}") 416 return rec[0] 417 def craft_mean_motion(craft_ID:int)->float: 418 '''Get the mean motion of a vessel by its craft ID in radians/second.''' 419 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_mean_motion']}<<{craft_ID}") 420 return rec[0] 421 def craft_periapsis_argument(craft_ID:int)->float: 422 '''Get the argument of periapsis of a vessel by its craft ID in radians.''' 423 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_periapsis_argument']}<<{craft_ID}") 424 return rec[0] 425 def craft_right_ascension(craft_ID:int)->float: 426 '''Get the right ascension of a vessel by its craft ID in radians.''' 427 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_right_ascension']}<<{craft_ID}") 428 return rec[0] 429 def craft_true_anomaly(craft_ID:int)->float: 430 '''Get the true anomaly of a vessel by its craft ID in radians.''' 431 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_true_anomaly']}<<{craft_ID}") 432 return rec[0] 433 def craft_SMA(craft_ID:int)->float: 434 '''Get the semi-major axis of a vessel by its craft ID in meters.''' 435 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_SMA']}<<{craft_ID}") 436 return rec[0]
355 def apoapsis()->float: 356 '''Get the current vessel's apoapsis altitude in meters.''' 357 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['apoapsis']}") 358 return rec[0]
Get the current vessel's apoapsis altitude in meters.
359 def periapsis()->float: 360 '''Get the current vessel's periapsis altitude in meters.''' 361 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['periapsis']}") 362 return rec[0]
Get the current vessel's periapsis altitude in meters.
363 def apoapsis_time()->float: 364 '''Get the time to current vessel's apoapsis in seconds.''' 365 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['apoapsis_time']}") 366 return rec[0]
Get the time to current vessel's apoapsis in seconds.
367 def periapsis_time()->float: 368 '''Get the time to current vessel's periapsis in seconds.''' 369 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['periapsis_time']}") 370 return rec[0]
Get the time to current vessel's periapsis in seconds.
371 def eccentricity()->float: 372 '''Get the eccentricity of the current vessel's orbit.''' 373 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['eccentricity']}") 374 return rec[0]
Get the eccentricity of the current vessel's orbit.
375 def inclination()->float: 376 '''Get the inclination of the current vessel's orbit in radians.''' 377 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['inclination']}") 378 return rec[0]
Get the inclination of the current vessel's orbit in radians.
379 def period()->float: 380 '''Get the current vessel's orbital period in seconds.''' 381 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['period']}") 382 return rec[0]
Get the current vessel's orbital period in seconds.
383 def craft_apoapsis_position(craft_ID:int)->np.ndarray: 384 '''Get the apoapsis position of a vessel by its craft ID in ECI coordinates.''' 385 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_apoapsis_position']}<<{craft_ID}") 386 vec = extra.tuple2array(rec[0]) 387 return vec
Get the apoapsis position of a vessel by its craft ID in ECI coordinates.
388 def craft_periapsis_position(craft_ID:int)->np.ndarray: 389 '''Get the periapsis position of a vessel by its craft ID in ECI coordinates.''' 390 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_periapsis_position']}<<{craft_ID}") 391 vec = extra.tuple2array(rec[0]) 392 return vec
Get the periapsis position of a vessel by its craft ID in ECI coordinates.
393 def craft_period(craft_ID:int)->float: 394 '''Get the orbital period of a vessel by its craft ID in seconds.''' 395 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_period']}<<{craft_ID}") 396 return rec[0]
Get the orbital period of a vessel by its craft ID in seconds.
397 def craft_apoapsis_time(craft_ID:int)->float: 398 '''Get the time to current vessel''' 399 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_apoapsis_time']}<<{craft_ID}") 400 return rec[0]
Get the time to current vessel
401 def craft_periapsis_time(craft_ID:int)->float: 402 '''Get the time to current vessel's periapsis in seconds.''' 403 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_periapsis_time']}<<{craft_ID}") 404 return rec[0]
Get the time to current vessel's periapsis in seconds.
405 def craft_inclination(craft_ID:int)->float: 406 '''Get the inclination of a vessel by its craft ID in radians.''' 407 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_inclination']}<<{craft_ID}") 408 return rec[0]
Get the inclination of a vessel by its craft ID in radians.
409 def craft_eccentricity(craft_ID:int)->float: 410 '''Get the eccentricity of a vessel by its craft ID.''' 411 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_eccentricity']}<<{craft_ID}") 412 return rec[0]
Get the eccentricity of a vessel by its craft ID.
413 def craft_mean_anomaly(craft_ID:int)->float: 414 '''Get the mean anomaly of a vessel by its craft ID in radians.''' 415 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_mean_anomaly']}<<{craft_ID}") 416 return rec[0]
Get the mean anomaly of a vessel by its craft ID in radians.
417 def craft_mean_motion(craft_ID:int)->float: 418 '''Get the mean motion of a vessel by its craft ID in radians/second.''' 419 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_mean_motion']}<<{craft_ID}") 420 return rec[0]
Get the mean motion of a vessel by its craft ID in radians/second.
421 def craft_periapsis_argument(craft_ID:int)->float: 422 '''Get the argument of periapsis of a vessel by its craft ID in radians.''' 423 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_periapsis_argument']}<<{craft_ID}") 424 return rec[0]
Get the argument of periapsis of a vessel by its craft ID in radians.
425 def craft_right_ascension(craft_ID:int)->float: 426 '''Get the right ascension of a vessel by its craft ID in radians.''' 427 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_right_ascension']}<<{craft_ID}") 428 return rec[0]
Get the right ascension of a vessel by its craft ID in radians.
429 def craft_true_anomaly(craft_ID:int)->float: 430 '''Get the true anomaly of a vessel by its craft ID in radians.''' 431 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_true_anomaly']}<<{craft_ID}") 432 return rec[0]
Get the true anomaly of a vessel by its craft ID in radians.
433 def craft_SMA(craft_ID:int)->float: 434 '''Get the semi-major axis of a vessel by its craft ID in meters.''' 435 rec = connect._send_message(f"true<<{_CRAFT_ORBIT_SIGNAL['craft_SMA']}<<{craft_ID}") 436 return rec[0]
Get the semi-major axis of a vessel by its craft ID in meters.
456class input: 457 def roll()->float: 458 '''Get the current vessel's roll input value.''' 459 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['roll']}") 460 return rec[0] 461 def pitch()->float: 462 '''Get the current vessel's pitch input value.''' 463 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['pitch']}") 464 return rec[0] 465 def yaw()->float: 466 '''Get the current vessel's yaw input value.''' 467 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['yaw']}") 468 return rec[0] 469 def throttle()->float: 470 '''Get the current vessel's throttle input value.''' 471 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['throttle']}") 472 return rec[0] 473 def brake()->float: 474 '''Get the current vessel's brake input value.''' 475 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['brake']}") 476 return rec[0] 477 def slider1()->float: 478 '''Get the current vessel's slider1 input value.''' 479 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['slider1']}") 480 return rec[0] 481 def slider2()->float: 482 '''Get the current vessel's slider2 input value.''' 483 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['slider2']}") 484 return rec[0] 485 def slider3()->float: 486 '''Get the current vessel's slider3 input value.''' 487 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['slider3']}") 488 return rec[0] 489 def slider4()->float: 490 '''Get the current vessel's slider4 input value.''' 491 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['slider4']}") 492 return rec[0] 493 def translate_foraward()->float: 494 '''Get the current vessel's forward translation input value.''' 495 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['translate_foraward']}") 496 return rec[0] 497 def translate_right()->float: 498 '''Get the current vessel's right translation input value.''' 499 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['translate_right']}") 500 return rec[0] 501 def translate_up()->float: 502 '''Get the current vessel's up translation input value.''' 503 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['translate_up']}") 504 return rec[0] 505 def translate_mode()->float: 506 ''' 507 Get the current vessel's translation mode input value.\n 508 0.0 is attitude mode, 1.0 is translate_mode. 509 ''' 510 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['translate_mode']}") 511 return rec[0] 512 def pitch_pids()->np.ndarray: 513 '''Get the current vessel's pitch PID values as a numpy array.''' 514 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['pitch_pids']}") 515 vec = extra.tuple2array(rec[0]) 516 return vec 517 def roll_pids()->np.ndarray: 518 '''Get the current vessel's roll PID values as a numpy array.''' 519 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['roll_pids']}") 520 vec = extra.tuple2array(rec[0]) 521 return vec
457 def roll()->float: 458 '''Get the current vessel's roll input value.''' 459 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['roll']}") 460 return rec[0]
Get the current vessel's roll input value.
461 def pitch()->float: 462 '''Get the current vessel's pitch input value.''' 463 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['pitch']}") 464 return rec[0]
Get the current vessel's pitch input value.
465 def yaw()->float: 466 '''Get the current vessel's yaw input value.''' 467 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['yaw']}") 468 return rec[0]
Get the current vessel's yaw input value.
469 def throttle()->float: 470 '''Get the current vessel's throttle input value.''' 471 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['throttle']}") 472 return rec[0]
Get the current vessel's throttle input value.
473 def brake()->float: 474 '''Get the current vessel's brake input value.''' 475 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['brake']}") 476 return rec[0]
Get the current vessel's brake input value.
477 def slider1()->float: 478 '''Get the current vessel's slider1 input value.''' 479 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['slider1']}") 480 return rec[0]
Get the current vessel's slider1 input value.
481 def slider2()->float: 482 '''Get the current vessel's slider2 input value.''' 483 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['slider2']}") 484 return rec[0]
Get the current vessel's slider2 input value.
485 def slider3()->float: 486 '''Get the current vessel's slider3 input value.''' 487 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['slider3']}") 488 return rec[0]
Get the current vessel's slider3 input value.
489 def slider4()->float: 490 '''Get the current vessel's slider4 input value.''' 491 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['slider4']}") 492 return rec[0]
Get the current vessel's slider4 input value.
493 def translate_foraward()->float: 494 '''Get the current vessel's forward translation input value.''' 495 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['translate_foraward']}") 496 return rec[0]
Get the current vessel's forward translation input value.
497 def translate_right()->float: 498 '''Get the current vessel's right translation input value.''' 499 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['translate_right']}") 500 return rec[0]
Get the current vessel's right translation input value.
501 def translate_up()->float: 502 '''Get the current vessel's up translation input value.''' 503 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['translate_up']}") 504 return rec[0]
Get the current vessel's up translation input value.
505 def translate_mode()->float: 506 ''' 507 Get the current vessel's translation mode input value.\n 508 0.0 is attitude mode, 1.0 is translate_mode. 509 ''' 510 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['translate_mode']}") 511 return rec[0]
Get the current vessel's translation mode input value.
0.0 is attitude mode, 1.0 is translate_mode.
512 def pitch_pids()->np.ndarray: 513 '''Get the current vessel's pitch PID values as a numpy array.''' 514 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['pitch_pids']}") 515 vec = extra.tuple2array(rec[0]) 516 return vec
Get the current vessel's pitch PID values as a numpy array.
517 def roll_pids()->np.ndarray: 518 '''Get the current vessel's roll PID values as a numpy array.''' 519 rec = connect._send_message(f"true<<{_CRAFT_INPUT_SIGNAL['roll_pids']}") 520 vec = extra.tuple2array(rec[0]) 521 return vec
Get the current vessel's roll PID values as a numpy array.
531class status: 532 def activing_stage()->int: 533 '''Get the current active stage number.''' 534 rec = connect._send_message(f"true<<{_CRAFT_STATUS_SIGNAL['activing_stage']}") 535 return rec[0] 536 def num_of_stage()->int: 537 '''Get the total number of stages.''' 538 rec = connect._send_message(f"true<<{_CRAFT_STATUS_SIGNAL['num_of_stage']}") 539 return rec[0] 540 def ag_status(ag:int)->bool: 541 '''Get the status of an action group.\n''' 542 rec = connect._send_message(f"true<<{_CRAFT_STATUS_SIGNAL['ag_status']}<<{ag}") 543 return rec[0] 544 def craft_is_destroyed(craft_ID:int)->bool: 545 '''Get the status of whether a vessel is destroyed.\n''' 546 rec = connect._send_message(f"true<<{_CRAFT_STATUS_SIGNAL['craft_is_destroyed']}<<{craft_ID}") 547 return rec[0] 548 def craft_is_player(craft_ID:int)->bool: 549 '''Get the status of whether a vessel is a player vessel.\n''' 550 rec = connect._send_message(f"true<<{_CRAFT_STATUS_SIGNAL['craft_is_player']}<<{craft_ID}") 551 return rec[0]
532 def activing_stage()->int: 533 '''Get the current active stage number.''' 534 rec = connect._send_message(f"true<<{_CRAFT_STATUS_SIGNAL['activing_stage']}") 535 return rec[0]
Get the current active stage number.
536 def num_of_stage()->int: 537 '''Get the total number of stages.''' 538 rec = connect._send_message(f"true<<{_CRAFT_STATUS_SIGNAL['num_of_stage']}") 539 return rec[0]
Get the total number of stages.
540 def ag_status(ag:int)->bool: 541 '''Get the status of an action group.\n''' 542 rec = connect._send_message(f"true<<{_CRAFT_STATUS_SIGNAL['ag_status']}<<{ag}") 543 return rec[0]
Get the status of an action group.
544 def craft_is_destroyed(craft_ID:int)->bool: 545 '''Get the status of whether a vessel is destroyed.\n''' 546 rec = connect._send_message(f"true<<{_CRAFT_STATUS_SIGNAL['craft_is_destroyed']}<<{craft_ID}") 547 return rec[0]
Get the status of whether a vessel is destroyed.
548 def craft_is_player(craft_ID:int)->bool: 549 '''Get the status of whether a vessel is a player vessel.\n''' 550 rec = connect._send_message(f"true<<{_CRAFT_STATUS_SIGNAL['craft_is_player']}<<{craft_ID}") 551 return rec[0]
Get the status of whether a vessel is a player vessel.