一、前导:基本环境搭建

Ubuntu18.04配置搭建基于Gazebo的虚拟仿真平台(Px4):无人机(UAV)、无人车等模拟实验平台

如果需要VMware16下已构建好的虚拟机文件,等待后续文章。

二、编译

在/home中新建droneMes文件夹作为工作空间:

 sudo apt-get install libarmadillo-dev ros-melodic-nlopt
  cd droneMes/src
  git clone https://github.com/HKUST-Aerial-Robotics/Fast-Planner.git
  cd ../ 
  catkin_make

在执行catkin_make时报错:

CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by "pcl_conversions"
  with any of the following names:

    pcl_conversionsConfig.cmake
    pcl_conversions-config.cmake

  Add the installation prefix of "pcl_conversions" to CMAKE_PREFIX_PATH or
  set "pcl_conversions_DIR" to a directory containing one of the above files.
  If "pcl_conversions" provides a separate development package or SDK, be
  sure it has been installed.
Call Stack (most recent call first):
  Fast-Planner/uav_simulator/map_generator/CMakeLists.txt:8 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/ganahe/droneMes/build/CMakeFiles/CMakeOutput.log".
See also "/home/ganahe/droneMes/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

解决:

sudo apt-get install ros-melodic-navigation
sudo apt-get install ros-melodic-pcl-conversions
 sudo apt-get install ros-melodic-pcl-ros

2.2 启动Rviz模拟

打开新的终端,定位到上一布建立的工作空间(cd /home/droneMes/)并执行:

source devel/setup.bash && roslaunch plan_manage rviz.launch

打开新终端,定位到工作空间,并执行:

source devel/setup.bash && roslaunch plan_manage kino_replan.launch

点击2D Nav Goal选定目飞行目标,即可实现基本的模拟工作。

作者:GanAHE 文章来源:dgzc.ganahe.top