Skip to content

Commit

Permalink
Update gazebo to ubuntujammy and comment probably unneeded parts
Browse files Browse the repository at this point in the history
  • Loading branch information
MSECode committed Jan 3, 2024
1 parent a134008 commit f3638e3
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 56 deletions.
105 changes: 51 additions & 54 deletions dockerfile_images/basic/superbuild-gazebo/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,22 @@ ENV DEBIAN_FRONTEND=noninteractive

# Some definitions
ARG CMAKE_GENERATOR="Unix Makefiles"
ARG SOURCES_BUILD_TYPE=RelWithDebInfo
# ARG SOURCES_BUILD_TYPE=RelWithDebInfo
ARG CMAKE_EXTRA_OPTIONS=-j4
ARG BUILD_TYPE=Release
# Variables defined before the first FROM can be accessed in all stages but they need to be re-declared

# Variables defined before the first FROM can be accessed in all stages but they need to be re-declared
ARG GAZEBO_VER
ARG release
ARG sbtag
ARG PROJECTS_DIR
ARG INSTALL_DIR


# Create a new runtimeusers group
# Create a new runtimeusers group (why we are doing this)
RUN groupadd -K GID_MIN=100 -K GID_MAX=499 runtimeusers

# Install dependencies given in documentation in superbuild
# Install dependencies given in documentation in superbuild
RUN mkdir -p /etc/bash_completion.d/ && \
# apt-get update and apt-get install should always be in the same layer to prevent caching errors
apt-get update && \
Expand All @@ -47,24 +48,21 @@ RUN mkdir -p /etc/bash_completion.d/ && \
lsb-release \
vim

# Get gazebo from the osrf repo
RUN echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" \
> /etc/apt/sources.list.d/gazebo-stable.list &&\
wget http://packages.osrfoundation.org/gazebo.key -O - | apt-key add - &&\
apt-get update &&\
apt install -y gazebo${GAZEBO_VER} libgazebo${GAZEBO_VER}-dev
# Get gazebo from apt
RUN apt-get update &&\
apt install -y gazebo libgazebo-dev libgazebo${GAZEBO_VER}

RUN mkdir ${PROJECTS_DIR} && cd ${PROJECTS_DIR} &&\
# Clone relevant repos
git clone https://github.com/robotology/robotology-superbuild.git &&\
git clone https://github.com/robotology/cer.git &&\
git clone https://github.com/robotology/cer-sim.git &&\
git clone https://github.com/robotology/navigation.git &&\
# git clone https://github.com/robotology/cer.git &&\
# git clone https://github.com/robotology/cer-sim.git &&\
# git clone https://github.com/robotology/navigation.git &&\
git clone https://github.com/icub-tech-iit/appsAway.git &&\
git clone https://github.com/robotology/icub-models.git --depth 1 --branch devel &&\
# git clone https://github.com/robotology/icub-models.git --depth 1 --branch devel &&\
chmod -R g+rw ${PROJECTS_DIR}

# Build robotology-superbuild
# Build robotology-superbuild
RUN cd ${PROJECTS_DIR}/robotology-superbuild &&\
git checkout ${release} &&\
# Add no-install-recommends to robotology libraries
Expand All @@ -88,7 +86,7 @@ RUN cd ${PROJECTS_DIR}/robotology-superbuild &&\
# Remove build directory
rm -rf /projects/robotology-superbuild/build/src

# Build checkRobotInterface
# Build checkRobotInterface
RUN cd ${PROJECTS_DIR}/appsAway/modules/checkRobotInterface && \
mkdir build && cd build && \
cmake .. \
Expand All @@ -100,44 +98,44 @@ RUN cd ${PROJECTS_DIR}/appsAway/modules/checkRobotInterface && \
# Remove build directory
rm -rf ${PROJECTS_DIR}/appsAway/modules/checkRobotInterface/build

# Build icub-models
RUN cd ${PROJECTS_DIR}/icub-models && mkdir build && cd build && \
cmake .. \
-DCMAKE_BUILD_TYPE=${SOURCES_BUILD_TYPE} && \
make install && \
# Remove build directory
rm -rf ${PROJECTS_DIR}/icub-models/build

# Build CER
RUN cd ${PROJECTS_DIR}/cer && \
git checkout devel &&\
mkdir build && cd build &&\
cmake .. \
-G "$CMAKE_GENERATOR" \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-D ENABLE_cermod_cerDoubleLidar=ON \
-DENABLE_faceExpressionImage=ON \
-DGAZEBO_TRIPOD_PLUGIN=ON && \
cmake --build . -- ${CMAKE_EXTRA_OPTIONS}
# Remove build directory
# rm -rf ${PROJECTS_DIR}/cer/build
# # Build icub-models
# RUN cd ${PROJECTS_DIR}/icub-models && mkdir build && cd build && \
# cmake .. \
# -DCMAKE_BUILD_TYPE=${SOURCES_BUILD_TYPE} && \
# make install && \
# # Remove build directory
# rm -rf ${PROJECTS_DIR}/icub-models/build

# # Build CER
# RUN cd ${PROJECTS_DIR}/cer && \
# git checkout devel &&\
# mkdir build && cd build &&\
# cmake .. \
# -G "$CMAKE_GENERATOR" \
# -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
# -D ENABLE_cermod_cerDoubleLidar=ON \
# -DENABLE_faceExpressionImage=ON \
# -DGAZEBO_TRIPOD_PLUGIN=ON && \
# cmake --build . -- ${CMAKE_EXTRA_OPTIONS}
# # Remove build directory
# # rm -rf ${PROJECTS_DIR}/cer/build

# Build Navigation
RUN cd ${PROJECTS_DIR}/navigation && \
mkdir build && cd build &&\
cmake .. \
-G "$CMAKE_GENERATOR" \
&&\
cmake --build . -- ${CMAKE_EXTRA_OPTIONS} &&\
make install && \
rm -rf ${PROJECTS_DIR}/navigation/build

# Using Multi-Stage Builds
# We use a middle stage because several COPY commands with hardlinks and softlinks generate duplication
# # Build Navigation
# RUN cd ${PROJECTS_DIR}/navigation && \
# mkdir build && cd build &&\
# cmake .. \
# -G "$CMAKE_GENERATOR" \
# &&\
# cmake --build . -- ${CMAKE_EXTRA_OPTIONS} &&\
# make install && \
# rm -rf ${PROJECTS_DIR}/navigation/build

# Using Multi-Stage Builds
# We use a middle stage because several COPY commands with hardlinks and softlinks generate duplication
FROM $START_IMG as middlestage


# Variables defined before the first FROM can be accessed in all stages but they need to be re-declared
# Variables defined before the first FROM can be accessed in all stages but they need to be re-declared
ARG PROJECTS_DIR
ARG ROBOTOLOGY_INITIALIZATION_FILE
ARG INSTALL_DIR
Expand All @@ -163,13 +161,12 @@ RUN echo "source ${INSTALL_DIR}/share/robotology-superbuild/setup.sh" >> $ROBOTO

FROM scratch

# Variables defined before the first FROM can be accessed in all stages but they need to be re-declared
# Variables defined before the first FROM can be accessed in all stages but they need to be re-declared
ARG PROJECTS_DIR
ARG INSTALL_DIR
ARG GAZEBO_VER
ARG ROBOTOLOGY_INITIALIZATION_FILE
ARG release
ARG sbtag
ARG ROBOTOLOGY_INITIALIZATION_FILE
ARG metadata

COPY --from=middlestage / /
Expand All @@ -181,7 +178,7 @@ ENV GAZEBO_MODEL_PATH=/usr/local/share/gazebo/models:/usr/local/share/iCub/robot
ENV GAZEBO_MODEL_DATABASE_URI=http://gazebosim.org/models
ENV GAZEBO_RESOURCE_PATH=/usr/local/share/gazebo/worlds
ENV GAZEBO_MASTER_URI=http://localhost:11345
ENV YARP_DATA_DIRS=${PROJECTS_DIR}/cer/build/share/CER:${PROJECTS_DIR}/cer/build/share/CER/robots/CER01:/usr/local/share/navigation
# ENV YARP_DATA_DIRS=${PROJECTS_DIR}/cer/build/share/CER:${PROJECTS_DIR}/cer/build/share/CER/robots/CER01:/usr/local/share/navigation
ENV QT_X11_NO_MITSHM=1
ENV YARP_COLORED_OUTPUT=1
ENV img_metadata=${metadata}
Expand Down
4 changes: 2 additions & 2 deletions dockerfile_images/basic/superbuild-gazebo/conf_build.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[sources]
START_IMG=ubuntu:focal
START_IMG=ubuntu:jammy
metadata={{steps.get_date.outputs.DATE_HOUR}}
release={{steps.get_version.outputs.VERSION}}
sbtag={{matrix.tag}}

[binaries]
SOURCE_IMG={{env.DEFAULT_USER}}/{{matrix.apps}}:{{steps.get_version.outputs.VERSION}}{{steps.get_version.outputs.TAG}}_sources
START_IMG=ubuntu:focal
START_IMG=ubuntu:jammy

[tag]
{{matrix.apps}}:{{steps.get_version.outputs.VERSION}}{{steps.get_version.outputs.TAG}}
Expand Down

0 comments on commit f3638e3

Please sign in to comment.