knowledge_map/log 实训.md
2021-01-22 10:12:08 +08:00

61 lines
1.6 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# log 实训
## log简介
## log使用
在进行debug调试中可以使用以下代码进行调试根据不同的错误级别在相应的部分插入相应的信息。不同的信息代表不同的情况info一般用来表示重要功能完成了。warn表示发生异常但不影响系统使用err代表使用已经影响到了系统的工作必须马上解决问题。
PX4_INFO("输出需要的数据");
PX4_WARN(" 输出警告信息");
PX4_ERR("输出错误信息" );
https://zhuanlan.zhihu.com/p/45298171
日志文件结构
ulog 功能
log作用
Px4还有一个logger功能可以使用logger 记录 uorb消息,将记录的消息转成ulog文件存储默认记录的消息主要是飞行日志相关的内容。记录的文件为sample.ulg文件可以通过安装pyulog查看相应的信息
pyulog安装方法
airspeed_0.csv 存放了飞行的指示空速和滤波前后的真空速
vehicle_attitude_0.csv 存放了四元数及pqr或者是姿态角速度?
vehicle_attitude_setpoint_0.csv 存放了期望的姿态角及四元数、油门信息
tecs_status_0.csv 存放了滤波后的高度、速度、加速度信息及期望的高度、速度、加速度信息以及跟总能量有关的一些参数
actuator_outputs_0.csv、actuator_outputs_1.csv 存放了输出混控器的pwm信号其中0是main out 1是aux out分别由主处理器和协处理器输出
actuator_controls_0_0.csv 存放了输入混控器的归一化数据
ekf2 两个文件中存放着互补滤波的数据更新
home_position_0.csv 存放着地面站所在位置