【PX4-AutoPilot教程-TIPS】PX4系统命令行控制台Consoles&Shells常用命令(持续更新)

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_armed0
 actuator_controls_00
 actuator_controls_30
 ......
 vehicle_status_flags0
 vehicle_thrust_setpoint0
 vehicle_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: 0

TOPIC: 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: 1
     0  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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

后厂村路练习生

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值