-
Notifications
You must be signed in to change notification settings - Fork 1
/
legged.dockerfile
73 lines (65 loc) · 2.44 KB
/
legged.dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
FROM robotica:webots_ros1_noetic
USER root
# APT Dependencies
COPY dependencies.legged dependencies.legged
RUN apt-get update && \
xargs -a dependencies.legged apt-get install -y -qq
# Install with CMake
## DogBot API
RUN git clone https://github.com/eborghi10/DogBotSoftware.git -b api-ubuntu-focal \
&& mkdir DogBotSoftware/API/build && cd DogBotSoftware/API/build \
&& cmake ../src && make -j$(nproc) \
&& sudo make install \
&& sudo ldconfig
## ifopt
RUN git clone https://github.com/ethz-adrl/ifopt.git -b master \
&& mkdir ifopt/build && cd ifopt/build \
&& cmake .. && make -j$(nproc) \
&& sudo make install \
&& sudo ldconfig
## Towr
RUN git clone https://github.com/eborghi10/towr.git -b ${ROS_DISTRO}-devel \
&& mkdir towr/towr/build && cd towr/towr/build \
&& cmake .. -DCMAKE_BUILD_TYPE=Release && make -j$(nproc) \
&& sudo make install \
&& sudo ldconfig
# Install ROS packages from source
ENV LEGGED_WS=/legged_ws
RUN mkdir -p ${LEGGED_WS}/src
WORKDIR ${LEGGED_WS}/src
RUN apt-get install -yqq python3-catkin-tools python3-vcstool
COPY legged.repos ${LEGGED_WS}/src/legged.repos
RUN vcs import . < legged.repos --recursive
WORKDIR $LEGGED_WS
# Remove CMake package
RUN rm -rf ${LEGGED_WS}/src/towr/towr
RUN apt-get update
USER $USER
RUN rosdep install --from-paths src --rosdistro=${ROS_DISTRO} -yi -r
USER root
RUN /bin/bash -c ". /opt/ros/${ROS_DISTRO}/setup.bash; \
catkin_make -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/ros/${ROS_DISTRO}; \
cd build; make install"
RUN rm -r ${LEGGED_WS}
COPY requirements.legged.txt requirements.legged.txt
RUN cat requirements.legged.txt | xargs pip3 install
# Install gym
RUN git clone https://github.com/openai/gym.git \
&& cd gym \
&& pip install -e .
# Install elevation_mapping packages with catkin_make_isolated
ENV LEGGED_ISOLATED_WS=/legged_isolated_ws
RUN mkdir -p ${LEGGED_ISOLATED_WS}/src
COPY legged_isolated.repos legged_isolated.repos
RUN vcs import $LEGGED_ISOLATED_WS/src < legged_isolated.repos --recursive
WORKDIR $LEGGED_ISOLATED_WS
RUN apt-get update -qq
USER $USER
RUN rosdep install --from-paths src --rosdistro=${ROS_DISTRO} -yi -r
USER root
RUN /bin/bash -c ". /opt/ros/${ROS_DISTRO}/setup.bash; \
catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/opt/ros/${ROS_DISTRO} \
-DPYTHON_EXECUTABLE=/usr/bin/python3"
RUN rm -r ${LEGGED_ISOLATED_WS}
CMD [ "/bin/bash", "-c" ]