目录
1. PX4启动仿真的launch系列文件
1.1 单个launch文件解读
打开每个文件的开头,都有对它功能的描述。
px4.launch
Posix SITL PX4 launch script
Launches Only PX4 SITL. This can be used by external projects
加载px4_sitl仿真的节点
posix_sitl.launch
Posix SITL environment launch script
launches PX4 SITL, Gazebo environment, and spawns vehicle
在px4.launch基础上,打开GAZEBO环境并使用spawn_model加载sdf格式的飞机模型
mavros_posix_sitl.launch
在
posix_sitl.launch基础上,加入mavros package里的px4.launch(注意不是px4下的px4.launch)。
即开启了sitl仿真后,飞机信息通过mavros来传递交互。那么交互的端口号fcu_url即飞机端udp端口由<arg name="fcu_url" default="udp://:14540@localhost:14557"/>确定。这个参数主要是为传入mavros使用。
single_vehicle_spawn.launch
Posix SITL environment launch script
launchs PX4 SITL and spawns vehicle
打开sitl节点,以及使用xacro加载urdf格式的飞机模型。注意加载模型有urdf和上述sdf两种方式。后文会对两种方式详细比较。
- <

本文详述了PX4启动仿真时使用的launch文件,包括px4.launch、posix_sitl.launch、mavros_posix_sitl.launch和single_vehicle_spawn.launch等,解析了它们各自的功能。介绍了如何为iris模型添加相机,以及在添加过程中遇到的问题。同时,文章提到了环境变量~/.bashrc对运行的影响,并列举了在不同PX4版本中遇到的模型加载Bug及其解决方案。最后,讨论了gazebo无法打开的可能原因及解决办法。

1511

被折叠的 条评论
为什么被折叠?



