Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker new #41

Open
wants to merge 4 commits into
base: local_planner_subgoalmode
Choose a base branch
from
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
31 changes: 10 additions & 21 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ RUN apt-get -y update && apt-get install -y \
python3.6 \
python3.6-dev \
libpython3.6-dev \
python3-scipy \
python3-catkin-pkg-modules \
python3-rospkg-modules \
python3-empy \
Expand All @@ -42,6 +43,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y keyboard-configuration
RUN apt-get install -y software-properties-common
RUN apt-get install wget

# 2. Prepare virtual environment
RUN pip3 install --upgrade pip \
&& pip3 install virtualenv virtualenvwrapper\
Expand All @@ -62,46 +64,33 @@ ENV WORKON_HOME=/root/.python_env \
RUN . /usr/local/bin/virtualenvwrapper.sh \
&& mkvirtualenv --python=python3.6 rosnav \
&& workon rosnav \
&& pip3 install --upgrade pip \
&& pip3 install --extra-index-url https://rospypi.github.io/simple/ rospy rosbag tf tf2_ros --ignore-installed \
&& pip3 install pyyaml catkin_pkg netifaces pathlib \
&& pip3 install filelock
#&& pip3 --no-cache-dir install stable-baselines3


# 4. Install Arena-Rosnav repo and compile
RUN git clone https://github.com/ignc-research/arena-rosnav /root/catkin_ws/src/arena-rosnav
RUN wget https://raw.githubusercontent.com/Ann-Rachel/arena-rosnav/docker_new/docker-compose.yml
RUN cp docker-compose.yml /root/catkin_ws/src/arena-rosnav
RUN mkdir /root/catkin_ws/src/arena-rosnav/docker/
RUN wget https://raw.githubusercontent.com/Ann-Rachel/arena-rosnav/docker_new/docker/entrypoint_train.sh \
&& wget https://raw.githubusercontent.com/Ann-Rachel/arena-rosnav/docker_new/docker/Dockerfile \
&& wget https://raw.githubusercontent.com/Ann-Rachel/arena-rosnav/docker_new/docker/novnc.env \
&& wget https://raw.githubusercontent.com/Ann-Rachel/arena-rosnav/docker_new/docker/py_train.sh \
&& wget https://raw.githubusercontent.com/Ann-Rachel/arena-rosnav/docker_new/docker/ros.sh \
&& wget https://raw.githubusercontent.com/Ann-Rachel/arena-rosnav/docker_new/docker/roslaunch.env \
&& wget https://raw.githubusercontent.com/Ann-Rachel/arena-rosnav/docker_new/docker/train_params.csv
RUN cp entrypoint_train.sh /root/catkin_ws/src/arena-rosnav/docker \
&& cp Dockerfile /root/catkin_ws/src/arena-rosnav/docker \
&& cp novnc.env /root/catkin_ws/src/arena-rosnav/docker \
&& cp py_train.sh /root/catkin_ws/src/arena-rosnav/docker \
&& cp ros.sh /root/catkin_ws/src/arena-rosnav/docker \
&& cp roslaunch.env /root/catkin_ws/src/arena-rosnav/docker \
&& cp train_params.csv /root/catkin_ws/src/arena-rosnav/docker

RUN . /usr/local/bin/virtualenvwrapper.sh \
&& . /opt/ros/melodic/setup.sh \
&& workon rosnav \
&& pip install gym \
&& pip install PyQt5 \
&& pip3 install --upgrade pip \
&& pip3 install gym \
&& pip3 install PyQt5 \
&& pip3 install scipy \
&& cd /root/catkin_ws/src/arena-rosnav \
&& git checkout local_planner_subgoalmode \
&& rosws update \
&& cd /root/catkin_ws/src/forks/stable-baselines3 \
&& git pull \
&& pip install -e .
&& pip3 install -e .

#RUN apt-get -y update && apt-get install -y libvtk7.1-qt
RUN . /opt/ros/melodic/setup.sh \
&& cd /root/catkin_ws \
#&& catkin_make -j1 -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 \
&& catkin_make -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 \
&& echo $'source /root/catkin_ws/devel/setup.bash' >> /root/.bashrc

Expand Down
31 changes: 10 additions & 21 deletions docker/Dockerfile_w
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ RUN apt-get -y update && apt-get install -y \
python3.6 \
python3.6-dev \
libpython3.6-dev \
python3-scipy \
python3-catkin-pkg-modules \
python3-rospkg-modules \
python3-empy \
Expand All @@ -42,6 +43,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y keyboard-configuration
RUN apt-get install -y software-properties-common
RUN apt-get install wget

# 2. Prepare virtual environment
RUN pip3 install --upgrade pip \
&& pip3 install virtualenv virtualenvwrapper\
Expand All @@ -62,46 +64,33 @@ ENV WORKON_HOME=/root/.python_env \
RUN . /usr/local/bin/virtualenvwrapper.sh \
&& mkvirtualenv --python=python3.6 rosnav \
&& workon rosnav \
&& pip3 install --upgrade pip \
&& pip3 install --extra-index-url https://rospypi.github.io/simple/ rospy rosbag tf tf2_ros --ignore-installed \
&& pip3 install pyyaml catkin_pkg netifaces pathlib \
&& pip3 install filelock
#&& pip3 --no-cache-dir install stable-baselines3


# 4. Install Arena-Rosnav repo and compile
RUN git clone https://github.com/ignc-research/arena-rosnav /root/catkin_ws/src/arena-rosnav
RUN wget https://raw.githubusercontent.com/Ann-Rachel/arena-rosnav/docker_new/docker-compose.yml
RUN cp docker-compose.yml /root/catkin_ws/src/arena-rosnav
RUN mkdir /root/catkin_ws/src/arena-rosnav/docker/
RUN wget https://raw.githubusercontent.com/Ann-Rachel/arena-rosnav/docker_new/docker/entrypoint_train.sh \
&& wget https://raw.githubusercontent.com/Ann-Rachel/arena-rosnav/docker_new/docker/Dockerfile \
&& wget https://raw.githubusercontent.com/Ann-Rachel/arena-rosnav/docker_new/docker/novnc.env \
&& wget https://raw.githubusercontent.com/Ann-Rachel/arena-rosnav/docker_new/docker/py_train.sh \
&& wget https://raw.githubusercontent.com/Ann-Rachel/arena-rosnav/docker_new/docker/ros.sh \
&& wget https://raw.githubusercontent.com/Ann-Rachel/arena-rosnav/docker_new/docker/roslaunch.env \
&& wget https://raw.githubusercontent.com/Ann-Rachel/arena-rosnav/docker_new/docker/train_params.csv
RUN cp entrypoint_train.sh /root/catkin_ws/src/arena-rosnav/docker \
&& cp Dockerfile /root/catkin_ws/src/arena-rosnav/docker \
&& cp novnc.env /root/catkin_ws/src/arena-rosnav/docker \
&& cp py_train.sh /root/catkin_ws/src/arena-rosnav/docker \
&& cp ros.sh /root/catkin_ws/src/arena-rosnav/docker \
&& cp roslaunch.env /root/catkin_ws/src/arena-rosnav/docker \
&& cp train_params.csv /root/catkin_ws/src/arena-rosnav/docker

RUN . /usr/local/bin/virtualenvwrapper.sh \
&& . /opt/ros/melodic/setup.sh \
&& workon rosnav \
&& pip install gym \
&& pip install PyQt5 \
&& pip3 install --upgrade pip \
&& pip3 install gym \
&& pip3 install PyQt5 \
&& pip3 install scipy \
&& cd /root/catkin_ws/src/arena-rosnav \
&& git checkout local_planner_subgoalmode \
&& rosws update \
&& cd /root/catkin_ws/src/forks/stable-baselines3 \
&& git pull \
&& pip install -e .
&& pip3 install -e .

#RUN apt-get -y update && apt-get install -y libvtk7.1-qt
RUN . /opt/ros/melodic/setup.sh \
&& cd /root/catkin_ws \
#&& catkin_make -j1 -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 \
&& catkin_make -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 \
&& echo $'source /root/catkin_ws/devel/setup.bash' >> /root/.bashrc

Expand Down
24 changes: 20 additions & 4 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Docker version 20.10.7, build f0df350
```
1. clone this repro
```
sudo git clone -b docker_new --depth 1 https://github.com/Ann-Rachel/arena-rosnav /the/folder/you/want
sudo git clone -b docker_new --depth 1 https://github.com/ignc-research/arena-rosnav /the/folder/you/want
```
2. go to the docker folder ../arena-rosnav/docker
```
Expand Down Expand Up @@ -58,7 +58,7 @@ sudo docker run -v "/yourhome/arena-rosnav/docker:/root/catkin_ws/src/arena-rosn
# woking with docker
1.clone this repro
```
sudo git clone -b docker_new --depth 1 https://github.com/Ann-Rachel/arena-rosnav /the/folder/you/want
sudo git clone -b docker_new --depth 1 https://github.com/ignc-research/arena-rosnav /the/folder/you/want
```
2.go to the right folder ../arena-rosnav/docker
```
Expand All @@ -79,8 +79,8 @@ cd ..
6. start docker-compose

```
docker-compose up -d \
docker-compose start \
docker-compose up -d
docker-compose start
```
7. enter the contaier
```
Expand All @@ -91,3 +91,19 @@ docker exec -it arena-rosnav bash
roslaunch arena_bringup start_arena_flatland.launch train_mode:=true use_viz:=true task_mode:=random
```
9. open http://localhost:8080/vnc.html you will see the rviz window in browser

# troubleshooting
Error message:
```c++ fatail error: Killed signal terminated program cc1plus
...
Invoking "make -j8 -l8" failes
```
Solution
in Dockerfile change
```
catkin_make -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3
```
to
```
catkin_make -j1 -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3
```