diff --git a/docker_stuff/docker_mng_vars.sh b/docker_stuff/docker_mng_vars.sh index a83ce57..ae2c361 100644 --- a/docker_stuff/docker_mng_vars.sh +++ b/docker_stuff/docker_mng_vars.sh @@ -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" diff --git a/docker_stuff/docker_sim2/Dockerfile b/docker_stuff/docker_sim2/Dockerfile index 07fcde0..b4495ef 100644 --- a/docker_stuff/docker_sim2/Dockerfile +++ b/docker_stuff/docker_sim2/Dockerfile @@ -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 @@ -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} diff --git a/docker_stuff/docker_sim2/manage-docker.sh b/docker_stuff/docker_sim2/manage-docker.sh index f265ff6..d5a9992 100755 --- a/docker_stuff/docker_sim2/manage-docker.sh +++ b/docker_stuff/docker_sim2/manage-docker.sh @@ -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" @@ -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" @@ -144,6 +155,7 @@ 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 @@ -151,6 +163,7 @@ 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 @@ -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