一、win10環(huán)境下在線搭建
1、編譯器安裝。
vs2022下載地址
2、安裝chocolatey
chocolatey是windows下的一個包管理工具,下載ros相關(guān)的包都采用這個工具。
安裝過程:在菜單欄中搜索 x64 Native Tools Command Prompt for VS 2022 (2),然后右擊選擇管理員運(yùn)行,輸入:
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
3、安裝Git
choco upgrade git -y
4、ROS安裝
確保您在C盤中有10GB的可用空間,用于安裝ROS系統(tǒng)。
還是以管理員方式打開 x64 Native Tools Command Prompt for VS 2022 (2),依次輸入:
mkdir c:\opt\chocolatey
set ChocolateyInstall=c:\opt\chocolatey
choco source add -n=ros-win -s="https://aka.ms/ros/public" --priority=1
choco upgrade ros-melodic-desktop_full -y --execution-timeout=0
等待
5、創(chuàng)建ROS命令窗口快捷方式
找到VsDevCmd.bat 如:C:\Program Files (x86)\Microsoft Visual Studio\2022\Community\Common7\Tools\VsDevCmd.bat
C:\Windows\System32\cmd.exe /k "C:\Program Files (x86)\Microsoft Visual Studio\2022\Community\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64&& set ChocolateyInstall=c:\opt\chocolatey&& c:\opt\ros\melodic\x64\setup.bat
打開三個控制臺分別輸入如下命令后,出現(xiàn)小烏龜說明安裝成功。
roscore
rosrun turtlesim turtlesim_node
rosrun turtlesim turtle_teleop_key.exe
二、win10環(huán)境下在線搭建
1、編譯器安裝。略
2、安裝chocolatey。略
3、安裝Git。略
4、ROS安裝
確保您在C盤中有10GB的可用空間,用于安裝ROS系統(tǒng)。
1.離線包下載地址
ros-melodic-desktop_full離線包下載
還是以管理員方式打開 x64 Native Tools Command Prompt for VS 2022 (2),依次輸入:
mkdir c:\opt\chocolatey
set ChocolateyInstall=c:\opt\chocolatey
修改安裝包搜索優(yōu)先級,如圖所示,是下載的nupkg文件所在的文件夾地址。
choco source add -n=ros-win -s=“E:\roswininstall”
choco source remove -n=chocolatey
choco source add -n=chocolatey -s"https://chocolatey.org/api/v2/" --priority=1
choco upgrade chocolatey-windowsupdate.extension
choco upgrade ros-melodic-desktop_full -y --execution-timeout=0
三、Linux安裝
ubuntu各版本下載地址
ubuntu下載地址
vmware安裝ubuntu時記得刪除autoinst文件,否則會卡死
注:千萬不要用20 版本的ubuntu系統(tǒng)問題很多,本人安裝兩天沒成功。
1、安裝自適應(yīng)桌面插件
sudo apt-get install open-vm-tools
sudo apt-get install open-vm-tools-desktop
如果上述兩條指令安裝失敗則配置如下文件,再次嘗試
- 打開source.list
sudo gedit /etc/apt/sources.list
- 替換內(nèi)容清華源
# 默認(rèn)注釋了源碼鏡像以提高 apt update 速度,如有需要可自行取消注釋
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# 預(yù)發(fā)布軟件源,不建議啟用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
一定要配置下圖不然不會下載成功
2、設(shè)置安裝源
官方默認(rèn)安裝源:
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
或來自國內(nèi)清華的安裝源
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'
或來自國內(nèi)中科大的安裝源
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'
3、設(shè)置密鑰
這里可能有網(wǎng)絡(luò)問題,換成手機(jī)熱點(diǎn)就可以解決
gpg: 從公鑰服務(wù)器接收失敗:Server indicated a failure
可能是網(wǎng)絡(luò)的原因,檢查一下
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
4、安裝
sudo apt update
等待…
安裝下1就不要安裝2
sudo apt install ros-noetic-desktop-full
或者
安裝下2就不要安裝1文章來源:http://www.zghlxwxcb.cn/news/detail-446506.html
sudo apt install ros-melodic-desktop-full
5、設(shè)置環(huán)境變量
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
5、初始化rosdep
sudo rosdep init
rosdep update
6、安裝構(gòu)建依賴
sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
參考文章
ubuntu取消鎖屏
官方win10安裝攻略
基于win10的vs2019的環(huán)境搭建
基于win10的vs2022的環(huán)境搭建
官方linux安裝攻略
Linux環(huán)境搭建國內(nèi)源配置
vmware環(huán)境搭建ros
linux公鑰失敗攻略
win10離線安裝ros
win 環(huán)境下開發(fā)ros
win 環(huán)境下開發(fā)ros2
ROS2進(jìn)階:VS2019調(diào)試ROS2-examples程序文章來源地址http://www.zghlxwxcb.cn/news/detail-446506.html
到了這里,關(guān)于window10環(huán)境下搭建ros的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!