PX4与仿真入门教程-配置ros
PX4与仿真入门教程-配置ros
说明:
- 介绍如何利用ros来启动仿真
- 增加配置文件vim ~/.bashrc
source ~/tools/PX4-Autopilot/Tools/setup_gazebo.bash ~/tools/PX4-Autopilot ~/tools/PX4-Autopilot/build/px4_sitl_default
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/tools/PX4-Autopilot
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/tools/PX4-Autopilot/Tools/sitl_gazebo
- 或者保存为一个脚本,load_px4_gazebo.sh, 运行
source load_px4_gazebo.sh
来单独加载 - 这种单独脚本方式,便于有多个仿真配置,各自独立,不冲突
- 启动gazebo
source load_px4_gazebo.sh
roslaunch px4 posix_sitl.launch
- 连接仿真
source load_px4_gazebo.sh
roslaunch mavros px4.launch fcu_url:="udp://:14540@127.0.0.1:14557"
- 尝试读取飞空的IMU数据,打开终端,输入
source load_px4_gazebo.sh
rostopic echo /mavros/imu/data
rostopic list
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号