PX4系統命令行控制臺 Consoles & Shells 常用命令
- 查看每個應用程序的堆棧使用情況
- 獲取所有可用命令和APP的列表
- 應用程序啟動、停止和狀態查詢
- 查看本地文件系統
- 查看剩余的可用RAM
- 查看工作隊列中正在運行的內容以及運行速率
- 查看特定的uORB話題
- 調試uORB話題
- 進行模式切換和故障保護行為的狀態機
- I2C總線掃描
- Dshot協議電調驅動程序
NUTTX官網 NuttShell (NSH)
查看每個應用程序的堆棧使用情況
堆棧使用率是使用堆棧著色計算的,并且是自任務開始以來的最大值(而不是當前使用率)。
top
獲取所有可用命令和APP的列表
help
應用程序啟動、停止和狀態查詢
<app_name> start
<app_name> stop
<app_name> status
查看本地文件系統
ls
查看剩余的可用RAM
free
查看工作隊列中正在運行的內容以及運行速率
work_queue status
查看特定的uORB話題
列出所有話題。
To list all topics, list the file handles:
ls /obj
/obj:actuator_armed0actuator_controls_00actuator_controls_30......vehicle_status_flags0vehicle_thrust_setpoint0vehicle_torque_setpoint0
To listen to the content of one topic for 5 messages, run the listener:
listener <topic_name>listener sensor_accel 5
The output is n-times the content of the topic:
TOPIC: sensor_accel #3
timestamp: 84978861
integral_dt: 4044
error_count: 0
x: -1
y: 2
z: 100
x_integral: -0
y_integral: 0
z_integral: 0
temperature: 46
range_m_s2: 78
scaling: 0TOPIC: sensor_accel #4
timestamp: 85010833
integral_dt: 3980
error_count: 0
x: -1
y: 2
z: 100
x_integral: -0
y_integral: 0
z_integral: 0
temperature: 46
range_m_s2: 78
scaling: 0
調試uORB話題
The command uorb top shows the publishing frequency of each topic in real-time:
uorb top
update: 1s, num topics: 77
TOPIC NAME INST #SUB #MSG #LOST #QSIZE
actuator_armed 0 6 4 0 1
actuator_controls_0 0 7 242 1044 1
battery_status 0 6 500 2694 1
commander_state 0 1 98 89 1
control_state 0 4 242 433 1
ekf2_innovations 0 1 242 223 1
ekf2_timestamps 0 1 242 23 1
estimator_status 0 3 242 488 1
mc_att_ctrl_status 0 0 242 0 1
sensor_accel 0 1 242 0 1
sensor_accel 1 1 249 43 1
sensor_baro 0 1 42 0 1
sensor_combined 0 6 242 636 1
The columns are: topic name, multi-instance index, number of subscribers, publishing frequency in Hz, number of lost messages per second (for all subscribers combined), and queue size.
進行模式切換和故障保護行為的狀態機
commander <command>
I2C總線掃描
i2cdetect -b <i2c bus number>i2cdetect -b 1
它會打印出總線上掃描到的設備地址。
Scanning I2C bus: 10 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- 76 -- -- -- -- -- -- -- -- --
Dshot協議電調驅動程序
永久反轉1號電機,保存后,反轉的方向將被視為正常方向。
如果要再次反轉,請重復相同的命令。
dshot reverse -m 1
dshot save -m 1
如果不指定電機序號,則是反轉所有電機。
dshot reverse
dshot save
參考資料:
Using Consoles/Shells
NUTTX官網 NuttShell (NSH)
Modules & Commands Reference