更多...
|
| | __init__ (self, port, baudrate=115200) |
| | 初始化 MAVLink 串口,并创建 MAVLink 连接。
|
| | is_prompt (self, data) |
| | 检查数据中是否包含提示符(nsh>),用于判断命令是否完成。
|
| | SendCmdNsh (self, cmd) |
| | 向飞控发送命令并接收响应。
|
| | SendUpdateParam (self, ParamKey, ParamValue) |
| | 更新指定参数的值。
|
| | SendCommitParam (self) |
| | 提交参数更改,使更改生效。
|
| | SendChangeParam (self, ParamKey, ParamValue) |
| | 修改指定参数的值
|
| | SendShowParam (self, ParamKey) |
| | 显示指定参数的当前值。
|
| | SendRebootPX4 (self) |
| | 重启飞控。
|
| | SendClose (self) |
| | 关闭 MAVLink 串口。
|
| | SendCmdNshS (self, ParamKey) |
| | 向飞控发送参数并接收响应
|
| | SendAirframe (self) |
| | 设置机架类型为 HIL。
|
定义一个 RflyShell 类,用于向飞控发送命令
◆ __init__()
| __init__ |
( |
| self, |
|
|
| port, |
|
|
| baudrate = 115200 ) |
初始化 MAVLink 串口,并创建 MAVLink 连接。
- 参数
-
| port | 串口名称。 |
| baudrate | 波特率,默认为 115200。 |
- 返回
- 无返回值。
◆ is_prompt()
检查数据中是否包含提示符(nsh>),用于判断命令是否完成。
- 参数
-
- 返回
- 布尔值,若包含提示符则返回 True,否则返回 False。
检查数据中是否包含完整的提示符
◆ SendAirframe()
◆ SendChangeParam()
| SendChangeParam |
( |
| self, |
|
|
| ParamKey, |
|
|
| ParamValue ) |
修改指定参数的值
- 参数
-
| ParamKey | 参数的名称 |
| ParamValue | 要更新的参数值 |
- 返回
- 无返回值。
◆ SendClose()
◆ SendCmdNsh()
◆ SendCmdNshS()
| SendCmdNshS |
( |
| self, |
|
|
| ParamKey ) |
◆ SendCommitParam()
◆ SendRebootPX4()
◆ SendShowParam()
| SendShowParam |
( |
| self, |
|
|
| ParamKey ) |
◆ SendUpdateParam()
| SendUpdateParam |
( |
| self, |
|
|
| ParamKey, |
|
|
| ParamValue ) |
更新指定参数的值。
- 参数
-
| ParamKey | 参数的名称。 |
| ParamValue | 要更新的参数值。 |
- 返回
- 无返回值。
该类的文档由以下文件生成: