ROS on Windows installation

  Show EOL distros: 

ROS CTurtle is EOL, and these instructions for getting it to work on Windows are severely outdated. They are only kept here for historical reasons.

Please do not expect these steps to work, or try to follow them.

For future Windows support, see the relevant ROS2 resources.

Running ROS Software on Windows

ROS is currently not supported on Windows, but it is possible to run parts of ROS on Windows. In particular, you can:

  • run some of the Python code, including the ROS client library for Python (rospy). This is useful, for example, if you need to interface a process on Windows with a ROS graph running elsewhere.

  • run C++ code under Cygwin

Each of these possibilities is discussed below.

Running Python code on Windows

If you have Python code on Windows you wish to interface with ROS, you can use the rospy client library. This will enable you to run Python-based ROS nodes. Higher-level tools, like roslaunch, are not expected to work on Windows, though they can be ported.

There are some extra things you will have to do that, while cumbersome, will get you off the ground.

What you need

Copying generated message and service files

You will need the auto-generated Python files for the messages and services you plan to use. The easiest way to do this is to compile your packages on a non-Windows setup, then copy these files over.

In order to figure out which packages have messages, you can run:

$ rosmsg packages

You can then copy the src/package_name/msg from these packages onto your Windows machine.

In order to figure out which packages have services, you can run:

$ rossrv packages

You can then copy the src/package_name/srv from these packages onto your Windows machine.

Disable calls to roslib.load_manifest

rospy uses the rospack library to dynamically generate the appropriate PYTHONPATH. rospack doesn't work on Windows (yet), so you will need to disable these calls and instead configure your Python path manually.

Here is an example of how to disable this call in roslib/src/roslib/launcher.py:

def load_manifest(package_name, bootstrap_version="0.7"):
    """
    Update the Python sys.path with package's dependencies
    @param package_name: name of the package that load_manifest() is being called from.
    @type  package_name: str
    @param bootstrap_version: (keyword argument) do not use. Soon to be deprecated
    @type  bootstrap_version: str
    """
    if 1 or package_name in _bootstrapped:
        return

Note the "1 or" on the second-to-last line.

Setup your environment

You will need to set your ROS_MASTER_URI and ROS_ROOT environment variables. Also set PYTHONPATH variable to the folder containing the copied packages

Quick Check

Ideally, you'll have a folder containing the following python packages

  • roslib - copied from $HOME/ros/ros/core/roslib/src/
  • rospy - copied from $HOME/ros/ros_comm/clients/rospy/src/
  • std_msgs - copied from $HOME/ros/ros_comm/messages/std_msgs/src/
  • rosgraph_msgs - copied from $HOME/Users/tingfan/ros/ros_comm/messages/rosgraph_msgs/src/
  • other packages - copied from rospack find $package_name/src

These packages list above should be enough for running at least the "talker_listener" tutorial.

ROS windows port by Robotics Equipment Corporation

A native windows port is available here. The port currently includes

  • roslib
  • roscpp
  • rosconsole
  • message_filters
  • tf
  • actionlib

Its main purpose is to enable developers to create shiny windows GUIs connected to the ROS system running on the Linux driven robot.

System requirements:

  • Windows 7 or Vista (32/64 bit)
  • Microsoft Visual Studio 2008 or Microsoft Visual Studio 2008 Express Edition
  • CMake (version 2.8 or later)

Running with Cygwin

Please see Tingfan Wu's tutorial.

ROS Diamondback is EOL, and these instructions for getting it to work on Windows are severely outdated. They are only kept here for historical reasons.

Please do not expect these steps to work, or try to follow them.

For future Windows support, see the relevant ROS2 resources.

Overview

We are go! Well, not fully yet, but there is partial functionality and enough to be useful in some situations. To be practical, we are not targeting the windows environment as a full blown replacement for linux-ros as windows doesn't have the mechanisms to handle the scaling of complexity (e.g. rosdeps), but it needs to be able to be useful in some simple use case scenarios. For example,

  • Monitoring/debugging the robot from a remote windows pc.
  • Users interfacing with a robot via simple controlling applications.
  • Scenario apps (e.g. smach) that are more conveniently run on the network.
  • Manager applications for controlling networked robots.
  • Computationally heavy algorithms running on an idle pc away from the robot.

Status

Current functionality has been enabled by compiling with the mingw cross-compiler in linux. The cross compiling is managed by eros and the windows specific utilities and tools are in win_ros. As ros moves to a purely cmake build environment, we hope to bring in the msvc compatibility.

{X} Under Construction...

ROS Electric is EOL, and these instructions for getting it to work on Windows are severely outdated. They are only kept here for historical reasons.

Please do not expect these steps to work, or try to follow them.

For future Windows support, see the relevant ROS2 resources.

Overview

We are go! Well, not fully yet, but there is partial functionality and enough to be useful in some situations. To be practical, we are not targeting the windows environment as a full blown replacement for linux-ros as windows doesn't have the mechanisms to handle the scaling of complexity (e.g. rosdeps), but it needs to be useful in some simple use case scenarios. For example,

  • Monitoring/debugging/interfacing with ros robots from a remote windows pc.
  • Integrating with programs that only utilise windows drivers/libraries.
  • Using ros comms to connect ros robots to a much larger networked environment.
  • Computationally heavy algorithms running on an idle pc away from the robot.

The current status is still experimental. Various components are working and we hope to start realising some real usefulness with electric. You can check the roadmap to see what's been done and what is on the immediate todo list (if you're interested in helping, contact one of the devs!).

Getting Started

Windows C++ Development

This is for native windows development with the microsoft visual studio compiler (currently supporting visual studio/express 10+).

For more advanced usage:

Linux C++ Development

This is for the control roboticists who love working in linux and get flustered when asked to build windows apps for the rest of the world (namely users/test engineers) there is the mingw cross-compiler. There is also qt support here - write the code once and compile your qt app for both windows and linux without any changes.

Where To Go From Here

All guides and documentation for installing and using ros on windows can be found in the win_ros wiki pages.

Overview

ROS Groovy is EOL, and these instructions for getting it to work on Windows are severely outdated. They are only kept here for historical reasons.

Please do not expect these steps to work, or try to follow them.

For future Windows support, see the relevant ROS2 resources.

Under development - ymmv.

Information

Getting Started

WinRos on Windows

This is for native windows development with the microsoft 2010 compiler. Currently supporting either windows sdk 7.1 (cl/nmake) or visual studio 10.0.

For more advanced users who are familiar with ros and catkin:

WinRos on Linux

{X} It is not likely we'll have mingw re-enabled for groovy.

This is for the control roboticists who love working in linux and get flustered when asked to build windows apps for the rest of the world (namely users/test engineers) there is the mingw cross-compiler. There is also qt support here - write the code once and compile your qt app for both windows and linux without any changes.

Support

  • Contact - where to go for help or to ask about contributing.

  • Troubleshooting - if you are having issues, consult this first.

  • Additional Help - general questions about working in win_ros.

Contributing

  • Roadmap/ChangeList - current status and plans.

  • Contributing - if you're interested in helping, either with the infrastructure or porting stacks, start here.

All guides and documentation for installing and using ros on windows can be found in the win_ros wiki pages.

Overview

ROS Hydro is EOL, and these instructions for getting it to work on Windows are outdated. They are only kept here for historical reasons.

Please do not expect these steps to work, or try to follow them.

For future Windows support, see the relevant ROS2 resources.

Information

Getting Started

WinRos on Windows

This is for native Windows development with the Microsoft Visual C++ Compilers 2010. Currently supporting either Windows SDK 7.1 (cl/nmake) or Visual Studio 10.0.

  • Msvc Status - what's working and what's not.

  • Msvc SDK - installing, configuring and verifying a pre-built sdk.

  • Msvc SDK Projects - developing projects with visual studio and the sdk.

  • Msvc SDK Messages - developing new ros msg types with the sdk.

  • Msvc Runtime Environment - rosmaster, roslaunch'ers, rosparam and ros logging with the sdk.

For more advanced users who are familiar with ros and catkin:

Support

  • Contact - where to go for help or to ask about contributing.

  • Troubleshooting - if you are having issues, consult this first.

  • Additional Help - general questions about working in win_ros.

Contributing

  • Roadmap/ChangeList - current status and plans.

  • Contributing - if you're interested in helping, either with the infrastructure or porting stacks, start here.

Refer to hydro version for old installation instructions.

Refer to lunar if you are able to use a newer ROS version.

Windows Operating System

  • ROS1 for Windows requires 64-bit Windows 10 Desktop or Windows 10 IoT Enterprise.

Reserve space for the installation

  • Clean and back up any existing data under c:\opt before proceeding.

  • c:\opt is the required install location. Relocation is not currently enabled.

  • Please ensure you have 10 GB of free space on the C:\ drive for the installation and development.

Install Visual Studio 2019

Building a ROS project for Windows requires Visual Studio and the Microsoft SDKs for Windows.

  • Download Visual Studio 2019

    • Include "Desktop development with C++" workload.
    • If you are building WinML, please include the "Universal Windows Application" workload.

Install Windows Package Manager

Chocolatey is a package manager for Windows. It is used to make it easy to install tools and libraries needed for building and running ROS projects.

  • In the Start Menu, find the "x64 Native Tools Command Prompt for VS 2019" item.
  • Right Click, select More then "Run as Administrator"
  • Copy the following command line:
    • @"%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" 
    • Paste it into the command window.
    • Approve any prompts
    • Once it has completed, close the command prompt to complete the install.
  • Install Git:
    • Reopen the Visual Studio Command Window as described above.
    • Please install Git using the command here, even if you have it installed as an application.
      choco upgrade git -y
    • After Git installed, ensure Git is now available from ROS Command Prompt.
      git --version
    • Close and Reopen the Visual Studio Command Window as described above.

Binary Package Installation

To set up ROS for Windows follow these recommended steps:

ROS 1 Last Known Good (LKG) Build Installation

To get things started, install the recommended desktop_full metapackage. A Metapackage is a collection of other packages. The Desktop-Full metapackage refers to a number of other packages needed to build, run, debug and visualize a robot.

Open the Visual Studio Command Prompt as Administrator as described above.

choco source add -n=ros-win -s="https://roswin.azurewebsites.net/api/v2" --priority=1
choco upgrade ros-melodic-desktop_full -y --execution-timeout=0

ROS 2 Nightly Build Installation

To get started with ROS 2, one can also follow the similar steps to install ROS 2 from the same Chocolatey feed.

For example, if you want to install ROS2 Dashing nightly build, open the ROS Command Prompt created above and approve the administrative elevation if not already opened.

choco source add -n=ros-win -s="https://roswin.azurewebsites.net/api/v2" --priority=1
choco upgrade ros-dashing-desktop -y --execution-timeout=0 --pre

Create a ROS Command Window shortcut

In order to use ROS on Windows, the ROS setup script needs to be called in each command Window. In order to not forget in the future, it is helpful to have a ROS shortcut which does this automatically.

  • Create an Administrative command line shortcut for Visual Studio:
  • Right click in a Windows Explorer folder, select New > Shortcut

  • In the shortcut path, copy the highlighted command line from the following options, depending on the Visual Studio install above:
    • 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 && 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 && 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 && c:\opt\ros\melodic\x64\setup.bat
    • Name the shortcut "ROS"
    • 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.

(Optional) Using the new Windows Terminal

Microsoft is working on a new open source terminal for Windows, which includes many improvements over the built in command line, including tabs and appearance customization. You can install it from the Microsoft Store.

To set up the terminal for ROS:

  • Find the Windows Terminal from the start menu, right click and select 'Run as Administrator'
  • Select settings from the drop down arrow next to the Add Tab (+) Button.
  • In the "profiles" section, add a new block for ROS.

    "profiles" : 
    [
        {
            "acrylicOpacity" : 0.5,
            "background" : "#012456",
            "closeOnExit" : true,
            "colorScheme" : "Campbell",
            "commandline" : "C:\\Windows\\System32\\cmd.exe /k \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\Tools\\VsDevCmd.bat\" -arch=amd64 -host_arch=amd64 && c:\\opt\\ros\\melodic\\x64\\setup.bat",
            "cursorColor" : "#FFFFFF",
            "cursorShape" : "bar",
            "fontFace" : "Consolas",
            "fontSize" : 10,
            "guid" : "{xxxx}",
            "historySize" : 9001,
            "icon" : "ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png",
            "name" : "ROS",
            "padding" : "0, 0, 0, 0",
            "snapOnInput" : true,
            "startingDirectory" : "c:\\ws",
            "useAcrylic" : true
        },
  • Customize the placeholder {xxxx} in the "guid" entry with a guid generator.
  • (Optionally) Set this guid as the "defaultProfile" in the "Globals" section.

{
    "globals" : 
    {
        "alwaysShowTabs" : true,
        "copyOnSelect" : false,
        "defaultProfile" : "{xxxx}",
        ....
    }
}

When launching the new Windows terminal, please remember to Run as Administrator, by right clicking on the Windows Terminal and Select *Run as Administrator*. There is a Always Run Terminal elevated feature request that needs to be implemented before this requirement is lifted.

Stay Up to Date

If you want to update your ROS install, use Chocolatey's upgrade feature:

Open the ROS Command Prompt created above and approve the administrative elevation if not already opened.

Run the following command:

choco upgrade ros-melodic-desktop_full -y --execution-timeout=0

It is recommended to add --execution-timeout=0 to accommodate a chocolatey install failure due to slow network.

Wiki: Installation/Windows (last edited 2019-11-20 23:58:42 by louamadio)