Skip to content

Commit

Permalink
New gazebo and gz-sim-yarp-plugins
Browse files Browse the repository at this point in the history
Signed-off-by: Ettore Landini <[email protected]>
  • Loading branch information
elandini84 committed Dec 18, 2024
1 parent ea604f3 commit 259ff4c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 13 deletions.
1 change: 1 addition & 0 deletions docker_stuff/docker_mng_vars.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
UBUNTU_DEF="ubuntu:24.04"
CUDA_DEF="nvidia/cuda:11.7.1-cudnn8-devel-ubuntu22.04"
ROS_DEF="jazzy"
GAZEBO_DEF="harmonic"
YARP_DEF="master"
CUDA_SUFFIX="cuda.11.7.1-cudnn8"
UBUNTU_SUFFIX="ubuntu22.04"
Expand Down
24 changes: 12 additions & 12 deletions docker_stuff/docker_sim2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ARG yarp_branch="master"
ARG ros2_dev_remote="robotology"
ARG ros2_dev_branch=${yarp_branch}
ARG gazebo_pkg=ros-${ros_distro}-ros-gz
ARG gazebo_version=harmonic

# Non-interactive installation mode
ENV DEBIAN_FRONTEND=noninteractive
Expand Down Expand Up @@ -155,22 +156,21 @@ RUN cd navigation && mkdir build && cd build && /bin/bash -c "source /opt/ros/${
ENV navigation_ROOT=${robotology_install_folder}/navigation
ENV navigation_DIR=${robotology_install_folder}/navigation/build


# Gazebo
RUN sudo 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 https://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
RUN sudo apt-get update && sudo apt-get install -y gazebo-common gazebo libgazebo-dev mesa-utils && sudo rm -rf /var/lib/apt/lists/*
RUN sudo curl https://packages.osrfoundation.org/gazebo.gpg --output /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null
RUN sudo apt-get update
RUN sudo apt-get install gz-${gazebo_version}

# Gazebo Plugins
# Gz-sim Plugins
USER ${robotology_install_user}
WORKDIR ${robotology_install_folder}
RUN git clone https://github.com/robotology/gazebo-yarp-plugins -b master
RUN cd gazebo-yarp-plugins && mkdir build && cd build && \
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DGAZEBO_YARP_PLUGINS_DISABLE_IMPLICIT_NETWORK_WRAPPERS=ON && \
make -j4
ENV GazeboYARPPlugins_ROOT=${robotology_install_folder}/gazebo-yarp-plugins
ENV GazeboYARPPlugins_DIR=${robotology_install_folder}/gazebo-yarp-plugins/build
RUN git clone https://github.dev/robotology/gz-sim-yarp-plugins
RUN cd gz-sim-yarp-plugins && mkdir build && cd build && \
cmake -DCMAKE_INSTALL_PREFIX=${robotology_install_folder}/gz-sim-yarp-plugins/install \
-DCMAKE_PREFIX_PATH=${robotology_install_folder}/gz-sim-yarp-plugins/install && \
make -j11 && make install

# CER
USER ${robotology_install_user}
Expand Down
15 changes: 14 additions & 1 deletion docker_stuff/docker_sim2/manage-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ usage()
echo " -d, --devel Build/run the image with the '$DEVEL_SUFFIX' tag"
echo " -e, --repo + \"repo_name\" Build/run the image with the passed repository reference"
echo " -r, --ros_distro + \"distro_name\" Build/run the image with the passed distro (the passed value will be also used to compose the image tag)"
echo " -g, --gz_version + \"gz_version\" Build/run the image with the passed gazebo version (the passed value will be also used to compose the image tag)"
echo " -y, --yarp_branch + \"yarp branch\" Build/run the image with the passed yarp branch (the passed value, if different from \"master\", will be also used to compose the image tag)."
echo " If not passed, the branch used will be \"master\""
echo " -h, --help See current help"
Expand Down Expand Up @@ -88,6 +89,16 @@ get_opts()
ROS_SET=true
shift
;;
-g|--gz_version)
if [[ $GZ_SET == "true" ]]; then
echo "Gazebo version already set"
usage
fi
shift
GZ_VERS=$1
GZ_SET=true
shift
;;
-y|--yarp_vers)
if [[ $YARP_SET == "true" ]]; then
echo "YARP branch already set already set"
Expand Down Expand Up @@ -144,13 +155,15 @@ BASE_TAG_DEF="tourSim2"
BUILD_SUFFIX=$DEVEL_SUFFIX
VERSION="1.0.0"
ROS_DISTRO=$ROS_DEF
GZ_VERS=$GAZEBO_DEF
YARP_BRANCH=$YARP_DEF
PARENT_SUFFIX=$UBUNTU_SUFFIX
IMAGE_SET=false
BUILD_SET=false
GONNA_BUILD=false
RUN_WITH_GPU=true
ROS_SET=false
GZ_SET=false
YARP_SET=false
IMAGE=$UBUNTU_DEF
REPO=$REPO_DEF
Expand All @@ -166,7 +179,7 @@ get_opts $@
if [[ $YARP_BRANCH != "master" ]]; then
YARP_TAG=$YARP_BRANCH$JUNCTION
fi
COMPLETE_IMAGE_NAME=$REPO$REPO_SEP$BASE_TAG$JUNCTION$PARENT_SUFFIX$JUNCTION$ROS_DISTRO$JUNCTION$YARP_TAG$BUILD_SUFFIX
COMPLETE_IMAGE_NAME=$REPO$REPO_SEP$BASE_TAG$JUNCTION$PARENT_SUFFIX$JUNCTION$ROS_DISTRO$JUNCTION$GZ_VERS$JUNCTION$YARP_TAG$BUILD_SUFFIX

echo $COMPLETE_IMAGE_NAME

Expand Down

0 comments on commit 259ff4c

Please sign in to comment.