目标一、可视化轨迹
x种方案:
- AirSim提供的可视化轨迹的功能函数;
- 自己编程实现简单版的可视化轨迹。即,实时记录保存无人机的状态,然后使用
matplotlib
等编程绘制轨迹。
方案1、运行orbit.py
操作:
与hello_drone.py
的运行基本一致,不同点仅在于需要传入参数。(使用带参数的命令行,或在VS的python调试属性
中添加调试参数
即可)
备注:
单纯地运行orbit.py
脚本并不能绘制出轨迹。
方案1、PX4 Log Viewer
明确simple_flight
情况下,是否能使用PX4 Log Viewer
显示数据?
是否必须要下载安装配置PX4
(目前的答案倾向于,是)?
操作:
The PX4 SITL mode doesn’t require you to have separate device such as a Pixhawk or Pixracer.
Autonomous flight using the Python API does not require RC.
Make sure there is no Pixhawk hardware plugged in.
备注:
- 暂时先将
PX4
的使用向后放。 - 理解和使用
PX4 Log Viewer
的本质在AirSim中的通信。
方案2、Recording APIs
Recording APIs can be used to start recording data through APIs. Data to be recorded can be specified using settings.
操作:
代码控制Recording的开始和结束:
client.startRecording()
client.stopRecording()
备注:
- 保存的为捕获图片,以及捕获该图片时刻的位置、姿态。
- 但欲保存Gps传感器的位置数据!