Wait, what? Are you serious?
Yeah, it is possible to install ROS in Windows, and let us see how can this happens. First of all, for the people who are not familiar with ROS, What is ROS?
The Robot Operating System (ROS) is a robotic middleware. Even though ROS is not an operating system, it offers services built for a heterogeneous cluster of computers such as hardware abstraction, low-level device control, widely-used functionality implementation, process-to-process messaging, and package management.
If you are working on Ubuntu, it doesn’t matter. But what for Windows people? Here we go!
To install software, you may have to satisfy the system requirements. To install ROS in windows, you need the following system requirements.
- You must have a Windows 10 64-bit device
- Also, it is recommended that you have at least 10GB of free space on your C:\ drive for installation and development.
You need Visual Studio and Microsoft SDKs for Windows to develop ROS projects for Windows. You can download the Visual Studio (Visual Studio 2019) edition here. You can choose 1 of the 3 editions available. I’m suggesting Visual Studio Community as it is Free. You can use any edition but choose an updated app.
You need to include Desktop development with C++ in your workload when installing it. You would need to allocate about 2.5GB of your internet data on this. If you are also developing Microsoft Windows Machine Learning (WinML), you must include the development of the Universal Windows Framework in your workload.
Find the “x64 Native Tools Command Prompt for VS 2019" item in the Start menu. Right click, choose “Run as Administrator”. Then, execute the following lines of code at once.
@"%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 occurred and, once done, close the prompt to complete the installation. Open the Visual Studio Command Window as mentioned above to install Git.
choco upgrade git -y
You can ensure the success of installing Git by using this command.
Close and open the Visual Studio Command Window as mentioned above.
After setting up all these, we can now install ROS using the same terminal. Open the Visual Studio Command Prompt as Administrator as mentioned above and execute the following codes.
choco source add -n=ros-win -s="https://aka.ms/ros/public" --priority=1
choco upgrade ros-noetic-desktop_full -y --execution-timeout=0
This will install the latest version ROS Noetic. In this version, you can use Python3 or above.
Build a shortcut (Right Click > New > Shortcut) in a workable folder (say Desktop). If you build it, a new window will open and ask to fill in the location of the item. Now we’ve got to copy one of the following paths as per our Visual Studio built and paste it to that shortcut path.
1.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\noetic\x64\setup.bat
2.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\noetic\x64\setup.bat
3.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\noetic\x64\setup.bat
Rename the shortcut as ROS_Noetic or as you wish!
Execute roscore and see whether all are working fine or not.
If everything is working fine, start programming using ROS. You can create a Hello World program in ROS by following this tutorial.