赞
踩
用鱼香ROS一键安装,不会有网络问题导致缺失文件
语雀教程中下载他打包好的PX4固件(图片中的PX4_Firmware.zip)。
Make之后缺少Python库,然后缺少pip3,
然后make报错。解决办法:
sudo apt-get install libgstreamer-plugins-base1.0-dev
检查mavros是否安装:
安装mavros:https://masoudir.github.io/mavros_tutorial/
sudo apt-get install ros-melodic-mavros ros-melodic-mavros-extras
wget https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh
chmod a+x install_geographiclib_datasets.sh
./install_geographiclib_datasets.sh
需要root权限:加上sudo执行
还有gazebo的安装,这里不展开(鱼香ros一键安装如果不是精简版好像是带有gazebo的),安装后进入文件夹,运行:make px4_sitl_default gazebo。然后可以输入commander takeoff
或者commander land
来测试
然后来测试roslaunch px4 mavros_posix_sitl.launch
发现失败
修改 ~/.bashrc,加入以下代码,注意路径匹配,前两个source顺序不能颠倒
source ~/catkin_ws/devel/setup.bash
source ~/PX4_Firmware/Tools/setup_gazebo.bash ~/PX4_Firmware/ ~/PX4_Firmware/build/px4_sitl_default
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/PX4_Firmware
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/PX4_Firmware/Tools/sitl_gazebo
再运行:
source ~/.bashrc
然后运行如下命令,此时会启动Gazebo,如下图所示。
cd ~/PX4_Firmware
roslaunch px4 mavros_posix_sitl.launch
并运行
rostopic echo /mavros/state
若connected: True,则说明MAVROS与SITL通信成功。如果是false,一般是因为.bashrc里的
路径写的不对,请仔细检查。
然后需要安装地面站QGroundControl,https://docs.qgroundcontrol.com/master/en/getting_started/download_and_install.html
运行出问题:
解决:https://forum.qt.io/topic/120129/usr-lib-x86_64-linux-gnu-libqt5core-so-5-version-qt_5-15-not-found
desmond@desmond:~/Downloads$ export LD_LIBRARY_PATH=HERE_PATH_TO_QT_LIBS_DIR && ./QGroundControl.AppImage
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。