diff --git a/.github/workflows/build_container.yml b/.github/workflows/build_container.yml index 8d177d0..7e1cf49 100644 --- a/.github/workflows/build_container.yml +++ b/.github/workflows/build_container.yml @@ -4,6 +4,8 @@ on: push: branches: - main + - fortress + - harmonic jobs: build_and_push: @@ -25,6 +27,7 @@ jobs: - name: Build and push Docker image run: | - IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/gazebo:latest + BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | sed 's/[^a-zA-Z0-9._-]/-/g') + IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/gazebo:${BRANCH_NAME} docker build -t $IMAGE_NAME . docker push $IMAGE_NAME diff --git a/docker-compose.yml b/docker-compose.yml index 688822b..785a01d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,6 +10,6 @@ services: volumes: - /tmp/.X11-unix:/tmp/.X11-unix - /tmp/.Xauthority:/tmp/.Xauthority:rw - command: ign gazebo --headless-rendering + command: ros2 launch ros_gz_sim gz_sim.launch.py network_mode: "host" privileged: true \ No newline at end of file diff --git a/sample.env b/sample.env index 1e91428..5560af7 100644 --- a/sample.env +++ b/sample.env @@ -4,4 +4,4 @@ QT_X11_NO_MITSHM=1 XAUTHORITY=/tmp/.Xauthority # ROS2 domain to avoid conflicts with other containers -ROS_DOMAIN_ID=0 \ No newline at end of file +ROS_DOMAIN_ID=96 \ No newline at end of file diff --git a/test.Dockerfile b/test.Dockerfile new file mode 100644 index 0000000..f848b97 --- /dev/null +++ b/test.Dockerfile @@ -0,0 +1,65 @@ +# Start from ROS Humble base image +FROM ros:humble-ros-base + +# Set environment variables +ENV ROS_DISTRO=humble +ENV GZ_VERSION=fortress + +# Install necessary packages for Gazebo Garden and its dependencies +RUN apt-get update && apt-get install -y \ + ros-${ROS_DISTRO}-joint-state-publisher-gui \ + ros-${ROS_DISTRO}-xacro \ + ros-${ROS_DISTRO}-image-transport \ + ros-${ROS_DISTRO}-vision-msgs \ + ros-${ROS_DISTRO}-actuator-msgs \ + software-properties-common \ + wget \ + lsb-release \ + gnupg \ + curl + +# Add ROS2 apt repository +RUN sh -c 'echo "deb http://packages.ros.org/ros2/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros2-latest.list' +RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - +RUN apt update -y + +# Create workspace and source directories +RUN mkdir -p ~/workspace/src + +# Import the collection of repositories including Gazebo +RUN cd ~/workspace/src && wget https://raw.githubusercontent.com/ignition-tooling/gazebodistro/master/collection-fortress.yaml +RUN cd ~/workspace/src && vcs import < collection-fortress.yaml + +# Add OSRF packages keyring and repository +RUN wget https://packages.osrfoundation.org/gazebo.gpg -O /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 apt-get update + +# Install Gazebo dependencies +RUN cd ~/workspace/src && apt -y install \ + $(sort -u $(find . -iname 'packages-'`lsb_release -cs`'.apt' -o -iname 'packages.apt' | grep -v '/\.git/') | sed '/ignition\|sdf/d' | tr '\n' ' ') + +# Install Dart 6.13 (remove default version and install new one) +RUN apt remove libdart* -y +RUN add-apt-repository ppa:dartsim/ppa -y +RUN apt-get update -y +RUN apt-get install libdart6-all-dev -y + + +# Get ros_gz +RUN cd ~/workspace/src/ && git clone https://github.com/gazebosim/ros_gz.git +RUN cd ~/workspace/src/ros_gz/ && git checkout $ROS_DISTRO + +# Build the ROS gz packages +RUN /bin/bash -c '. /opt/ros/${ROS_DISTRO}/setup.bash; cd ~/workspace; colcon build --cmake-args -DBUILD_TESTING=OFF --symlink-install --merge-install' + + +# Create entrypoint +RUN echo '#!/bin/bash \n\ + source /opt/ros/${ROS_DISTRO}/setup.bash \n\ + source /root/workspace/install/setup.bash \n\ + exec "$@"' > /ros_entrypoint.sh + +# Set entrypoint and default command +ENTRYPOINT ["/ros_entrypoint.sh"] +CMD ["ign", "gazebo", "--headless-rendering"] \ No newline at end of file diff --git a/worlds/base_world.world b/worlds/base_world.world new file mode 100644 index 0000000..dd02fdc --- /dev/null +++ b/worlds/base_world.world @@ -0,0 +1,1021 @@ + + + + + + + 2 18 15 0 0.75 -1.7 + + + + + + true + 0 0 10 0 0 0 + 0.8 0.8 0.8 1 + 0.2 0.2 0.2 1 + + 1000 + 0.9 + 0.01 + 0.001 + + -0.5 0.1 -0.9 + + + + true + + + + + 0 0 1 + 100 100 + + + + + + + 0 0 1 + 100 100 + + + + 0.8 0.8 0.8 1 + 0.8 0.8 0.8 1 + 0.8 0.8 0.8 1 + + + + + + + 0 0 0 0 0 0 + + + + + 6 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 6 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + -12.4007 5.45 0 0 -0 1.5708 + + + + + + 1 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 1 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + -11.9757 8.375 0 0 -0 0 + + + + + + 4.25 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 4.25 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + -7.17535 9.4 0 0 -0 0.523599 + + + + + + 9.75 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 9.75 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + -0.6 10.425 0 0 -0 0 + + + + + + 6 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 6 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + 4.2 7.5 0 0 -0 -1.5708 + + + + + + 12 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 12 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + 4.2 -1.35 0 0 -0 -1.5708 + + + + + + 6.5 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 6.5 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + 7.375 -7.275 0 0 -0 0 + + + + + + 14 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 14 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + 10.55 -0.35 0 0 -0 1.5708 + + + + + + 17 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 17 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + 18.975 6.575 0 0 -0 0 + + + + + + 19 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 19 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + 27.4 -2.85 0 0 -0 -1.5708 + + + + + + 30.75 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 30.75 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + 12.1 -12.275 0 0 -0 3.14159 + + + + + + 15 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 15 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + -3.2 -4.85 0 0 -0 1.5708 + + + + + + 1.75 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 1.75 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + -10.985 7.80931 0 0 -0 -0.785398 + + + + + + 4.25 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 4.25 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + -5.25 2.575 0 0 -0 3.14159 + + + + + + 7.5 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 7.5 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + -7.3 -1.1 0 0 -0 -1.5708 + + + + + + 11.75 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 11.75 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + -13.1 -4.775 0 0 -0 3.14159 + + + + + + 4.5 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 4.5 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + -18.9 -6.95 0 0 -0 -1.5708 + + + + + + 9 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 9 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + -14.475 -9.125 0 0 -0 0 + + + + + + 3.75 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 3.75 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + -10.05 -10.925 0 0 -0 -1.5708 + + + + + + 17.5 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 17.5 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + -18.725 -12.725 0 0 -0 3.14159 + + + + + + 13.75 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 13.75 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + -27.4 -5.925 0 0 -0 1.5708 + + + + + + 7.75 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 7.75 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + -23.6 0.875 0 0 -0 0 + + + + + + 12 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 12 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + -19.8 6.8 0 0 -0 1.5708 + + + + + + 1.78502 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 1.78502 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + -9.68502 6.88431 0 0 -0 -0.455067 + + + + + + 5 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 5 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + -17.375 12.725 0 0 -0 0 + + + + + + 10.5 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 10.5 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + -14.95 7.55 0 0 -0 -1.5708 + + + + + + 2.75 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 2.75 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + -13.65 2.375 0 0 -0 0 + + + + + + 6.25 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 6.25 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + 19.3304 1.86165 0 0 -0 3.14159 + + + + + + 8.5 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 8.5 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + 16.2804 -2.31335 0 0 -0 -1.5708 + + + + + + 6.75 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 6.75 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + 19.5804 -6.48835 0 0 -0 0 + + + + + + 2 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 2 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + -8.9507 7.45 0 0 -0 1.5708 + + + + + + 8.5 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 8.5 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + 22.8804 -2.31335 0 0 -0 1.5708 + + + + + + 0.65 0.15 2.5 + + + 0 0 1.25 0 -0 0 + + + 0 0 1.25 0 -0 0 + + + 0.65 0.15 2.5 + + + + + 1 1 1 1 + + + 0 + + + 22.6304 1.86165 0 0 -0 3.14159 + + 1 + + + \ No newline at end of file