Dear Windows users who have never used Ubuntu or not having an Ubuntu machine but are so passionate about Robotics, this may help you.
Earlier, ROS (Robot Operating System) was available only in Ubuntu. Now it is also available for Windows.
Today let's know about configuring ROS in our Windows Machine.
What do you need actually?
- You must have a 64-bit Windows 10 system
- Also, it is recommended to have at least 10GB of free space in your C:\ drive for the installation and development.
To build ROS projects for Windows, you must have Visual Studio and the Microsoft SDKs for Windows. You can download a version of Visual Studio (Visual Studio 2019) here. There are three options to be selected while installing.
- Visual Studio Community (Free)
- Visual Studio Professional
- Visual Studio Enterprise
Remember your selection which is very important in near future (I've selected Visual Studio Community)
While installing you have to include Desktop development with C++ in your workload. For this, you may have to spend around 2.5GB of your internet data. If you are also building Microsoft Windows Machine Learning (WinML), you have to include the Universal Windows Platform development in your workload.
After installing Visual Studio, in a feasible folder (say Desktop), create a shortcut (Right Click > New > Shortcut). Once you create it, a new window will open and will ask you to fill the location of the item. Now we have to copy one of the following paths as per our installed Visual Studio and paste it to that shortcut path.
@"%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"
Approve any prompts if arose and once it has been completed, close the command prompt to complete the install.
Re-open the ROS file again and run the following command to install Git.
choco upgrade git -y
You can check whether the installation is successful using this command.
git --version
You can close that window once done.
There are two ROS installations available for now and you can choose one.
- ROS Last Known Good (LKG) Build Installation
- ROS 2 Nightly Build Installation
To install any of it, first, you have to open the ROS file again.
Copy the following commands one by one or all together and execute.
mkdir c:\opt\chocolatey
set ChocolateyInstall=c:\opt\chocolatey
choco source add -n=ros-win -s="https://roswin.azurewebsites.net/api/v2" --priority=1
Now, to install your ROS file, you have to choose one of the two. Copy the following command to install ROS Last Known Good (LKG) Build Installation.
choco upgrade ros-melodic-desktop_full -y --execution-timeout=0
Copy the following commands one by one or all together to install ROS 2 Nightly Build Installation.
choco upgrade ros-eloquent-desktop -y --execution-timeout=0 --pre
Then you have to name the shortcut as ROS and set that shortcut as Administrator (Right Click on the shortcut and choose Properties > Select the Shortcut tab if not already selected > Press the Advanced button > Check the button Run as Administrator > Press OK on the Advanced properties dialog > Press OK on the ROS Properties shortcut dialog).
If you are using Community:
C:\Windows\System32\cmd.exe /k "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64&& set ChocolateyInstall=c:\opt\chocolatey&& c:\opt\ros\melodic\x64\setup.bat
If you are using Professional:
C:\Windows\System32\cmd.exe /k "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64&& set ChocolateyInstall=c:\opt\chocolatey&& c:\opt\ros\melodic\x64\setup.bat
If you are using Enterprise:
C:\Windows\System32\cmd.exe /k "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64&& set ChocolateyInstall=c:\opt\chocolatey&& c:\opt\ros\melodic\x64\setup.bat
Now open it (ROS - created Shortcut) and run the following command.
Wait until the installation gives you success. You must keep a healthy internet connection while installing it.
Once it is done with no error, you can execute roscore to confirm whether you have installed ROS perfectly.
If you get any error, close the ROS file and re-open it, and then copy the following command.
c:\opt\ros\melodic\x64\setup.bat
Then you can copy roscore again and you will get no error. You can try rostopic in another ROS command prompt to see whether you have installed ROS perfectly.
Once it is done, add &&c:\opt\ros\melodic\x64\setup.bat in target behind the existing path (Right-click on ROS command prompt file > Properties, you can see the target).
Feel free to ask questions if you get any issues while installing it.
Hope this helps. Share your thoughts too. Good luck!
Comments
Post a Comment