这几天在研究科学上网,我就不写出来了。总之,我把PX4拉到了自己的电脑上。
在入门的过程中,我根据自己以前的学习习惯,开始大面积地搜集教程视频,可惜并没有!
这下我瞬间没招了,在热心网友的指点下,我开始啃PX4官方文档密密麻麻的英语让我马上回忆起当初大学英语六级飘过时的心悸。一万个不情愿地读起来。直到我读到Gazebo Simulation,瞬间能看懂在说神魔了。
最后我只想说,english真香,句柄TMD滚犊子。
下面记录一下我的操作:
1. 布置场景,召唤小飞机
make px4_sitl_default gazebo_plane_cam__warehouse
2. 打开QGC 自动连接飞机,连接失败检查连接方法
3.飞机跟随视角,不搞这一步,飞机直接起飞不见了。这图官方把来的。
4.起飞
pxh> commander takeoff
5.不开gazebo的模式 Headless Mode
HEADLESS=1 make px4_sitl gazebo_plane
6.自定义起飞位置
要设置的变量:
PX4_HOME_LAT
纬度 latitude,
PX4_HOME_LON
经度 longitude,
PX4_HOME_ALT
. 飞行海拔高度
export PX4_HOME_LAT=28.452386
export PX4_HOME_LON=-13.867138
export PX4_HOME_ALT=12.5
make px4_sitl gazebo
7.仿真时间加速
export PX4_SIM_SPEED_FACTOR=2
make px4_sitl_default gazebo
8.调整场景world的参数
储存的路径:
~/Firmware/Tools/sitl_gazebo/worlds
然后就可以改参数了,比如风速:
<plugin name='wind_plugin' filename='libgazebo_wind_plugin.so'>
<frameId>base_link</frameId>
<robotNamespace/>
<windVelocityMean>SET_YOUR_WIND_SPEED</windVelocityMean>
<windVelocityMax>20.0</windVelocityMax>
<windVelocityVariance>0</windVelocityVariance>
<windDirectionMean>0 1 0</windDirectionMean>
<windDirectionVariance>0</windDirectionVariance>
<windGustStart>0</windGustStart>
<windGustDuration>0</windGustDuration>
<windGustVelocityMean>0</windGustVelocityMean>
<windGustVelocityMax>20.0</windGustVelocityMax>
<windGustVelocityVariance>0</windGustVelocityVariance>
<windGustDirectionMean>1 0 0</windGustDirectionMean>
<windGustDirectionVariance>0</windGustDirectionVariance>
<windPubTopic>world_wind</windPubTopic>
</plugin>
9.使用相机
有摄影功能的飞机:typhoon_h480
make px4_sitl_default gazebo_typhoon_h480__sonoma_raceway
记录一个错误: QGC 处于not ready的状态:原因是飞机处于围栏之外。
记得在删除了围栏之后上传任务。否则不会生效。
make px4_sitl gazebo_if750a__sonoma_raceway
10.使用降落伞 失败 Simulated Parachute/Flight Termination
撞倒就没了,哪儿来什么降落伞
make px4_sitl gazebo_if750a__sonoma_raceway
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)