< >
Home » PX4与仿真入门教程 » PX4与仿真入门教程-安装volans

PX4与仿真入门教程-安装volans

PX4与仿真入门教程-安装volans

说明:

  • 介绍如何安装安装volans
  • volans项目基于https://gitee.com/bingobinlw/volans
  • 在此版本基础上制作此教程的部分内容,同时源码也有小量改动和增减

步骤:

  • 安装依赖包
sudo apt install ros-melodic-ddynamic-reconfigure
  • 二维码识别相关包
sudo apt install ros-melodic-ar-track-alvar*
  • 3Dlidar仿真相关的插件包
sudo apt install ros-melodic-velodyne-gazebo-plugins
  • 运动规划相关的包
sudo apt install ros-melodic-moveit  ros-melodic-nav-core ros-melodic-move-base
  • darknet_ros 相关包
sudo apt  install ros-melodic-cv-bridge
  • ompl相关包
sudo apt install ros-melodic-ompl*
sudo apt install libfcl-dev libompl-dev
  • 把ompl库添加到路径中 这里也可以在cmakelist.txt中把路径添加进去
cd /opt/ros/melodic/include
sudo cp -a ompl-1.4/ompl ompl
  • octomap相关包
sudo apt install ros-melodic-octomap*
  • 下载volans
cd ~/tools/
git clone https://gitee.com/ncnynl/volans
  • 编译firmware
  • 使用volans使用独立的PX4-Autopilot版本
cd ~/tools/
cp -r PX4-Autopilot volans/Firmware 
cd volans/Firmware 
git checkout v1.11.0-beta1   
make distclean
make px4_sitl_default gazebo
  • 编译volans
cd volans
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
catkin build simulation px4_control ros_slam octomap ros_vision path_planning ros_navigation explore_lite
  • 加载环境,并添加到bashrc文件
source load_enviroment.sh
  • 如果是有多个仿真环境,不需要添加到bashrc,可以采用如下方式手动加载
  • 新建vim load_volans_env.sh
  • 内容如下:
cp $(pwd)/src/simulation/resource/1061_amovCar $(pwd)/Firmware/ROMFS/px4fmu_common/init.d-posix/
source $(pwd)/devel/setup.bash
export GAZEBO_MODEL_PATH=:$(pwd)/src/simulation/models
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."
  • 赋予权限
sudo chmod +x load_volans_env.sh
  • 执行加载
source load_volans_env.sh

测试:

  • 启动gazebo
source load_volans_env.sh
roslaunch simulation circular_px4.launch

纠错,疑问,交流: 请进入讨论区点击加入Q群

获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


标签: px4与仿真入门教程