Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 37 additions & 4 deletions DockerfileBase
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
ARG cuda_version=9.0
ARG cudnn_version=7
ARG ubuntu_version=16.04

FROM nvidia/cudagl:${cuda_version}-devel-ubuntu${ubuntu_version}
#use the below command if you need cudnn
# FROM nvidia/cuda:${cuda_version}-cudnn${cudnn_version}-devel-ubuntu16.04

#seem to get libgl issues when using the below now? was working before...
#https://github.com/osrf/docker_images/blob/master/ros/kinetic/ubuntu/xenial/desktop-full/Dockerfile
FROM osrf/ros:kinetic-desktop-xenial
#FROM osrf/ros:kinetic-desktop-xenial

# Install some useful basics
RUN apt-get update && \
Expand All @@ -12,6 +21,8 @@ RUN apt-get update && \
htop \
mesa-utils \
git-all \
apt-transport-https \
sudo \
&& \
rm -rf /var/lib/apt/lists/*

Expand Down Expand Up @@ -42,11 +53,27 @@ RUN cd $WS/libfranka && \
make install && \
cd $WS && rm -rf libfranka/build


RUN apt-get update && \
apt-get install -q -y \
wget \
&& \
rm -rf /var/lib/apt/lists/*
#Upgrade Gazebo
RUN sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
RUN wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
RUN apt-get update && apt-get install --no-install-recommends -y \
gazebo7 \
&& rm -rf /var/lib/apt/lists/*

# install Panda robot dependencies + any other packages that are needed
RUN apt-get update && \
apt-get install -q -y \
#ros-kinetic-libfranka \
ros-kinetic-gazebo-ros-pkgs \
ros-kinetic-gazebo-ros-control \
ros-kinetic-joint-state-controller \
ros-kinetic-effort-controllers \
ros-kinetic-joint-trajectory-controller \
ros-kinetic-franka-ros \
ros-kinetic-moveit-simple-controller-manager \
ros-kinetic-joint-trajectory-controller \
Expand All @@ -58,13 +85,19 @@ RUN apt-get update && \
ros-kinetic-moveit-ros-visualization \
ros-kinetic-gazebo-ros \
ros-kinetic-camera-info-manager \
ros-kinetic-effort-controllers \
ros-kinetic-joint-state-controller \
ros-kinetic-moveit-visual-tools \
ros-kinetic-position-controllers \
ros-kinetic-trac-ik-kinematics-plugin \
ros-kinetic-node-manager-fkie \
ros-kinetic-eigen-conversions \
ros-kinetic-object-recognition-msgs \
ros-kinetic-roslint \
libignition-math2-dev \
ros-kinetic-moveit-commander && \
rm -rf /var/lib/apt/lists/*



# setup entrypoint
COPY ./docker_entrypoint.sh /
ENTRYPOINT ["/docker_entrypoint.sh"]
Expand Down
50 changes: 48 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,53 @@
# Example Dockerfile for Franka Emika Panda

TLDR:
1. ```git submodule update --init --recursive``` (to update libfranka)
2. ```make``` (in root directory)
3. ```make nvidia``` (if you have an NVIDIA GPU)
3. ```make nvidia``` (if you have an NVIDIA GPU and are using Docker < 19.03, see below)
4. ```./start.sh```
5. Run a basic simulation with Panda: ```roslaunch panda_moveit_config demo.launch``` (this will open an RVIZ window with the Panda)
5. Run a basic simulation with Panda: ```roslaunch panda_moveit_config demo.launch``` (this will open an RVIZ window with the Panda)

## To use:

### Get Docker Running on Your Host
1. Make sure you have docker client (and daemon) installed on your host OS (see instructions at https://docs.docker.com/get-started/)
1. Check your docker daemon is running correctly. Running most basic docker client commands will verify this e.g.:
```bash
docker image ls
```
1. If the above fails (typically on linux), you may need to restart your docker daemon:
```bash
sudo service docker stop
sudo service docker start
```

### Create docker image from the Dockerfile
1. Make sure you have nvidia drivers and the nvidia-cuda-toolkit installed or your container will try to use the inbuilt CPU graphics instead, and won't run properly. To install the toolkit:
```bash
sudo apt-get install nvidia-cuda-toolkit
```
1. Install nvidia-docker by following the instructions at https://github.com/NVIDIA/nvidia-docker
1. Navigate to the folder you cloned this repo into.
1. ```git submodule update --init --recursive``` (to update libfranka)
1. From within this root directory:
```bash
make
```
If you are using an earlier Docker version than 19.03 AND want to use an NVIDIA GPU, also run the following after the previous make (if you don't have an NVIDIA GPU, SKIP THIS STEP):
```bash
make nvidia
```
1. TODO: Add in any known issues
1. Note: Running `make` above should take approximately 20-30 minutes to generate with a decent GPU/CPU.

### Running the container
1. You have created a docker image above, and can now run it as a container
1. From within the root directory, run the below.
TODO: Instructions on how to include flags to pass in the filepath on your host machine which includes your application specific code
TODO: Add in instructions (port forwarding etc?) to allow connection to Fetch hardware
```bash
./start.sh
```
(you should be able to open a new terminal and run ``start.sh`` as many times as you want to get multiple terminal windows inside the container)
1. If you get an error similar to ``could not select device driver “” with capabilities: [[gpu]]`` , make the following changes to the ``start.sh`` file.
Comment out all lines starting from ``which nvidia-docker > /dev/null 2> /dev/null`` upto ``fi`` (before xhost +) but leave ``DOCKER_COMMAND=docker`` in. (TODO figure out why this happens)