欢迎来到最详细的UUVSimulator安装教程!本文将手把手教你如何在Ubuntu 20.04上配置ROS Noetic和Gazebo 11,并成功运行UUV Simulator。无论你是水下机器人新手还是资深开发者,这篇ROS Noetic教程都能帮你快速搭建完整的仿真环境。
首先,确保你的Ubuntu 20.04系统已经更新到最新。打开终端(Ctrl+Alt+T),执行以下命令:
sudo apt update && sudo apt upgrade -y 为了后续编译顺利,安装一些基础开发工具:
sudo apt install -y git curl wget cmake build-essential ROS Noetic是Ubuntu 20.04的官方推荐版本。按照以下步骤安装完整桌面版(包含Gazebo 11):
# 设置sources.listsudo sh -c "echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list"curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -sudo apt updatesudo apt install -y ros-noetic-desktop-full 安装完成后,初始化rosdep:
sudo rosdep initrosdep update 设置环境变量(建议添加到~/.bashrc):
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrcsource ~/.bashrc ROS Noetic桌面版自带Gazebo 11,你可以通过以下命令检查版本:
gazebo --version 如果显示版本为11.x,说明安装成功。为了后续仿真,还需要安装Gazebo的ROS接口:
sudo apt install -y ros-noetic-gazebo-ros-pkgs ros-noetic-gazebo-ros-control mkdir -p ~/catkin_ws/srccd ~/catkin_ws/srccatkin_init_workspacecd ~/catkin_wscatkin_make 设置工作空间环境变量:
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrcsource ~/.bashrc 进入工作空间源码目录,克隆UUV Simulator仓库:
cd ~/catkin_ws/srcgit clone https://github.com/uuvsimulator/uuv_simulator.git 安装系统依赖(使用rosdep):
cd ~/catkin_wsrosdep install --from-paths src --ignore-src -r -y 如果遇到缺少其他依赖,手动安装:
sudo apt install -y ros-noetic-joy ros-noetic-teleop-twist-keyboard 开始编译(耐心等待):
catkin_make 如果编译过程中出现内存不足,可以限制并行编译:catkin_make -j2
启动一个简单的UUV示例:
roslaunch uuv_gazebo_worlds ocean_waves.launch 如果一切正常,Gazebo将打开一个带有波浪的水下场景。你可以再开一个终端,用键盘控制机器人:
roslaunch uuv_control_utils send_velocity_teleop.launch export SVGA_VGPU10=0启动。mavros等包 → 单独安装:sudo apt install ros-noetic-mavros*uuv_... launch文件 → 确认工作空间已source,且编译成功。至此,你已经完成了UUVSimulator安装、ROS Noetic教程实践、Gazebo11配置以及Ubuntu20.04仿真环境的搭建。现在你可以开始你的水下机器人算法研究了!如有疑问,欢迎在评论区留言。
本文由主机测评网于2026-03-03发表在主机测评网_免费VPS_免费云服务器_免费独立服务器,如有疑问,请联系我们。
本文链接:https://www.vpshk.cn/20260328386.html