Skip to content

Instantly share code, notes, and snippets.

@kanishkaganguly
Last active October 31, 2018 04:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kanishkaganguly/6875ee6778f206e6e1f2a17620cc815f to your computer and use it in GitHub Desktop.
Save kanishkaganguly/6875ee6778f206e6e1f2a17620cc815f to your computer and use it in GitHub Desktop.
[DEPRECATED] ShadowRobot Dexterous Hand Launch Protocol

Setup Workstation with Docker

  • Install and test Docker CE. You can find instructions on how to do this here. Make sure to add your user to the docker group, and log out and in before continuing.
  • Pull Docker image docker pull shadowrobot/dexterous-hand:kinetic
  • DIRECT NVIDIA IMAGE docker pull shadowrobot/dexterous-hand:kinetic-nvidia-ide
  • Assuming NVidia GPU
    • Install instructions are here. However, they instruct you to install the nvidia-docker-2 package; don't. Instead, install the nvidia-docker package. You may also have to install the nvidia-modprobe package.
    • Download docker_nvidialize.sh script using
    wget https://raw.githubusercontent.com/shadow-robot/sr-build-tools/master/docker/utils/docker_nvidialize.sh
    • Run
    ./docker_nvidialize.sh shadowrobot/dexterous-hand:kinetic
    • Check docker images for shadowrobot/dexterous-hand:kinetic-nvidia entry, if everything has gone correctly.
  • Assuming NVidia
nvidia-docker run -it -e DISPLAY -e LOCAL_USER_ID=$(id -u) -v /tmp/.X11-unix:/tmp/.X11-unix:rw --net=host --privileged shadowrobot/dexterous-hand:kinetic-nvidia
  • Assuming NO NVidia
docker run -it -e DISPLAY -e LOCAL_USER_ID=$(id -u) -v /tmp/.X11-unix:/tmp/.X11-unix:rw --net=host --privileged shadowrobot/dexterous-hand:kinetic
  • Wait for container to start up, it will take a while. A new Terminator window will pop up when ready. Pull up UMD-specific branch of sr_config:
roscd sr_config
git checkout shadowrobot_170911

Add this to bashrc if you don't want to type it each time.

  • By default, there are no net-tools installed on the image. Run:
sudo apt update
sudo apt install net-tools

ShadowHand Launch Commands

  • To run the ShadowHand use roslaunch sr_ethercat_hand_config sr_rhand.launch eth_port:=XXXX where XXXX can be found using ifconfig and selecting the port with no IP configuration.

Docker related commands

  • Once set up completely, type exit to exit the container.
  • To see exited containers, type docker ps -a to see containers and their status.
  • To see images, type docker images -a to see images and their IDs.
  • To save an exited container to its own image, use docker commit CONTAINER_ID NEW_NAME to save a latest image of the container, with changes.
  • Stop and remove all containers using:
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
  • Create persistent storage for host <--> container communication using Docker volumes
  • Create a new folder on the host system, which will be mounted into your container, such as /file/to/path
  • Append new -v parameter to whatever launch sequence you choose:
-v /path/to/file:/path/on/container:rw

Final Launch Commands

Current config launch:

nvidia-docker run -it -e DISPLAY -e LOCAL_USER_ID=$(id -u) -v /tmp/.X11-unix:/tmp/.X11-unix:rw -v /home/kanishka/Documents/Projects/shadowhand/vol/:/mnt/code/:rw --net=host --privileged shadowrobot/dexterous-hand:kinetic-nvidia-ide

roslaunch sr_ethercat_hand_config sr_rhand.launch eth_port:=enxa0cec8126817

docker commit $(docker ps -aq) shadowrobot/dexterous-hand:kinetic-nvidia-ide

docker stop $(docker ps -aq)
docker rm $(docker ps -aq)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment