Search code examples
windowsdockerros

How to Run ROS 1 / ROS2 in frdmrobotics/playground in Docker on Windows and Connect via VcXsrv


I am trying to run the frdmrobotics/playground Docker Image like in this tutorial. And also Connect the Gui via VcXsrv.

I tried to pull the Image but already only got errors. Also I have no idea how I should connect VcXsrv from inside the Image


Solution

  • The Problem with Pulling was solved by updating Docker for Windows by starting it and letting it search for an Update.
    After a Restart I could Pull the image with docker pull frdmrobotics/playground.

    For starting a Container of the Image

    docker run -it frdmrobotics/playground
    

    works, but from the Tutorial cd to the desired development folder e.g.

    cd c:/rosProgramming
    

    and then use:

    docker run -dt --name robot_env --restart unless-stopped -v %cd%:/root/workspace frdmrobotics/playground
    

    That starts the Container which can then be connected to by using:

    docker exec -it robot_env bash
    

    For Connecting VcXsrv I found the Info that I had to set some things in the Image:

    export DISPLAY=192.168.105.1:0.0
    export LIBGL_ALWAYS_INDIRECT=1

    The needed IP Address in that command I got via ipconfig, it is the one which is marked with "(WSL)".
    After that when I started a Programm it Opened in my VcXsrv Instance

    After that you can use:

    cd /root/code/ros1
    

    to navigate to the ros1 environment