Skip to content

Instantly share code, notes, and snippets.

@vfdev-5
Last active August 14, 2023 11:00
Show Gist options
  • Save vfdev-5/b7685371071036cb739f23b3794b5b83 to your computer and use it in GitHub Desktop.
Save vfdev-5/b7685371071036cb739f23b3794b5b83 to your computer and use it in GitHub Desktop.

Revisions

  1. vfdev-5 revised this gist May 23, 2019. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -2,10 +2,11 @@

    We need to use docker-machine to handle USB ports inside the docker.

    ## Docker Machine
    ## Docker Machine (0.16.1)

    - Install docker-machine: https://docs.docker.com/machine/install-machine/
    - Install virtualbox
    - Docker version: 18.09.2, build 6247962
    - Install virtualbox >= 6.0

    ### Configuration

  2. vfdev-5 revised this gist May 23, 2019. 1 changed file with 0 additions and 5 deletions.
    5 changes: 0 additions & 5 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -79,9 +79,4 @@ docker run --rm \
    ros_rviz:latest rviz
    ```

    **Currently does not work**
    ```
    rviz: /build/ogre-1.9-B6QkmW/ogre-1.9-1.9.0+dfsg1/RenderSystems/GL/src/OgreGLSupport.cpp:56: virtual void Ogre::GLSupport::initialiseExtensions(): Assertion `pcVer && "Problems getting GL version string using glGetString"' failed.
    ```


  3. vfdev-5 revised this gist May 23, 2019. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -58,6 +58,8 @@ Configure following: https://sourabhbajaj.com/blog/2017/02/07/gui-applications-d
    - https://sourabhbajaj.com/blog/2017/02/07/gui-applications-docker-mac/#run-xquartz
    - get host IP: `ifconfig en0 | grep inet | awk '$1=="inet" {print $2}'`

    - `defaults write org.macosforge.xquartz.X11 enable_iglx -bool true`

    #### Run XQuartz
    ```
    IP=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}')
  4. vfdev-5 revised this gist May 23, 2019. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -77,5 +77,9 @@ docker run --rm \
    ros_rviz:latest rviz
    ```

    **Currently does not work**
    ```
    rviz: /build/ogre-1.9-B6QkmW/ogre-1.9-1.9.0+dfsg1/RenderSystems/GL/src/OgreGLSupport.cpp:56: virtual void Ogre::GLSupport::initialiseExtensions(): Assertion `pcVer && "Problems getting GL version string using glGetString"' failed.
    ```


  5. vfdev-5 revised this gist May 23, 2019. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -58,6 +58,12 @@ Configure following: https://sourabhbajaj.com/blog/2017/02/07/gui-applications-d
    - https://sourabhbajaj.com/blog/2017/02/07/gui-applications-docker-mac/#run-xquartz
    - get host IP: `ifconfig en0 | grep inet | awk '$1=="inet" {print $2}'`

    #### Run XQuartz
    ```
    IP=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}')
    xhost +${IP}
    ```

    #### Install RViz to ROS Image

    #### Run
  6. vfdev-5 created this gist May 23, 2019.
    75 changes: 75 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,75 @@
    # ROS development on MacOSX using docker

    We need to use docker-machine to handle USB ports inside the docker.

    ## Docker Machine

    - Install docker-machine: https://docs.docker.com/machine/install-machine/
    - Install virtualbox

    ### Configuration

    Follow this gist: https://gist.github.com/stonehippo/e33750f185806924f1254349ea1a4e68
    to setup USB to be visible inside the container.


    ## Pull ROS image
    ```
    docker pull ros:latest
    ```

    ## Run container

    Following the guide : https://docs.docker.com/samples/library/ros/

    ### Create network
    ```
    docker network create ros-network
    ```

    ### Container with roscore only

    ```
    docker run -it --rm --net ros-network --name=roscore ros:latest roscore
    ```

    ### Dev container

    Command with debug support:
    ```
    docker run -it --rm \
    --security-opt seccomp:unconfined \
    --net ros-network \
    -p 9091:9091 \
    --device=/dev/ttyUSB0 \
    -v $PWD:/home/project \
    --name=$container_name \
    --workdir=/home/project \
    $image_name /bin/bash
    ```

    ### RViz container

    #### Install XQuartz

    Install it from : https://www.xquartz.org/

    Configure following: https://sourabhbajaj.com/blog/2017/02/07/gui-applications-docker-mac/
    - https://sourabhbajaj.com/blog/2017/02/07/gui-applications-docker-mac/#run-xquartz
    - get host IP: `ifconfig en0 | grep inet | awk '$1=="inet" {print $2}'`

    #### Install RViz to ROS Image

    #### Run
    ```
    docker run --rm \
    --env="DISPLAY=192.168.5.43:0" \
    --volume="$HOME/.Xauthority:/root/.Xauthority:rw" \
    --net ros-network \
    --env ROS_MASTER_URI=http://roscore:11311 \
    --name=rviz \
    ros_rviz:latest rviz
    ```