PX4与仿真入门教程-安装dronedoc
PX4与仿真入门教程-安装dronedoc
说明:
- 介绍如何安装dronedoc
步骤:
- 安装gazebo,和搭建环境 参考PX4与仿真入门教程-安装px4
- 安装px4,参考PX4与仿真入门教程-安装GAAS
- 简化步骤如下:
mkdir ~/tools/dronedoc
cd ~/tools/dronedoc
git clone https://github.com/PX4/PX4-Autopilot.git Firmware
cd Firmware
git checkout v1.11.0-beta1
make distclean
make px4_sitl gazebo
- 效果图:
- 测试起飞命令
commander takeoff
- 起飞到10米,在自动降落
- 关闭之前的启动的gazebo
- 下载dronedoc
mkdir -p ~/tools/dronedoc/
cd ~/tools/dronedoc/
git clone https://github.com/ncnynl/dronedoc dronedoc_src
- dronedoc目录包含dronedoc系列教程的所有例子和源码
- 整合ros,增加环境变量
- 新建load_environment.sh
cd ~/tools/dronedoc
vim load_environment.sh
- 内容如下:
source $(pwd)/Firmware/Tools/setup_gazebo.bash $(pwd)/Firmware $(pwd)/Firmware/build/px4_sitl_default
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd)/Firmware
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd)/Firmware/Tools/sitl_gazebo
echo "SUCCEED."
- 运行gazebo和ros
. load_environment.sh
roslaunch px4 mavros_posix_sitl.launch
- 解锁
rosservice call /mavros/cmd/arming "value: true"
- 起飞
rosservice call /mavros/cmd/takeoff "{min_pitch: 0.0, yaw: 0.0, latitude: 47.3977506, longitude: 8.5456074, altitude: 5}"
- gazebo,px4和ros的关系图
参考:
- https://uenota.github.io/dronedoc/en/px4sim/px4sim.html
- https://uenota.github.io/dronedoc/en/index.html
- https://github.com/uenota/dronedoc
- https://uenot.hatenablog.jp/
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号