<?xml version="1.0" encoding="utf-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>forwhat</title><link>http://www.forwhat.cn/</link><description>Good Luck To You!</description><item><title>class Camera</title><link>http://www.forwhat.cn/?id=347</link><description>&lt;p&gt;&lt;code&gt;Camera&lt;/code&gt; 类用于控制游戏中的相机视角。以下是 &lt;code&gt;Camera&lt;/code&gt; 类的主要属性和方法：&lt;/p&gt;&lt;h3&gt;属性&lt;/h3&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;mode&lt;/code&gt;&lt;/strong&gt;：&lt;code&gt;CameraMode&lt;/code&gt;，获取或设置相机模式（如轨道、追踪、自由、自动）。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;field_of_view&lt;/code&gt;&lt;/strong&gt;：浮点值，获取或设置相机的视野角度。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;direction&lt;/code&gt;&lt;/strong&gt;：向量，获取或设置相机的方向。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;position&lt;/code&gt;&lt;/strong&gt;：向量，获取或设置相机的位置。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;focal_point&lt;/code&gt;&lt;/strong&gt;：向量，获取或设置相机的焦点位置。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;方法&lt;/h3&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;set_mode(mode)&lt;/code&gt;&lt;/strong&gt;：设置相机模式。&lt;/p&gt;&lt;/li&gt;&lt;ul class=&quot; list-paddingleft-2&quot; style=&quot;list-style-type: square;&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;mode&lt;/code&gt;&lt;/strong&gt;：&lt;code&gt;CameraMode&lt;/code&gt;，相机模式。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;set_field_of_view(fov)&lt;/code&gt;&lt;/strong&gt;：设置相机的视野角度。&lt;/p&gt;&lt;/li&gt;&lt;ul class=&quot; list-paddingleft-2&quot; style=&quot;list-style-type: square;&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;fov&lt;/code&gt;&lt;/strong&gt;：浮点值，视野角度。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;set_direction(direction)&lt;/code&gt;&lt;/strong&gt;：设置相机的方向。&lt;/p&gt;&lt;/li&gt;&lt;ul class=&quot; list-paddingleft-2&quot; style=&quot;list-style-type: square;&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;direction&lt;/code&gt;&lt;/strong&gt;：向量，相机的方向。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;set_position(position)&lt;/code&gt;&lt;/strong&gt;：设置相机的位置。&lt;/p&gt;&lt;/li&gt;&lt;ul class=&quot; list-paddingleft-2&quot; style=&quot;list-style-type: square;&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;position&lt;/code&gt;&lt;/strong&gt;：向量，相机的位置。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;set_focal_point(focal_point)&lt;/code&gt;&lt;/strong&gt;：设置相机的焦点位置。&lt;/p&gt;&lt;/li&gt;&lt;ul class=&quot; list-paddingleft-2&quot; style=&quot;list-style-type: square;&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;focal_point&lt;/code&gt;&lt;/strong&gt;：向量，相机的焦点位置。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;pre class=&quot;prism-highlight prism-language-python&quot;&gt;import krpc

# 连接到kRPC服务器
conn = krpc.connect(name='Camera Example')
space_center = conn.space_center

# 获取相机对象
camera = space_center.camera

# 设置相机模式为自由模式
camera.mode = space_center.CameraMode.free

# 设置相机视野角度为60度
camera.field_of_view = 60.0

# 设置相机方向
camera.direction = (0, 0, 1)

# 设置相机位置
camera.position = (0, 10, -10)

# 设置相机焦点位置
camera.focal_point = (0, 0, 0)

# 打印当前相机模式和视野角度
print(f&quot;Camera mode: {camera.mode}&quot;)
print(f&quot;Field of view: {camera.field_of_view}&quot;)&lt;/pre&gt;&lt;h3&gt;应用场景&lt;/h3&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;视角控制&lt;/strong&gt;：在飞行过程中，通过编程方式调整相机视角，以获取最佳视角。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;自动化任务&lt;/strong&gt;：在自动化脚本中，根据需要调整相机视角，以确保任务顺利完成。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;调试和测试&lt;/strong&gt;：在飞行器设计和测试过程中，使用相机接口进行精确的控制和调试。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;</description><pubDate>Sun, 30 Jun 2024 21:21:32 +0800</pubDate></item><item><title>class AutoPilot</title><link>http://www.forwhat.cn/?id=346</link><description>&lt;p&gt;&lt;code&gt;AutoPilot&lt;/code&gt; 类用于控制飞行器的自动驾驶系统。以下是 &lt;code&gt;AutoPilot&lt;/code&gt; 类的主要属性和方法：&lt;/p&gt;&lt;h3&gt;属性&lt;/h3&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;sas&lt;/code&gt;&lt;/strong&gt;：布尔值，控制 SAS（Stability Assist System）的开关状态。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;sas_mode&lt;/code&gt;&lt;/strong&gt;：&lt;code&gt;SASMode&lt;/code&gt;，设置 SAS 模式。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;target_pitch&lt;/code&gt;&lt;/strong&gt;：浮点值，目标俯仰角度。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;target_heading&lt;/code&gt;&lt;/strong&gt;：浮点值，目标航向角度。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;target_roll&lt;/code&gt;&lt;/strong&gt;：浮点值，目标滚转角度。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;engaged&lt;/code&gt;&lt;/strong&gt;：布尔值，自动驾驶是否处于启用状态。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;error&lt;/code&gt;&lt;/strong&gt;：浮点值，自动驾驶器的当前误差。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;time_to_go&lt;/code&gt;&lt;/strong&gt;：浮点值，自动驾驶器完成机动所需的时间。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;方法&lt;/h3&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;engage()&lt;/code&gt;&lt;/strong&gt;：启用自动驾驶系统。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;disengage()&lt;/code&gt;&lt;/strong&gt;：禁用自动驾驶系统。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;hold()&lt;/code&gt;&lt;/strong&gt;：保持当前姿态。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;set_pid_parameters(proportional, integral, derivative)&lt;/code&gt;&lt;/strong&gt;：设置自动驾驶 PID 控制器的参数。&lt;/p&gt;&lt;/li&gt;&lt;ul class=&quot; list-paddingleft-2&quot; style=&quot;list-style-type: square;&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;proportional&lt;/code&gt;&lt;/strong&gt;：浮点值，比例参数。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;integral&lt;/code&gt;&lt;/strong&gt;：浮点值，积分参数。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;derivative&lt;/code&gt;&lt;/strong&gt;：浮点值，微分参数。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;pre class=&quot;prism-highlight prism-language-python&quot;&gt;import krpc

# 连接到kRPC服务器
conn = krpc.connect(name='AutoPilot Example')
space_center = conn.space_center

# 获取当前活跃飞行器
vessel = space_center.active_vessel

# 获取自动驾驶对象
autopilot = vessel.auto_pilot

# 设置目标姿态
autopilot.target_pitch = 90
autopilot.target_heading = 90
autopilot.target_roll = 0

# 启用自动驾驶
autopilot.engage()

# 设置 SAS 模式为顺行方向
autopilot.sas = True
autopilot.sas_mode = space_center.SASMode.prograde

# 设置 PID 参数
autopilot.set_pid_parameters(1.0, 0.1, 0.1)

# 打印当前误差和时间到达
print(f&quot;Error: {autopilot.error}&quot;)
print(f&quot;Time to go: {autopilot.time_to_go}&quot;)

# 禁用自动驾驶
autopilot.disengage()&lt;/pre&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;</description><pubDate>Sun, 30 Jun 2024 21:20:17 +0800</pubDate></item><item><title>class ReferenceFrame</title><link>http://www.forwhat.cn/?id=345</link><description>&lt;p&gt;&lt;code&gt;ReferenceFrame&lt;/code&gt; 类表示位置、旋转和速度的参考系。它包含以下内容：&lt;/p&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;原点的位置。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;x、y 和 z 轴的方向。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;参考系的线速度。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;参考系的角速度。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;注意&lt;/h3&gt;&lt;p&gt;这个类不包含任何属性或方法。它仅作为其他函数的参数使用。&lt;/p&gt;&lt;h3&gt;方法&lt;/h3&gt;&lt;h4&gt;&lt;code&gt;create_relative&lt;/code&gt;&lt;/h4&gt;&lt;pre class=&quot;prism-highlight prism-language-python&quot;&gt;static create_relative(reference_frame, position=(0.0, 0.0, 0.0), rotation=(0.0, 0.0, 0.0, 1.0), velocity=(0.0, 0.0, 0.0), angular_velocity=(0.0, 0.0, 0.0))&lt;/pre&gt;&lt;p&gt;创建一个相对参考系。这是一个自定义参考系，其组件偏移了父参考系的组件。&lt;/p&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;参数&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;ul class=&quot; list-paddingleft-2&quot; style=&quot;list-style-type: square;&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;reference_frame&lt;/strong&gt;：参考系（&lt;code&gt;ReferenceFrame&lt;/code&gt;），用于基于该参考系创建新的参考系。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;position&lt;/strong&gt;：位置的偏移量，以向量表示。默认为 &lt;code&gt;(0.0, 0.0, 0.0)&lt;/code&gt;。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;rotation&lt;/strong&gt;：应用于父参考系的旋转，以四元数表示，形式为 &lt;code&gt;(x, y, z, w)&lt;/code&gt;。默认为 &lt;code&gt;(0.0, 0.0, 0.0, 1.0)&lt;/code&gt;（即没有旋转）。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;velocity&lt;/strong&gt;：偏移父参考系的线速度，以向量表示，指向旅行方向，单位为米每秒。默认为 &lt;code&gt;(0.0, 0.0, 0.0)&lt;/code&gt;。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;angular_velocity&lt;/strong&gt;：偏移父参考系的角速度，以向量表示，指向旋转轴的方向，其大小为旋转速度，以弧度每秒表示。默认为 &lt;code&gt;(0.0, 0.0, 0.0)&lt;/code&gt;。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;返回类型&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;ul class=&quot; list-paddingleft-2&quot; style=&quot;list-style-type: square;&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;ReferenceFrame&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;h4&gt;&lt;code&gt;create_hybrid&lt;/code&gt;&lt;/h4&gt;&lt;pre class=&quot;prism-highlight prism-language-python&quot;&gt;static create_hybrid(position, rotation=None, velocity=None, angular_velocity=None)&lt;/pre&gt;&lt;p&gt;创建一个混合参考系。这是一个自定义参考系，其组件从其他参考系继承。&lt;/p&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;参数&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;ul class=&quot; list-paddingleft-2&quot; style=&quot;list-style-type: square;&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;position&lt;/strong&gt;：提供原点位置的参考系（&lt;code&gt;ReferenceFrame&lt;/code&gt;）。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;rotation&lt;/strong&gt;：提供参考系旋转的参考系（&lt;code&gt;ReferenceFrame&lt;/code&gt;）。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;velocity&lt;/strong&gt;：提供参考系线速度的参考系（&lt;code&gt;ReferenceFrame&lt;/code&gt;）。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;angular_velocity&lt;/strong&gt;：提供参考系角速度的参考系（&lt;code&gt;ReferenceFrame&lt;/code&gt;）。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;返回类型&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;ul class=&quot; list-paddingleft-2&quot; style=&quot;list-style-type: square;&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;ReferenceFrame&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;h3&gt;注意&lt;/h3&gt;&lt;p&gt;&lt;code&gt;position&lt;/code&gt; 参考系是必需的，但其他所有参考系都是可选的。如果省略，它们会设置为 &lt;code&gt;position&lt;/code&gt; 参考系。&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;</description><pubDate>Sun, 30 Jun 2024 21:14:01 +0800</pubDate></item><item><title>class ControlInputMode</title><link>http://www.forwhat.cn/?id=344</link><description>&lt;p&gt;&lt;code&gt;ControlInputMode&lt;/code&gt; 是一个表示飞行器控制输入模式的枚举类。以下是 &lt;code&gt;ControlInputMode&lt;/code&gt; 的各个枚举值及其含义：&lt;/p&gt;&lt;h3&gt;&lt;code&gt;ControlInputMode&lt;/code&gt;&lt;/h3&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;additive&lt;/code&gt;&lt;/strong&gt;：加法输入模式。控制输入被加到现有的控制状态上，适用于多个输入源的组合控制。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;override&lt;/code&gt;&lt;/strong&gt;：覆盖输入模式。新的控制输入会覆盖现有的控制状态，适用于单一输入源的独占控制。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;</description><pubDate>Sun, 30 Jun 2024 16:21:28 +0800</pubDate></item><item><title>class SpeedMode</title><link>http://www.forwhat.cn/?id=343</link><description>&lt;p&gt;&lt;code&gt;SpeedMode&lt;/code&gt; 是一个表示在导航球（navball）中显示的速度模式的枚举类。以下是 &lt;code&gt;SpeedMode&lt;/code&gt; 的各个枚举值及其含义：&lt;/p&gt;&lt;h3&gt;&lt;code&gt;SpeedMode&lt;/code&gt;&lt;/h3&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;orbit&lt;/code&gt;&lt;/strong&gt;：相对于飞行器的轨道显示速度。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;surface&lt;/code&gt;&lt;/strong&gt;：相对于飞行器所绕行的天体表面显示速度。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;target&lt;/code&gt;&lt;/strong&gt;：相对于当前目标显示速度。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;参考&lt;/h3&gt;&lt;p&gt;可以通过 &lt;code&gt;Control.speed_mode&lt;/code&gt; 属性来设置和获取飞行器的当前速度模式。&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;</description><pubDate>Sun, 30 Jun 2024 16:21:01 +0800</pubDate></item><item><title>class SASMode</title><link>http://www.forwhat.cn/?id=342</link><description>&lt;p&gt;&lt;code&gt;SASMode&lt;/code&gt; 是一个表示 SAS 自动驾驶行为的枚举类。以下是 &lt;code&gt;SASMode&lt;/code&gt; 的各个枚举值及其含义：&lt;/p&gt;&lt;h3&gt;&lt;code&gt;SASMode&lt;/code&gt;&lt;/h3&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;stability_assist&lt;/code&gt;&lt;/strong&gt;：稳定辅助模式。用于抑制任何旋转，保持飞行器稳定。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;maneuver&lt;/code&gt;&lt;/strong&gt;：指向下一个航天节点的燃烧方向。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;prograde&lt;/code&gt;&lt;/strong&gt;：指向顺行方向。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;retrograde&lt;/code&gt;&lt;/strong&gt;：指向逆行方向。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;normal&lt;/code&gt;&lt;/strong&gt;：指向轨道法线方向。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;anti_normal&lt;/code&gt;&lt;/strong&gt;：指向轨道反法线方向。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;radial&lt;/code&gt;&lt;/strong&gt;：指向轨道径向方向。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;anti_radial&lt;/code&gt;&lt;/strong&gt;：指向轨道反径向方向。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;target&lt;/code&gt;&lt;/strong&gt;：指向当前目标的方向。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;anti_target&lt;/code&gt;&lt;/strong&gt;：指向远离当前目标的方向。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;参考&lt;/h3&gt;&lt;p&gt;可以通过 &lt;code&gt;AutoPilot.sas_mode&lt;/code&gt; 属性来设置和获取飞行器的当前 SAS 模式。&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;</description><pubDate>Sun, 30 Jun 2024 16:19:36 +0800</pubDate></item><item><title>class ControlSource</title><link>http://www.forwhat.cn/?id=341</link><description>&lt;p&gt;&lt;code&gt;ControlSource&lt;/code&gt; 是一个表示飞行器控制来源的枚举类。下面是 &lt;code&gt;ControlSource&lt;/code&gt; 的三个枚举值及其含义：&lt;/p&gt;&lt;h3&gt;&lt;code&gt;ControlSource&lt;/code&gt;&lt;/h3&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;kerbal&lt;/code&gt;&lt;/strong&gt;：飞行器由Kerbal控制。表示飞行器的控制来源是Kerbal宇航员。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;probe&lt;/code&gt;&lt;/strong&gt;：飞行器由探测器核心控制。表示飞行器的控制来源是探测器核心。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;none&lt;/code&gt;&lt;/strong&gt;：飞行器未被控制。表示飞行器没有任何控制来源。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;参考&lt;/h3&gt;&lt;p&gt;可以通过 &lt;code&gt;Control.source&lt;/code&gt; 属性来获取飞行器的当前控制来源。&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;</description><pubDate>Sun, 30 Jun 2024 16:18:18 +0800</pubDate></item><item><title>class ControlState</title><link>http://www.forwhat.cn/?id=340</link><description>&lt;p&gt;&lt;code&gt;ControlState&lt;/code&gt; 是一个表示飞行器控制状态的枚举类。下面是 &lt;code&gt;ControlState&lt;/code&gt; 的三个枚举值及其含义：&lt;/p&gt;&lt;h3&gt;&lt;code&gt;ControlState&lt;/code&gt;&lt;/h3&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;full&lt;/code&gt;&lt;/strong&gt;：完全可控。表示飞行器处于完全可控状态，所有控制功能都可以使用。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;partial&lt;/code&gt;&lt;/strong&gt;：部分可控。表示飞行器处于部分可控状态，可能有些控制功能不可用。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;none&lt;/code&gt;&lt;/strong&gt;：不可控。表示飞行器处于不可控状态，无法进行任何控制。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;参考&lt;/h3&gt;&lt;p&gt;可以通过 &lt;code&gt;Control.state&lt;/code&gt; 属性来获取飞行器的当前控制状态&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;</description><pubDate>Sun, 30 Jun 2024 16:17:01 +0800</pubDate></item><item><title>remove_nodes()</title><link>http://www.forwhat.cn/?id=339</link><description>&lt;p&gt;在kRPC中，&lt;code&gt;Control&lt;/code&gt; 类提供了 &lt;code&gt;remove_nodes&lt;/code&gt; 方法，用于移除飞行器当前的所有航天节点（Maneuver Nodes）。该方法不需要任何参数。&lt;/p&gt;&lt;h3&gt;功能和使用&lt;/h3&gt;&lt;h4&gt;方法&lt;/h4&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;remove_nodes()&lt;/code&gt;&lt;/strong&gt;：移除飞行器当前的所有航天节点。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre class=&quot;prism-highlight prism-language-python&quot;&gt;import krpc

# 连接到kRPC服务器
conn = krpc.connect(name='Remove Nodes Example')
space_center = conn.space_center

# 获取当前活跃飞行器
vessel = space_center.active_vessel

# 获取控制对象
control = vessel.control

# 移除所有航天节点
control.remove_nodes()
print(&quot;All maneuver nodes removed.&quot;)&lt;/pre&gt;&lt;h3&gt;示例解释&lt;/h3&gt;&lt;ol class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;连接到kRPC服务器&lt;/strong&gt;：使用 &lt;code&gt;krpc.connect()&lt;/code&gt; 函数连接到 kRPC 服务器。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;获取当前活跃飞行器&lt;/strong&gt;：通过 &lt;code&gt;space_center.active_vessel&lt;/code&gt; 获取当前活跃的飞行器对象。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;获取控制对象&lt;/strong&gt;：通过 &lt;code&gt;vessel.control&lt;/code&gt; 获取控制对象。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;移除所有航天节点&lt;/strong&gt;：调用 &lt;code&gt;control.remove_nodes()&lt;/code&gt; 方法移除飞行器当前的所有航天节点，并打印确认信息。&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h3&gt;应用场景&lt;/h3&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;轨道调整&lt;/strong&gt;：在飞行过程中，通过编程方式移除所有航天节点，以便重新设置新的航天节点进行轨道调整和变轨。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;自动化任务&lt;/strong&gt;：在自动化脚本中，根据需要移除当前所有的航天节点，以确保任务顺利完成。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;调试和测试&lt;/strong&gt;：在飞行器设计和测试过程中，使用移除节点接口进行精确的控制和调试。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;相关方法和属性&lt;/h3&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;Control&lt;/code&gt; 类的其他方法和属性&lt;/strong&gt;：如 &lt;code&gt;add_node&lt;/code&gt;、&lt;code&gt;nodes&lt;/code&gt;、&lt;code&gt;throttle&lt;/code&gt;、&lt;code&gt;pitch&lt;/code&gt;、&lt;code&gt;yaw&lt;/code&gt;、&lt;code&gt;roll&lt;/code&gt;、&lt;code&gt;sas&lt;/code&gt;、&lt;code&gt;rcs&lt;/code&gt;、&lt;code&gt;gear&lt;/code&gt;、&lt;code&gt;lights&lt;/code&gt;、&lt;code&gt;brakes&lt;/code&gt; 等，用于控制飞行器的各个方面。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;Node&lt;/code&gt; 类&lt;/strong&gt;：获取和设置航天节点的各种参数，如时间、推力变化等。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;</description><pubDate>Sun, 30 Jun 2024 16:13:59 +0800</pubDate></item><item><title>Control.nodes</title><link>http://www.forwhat.cn/?id=338</link><description>&lt;p&gt;在kRPC中，&lt;code&gt;Control&lt;/code&gt; 类提供了 &lt;code&gt;nodes&lt;/code&gt; 属性，用于获取飞行器当前所有的航天节点（Maneuver Nodes）。这个属性返回一个包含 &lt;code&gt;Node&lt;/code&gt; 对象的列表，每个 &lt;code&gt;Node&lt;/code&gt; 对象表示一个航天节点。&lt;/p&gt;&lt;h3&gt;功能和使用&lt;/h3&gt;&lt;h4&gt;属性&lt;/h4&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;nodes&lt;/code&gt;&lt;/strong&gt;：返回一个包含 &lt;code&gt;Node&lt;/code&gt; 对象的列表，表示飞行器当前所有的航天节点。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre class=&quot;prism-highlight prism-language-python&quot;&gt;import krpc

# 连接到kRPC服务器
conn = krpc.connect(name='Nodes Example')
space_center = conn.space_center

# 获取当前活跃飞行器
vessel = space_center.active_vessel

# 获取控制对象
control = vessel.control

# 获取当前所有航天节点
nodes = control.nodes

# 打印每个节点的信息
for node in nodes:
    print(f&quot;Node at UT: {node.ut}, prograde: {node.prograde}, normal: {node.normal}, radial: {node.radial}&quot;)&lt;/pre&gt;&lt;h3&gt;示例解释&lt;/h3&gt;&lt;ol class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;连接到kRPC服务器&lt;/strong&gt;：使用 &lt;code&gt;krpc.connect()&lt;/code&gt; 函数连接到 kRPC 服务器。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;获取当前活跃飞行器&lt;/strong&gt;：通过 &lt;code&gt;space_center.active_vessel&lt;/code&gt; 获取当前活跃的飞行器对象。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;获取控制对象&lt;/strong&gt;：通过 &lt;code&gt;vessel.control&lt;/code&gt; 获取控制对象。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;获取当前所有航天节点&lt;/strong&gt;：通过访问 &lt;code&gt;control.nodes&lt;/code&gt; 属性来获取飞行器当前所有的航天节点，并将其存储在 &lt;code&gt;nodes&lt;/code&gt; 列表中。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;打印每个节点的信息&lt;/strong&gt;：遍历 &lt;code&gt;nodes&lt;/code&gt; 列表，打印每个航天节点的时间、顺行方向推力变化、法线方向推力变化和径向方向推力变化。&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h3&gt;应用场景&lt;/h3&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;轨道调整&lt;/strong&gt;：在飞行过程中，通过获取当前所有的航天节点，以便进行轨道调整和变轨。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;自动化任务&lt;/strong&gt;：在自动化脚本中，根据需要获取和管理当前的航天节点，以确保任务顺利完成。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;调试和测试&lt;/strong&gt;：在飞行器设计和测试过程中，使用航天节点接口进行精确的控制和调试。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;相关方法和属性&lt;/h3&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;Control&lt;/code&gt; 类的其他方法和属性&lt;/strong&gt;：如 &lt;code&gt;add_node&lt;/code&gt;、&lt;code&gt;remove_nodes&lt;/code&gt;、&lt;code&gt;throttle&lt;/code&gt;、&lt;code&gt;pitch&lt;/code&gt;、&lt;code&gt;yaw&lt;/code&gt;、&lt;code&gt;roll&lt;/code&gt;、&lt;code&gt;sas&lt;/code&gt;、&lt;code&gt;rcs&lt;/code&gt;、&lt;code&gt;gear&lt;/code&gt;、&lt;code&gt;lights&lt;/code&gt;、&lt;code&gt;brakes&lt;/code&gt; 等，用于控制飞行器的各个方面。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;Node&lt;/code&gt; 类&lt;/strong&gt;：获取和设置航天节点的各种参数，如时间、推力变化等。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;</description><pubDate>Sun, 30 Jun 2024 16:13:23 +0800</pubDate></item></channel></rss>