Nantes Université

Skip to content
Extraits de code Groupes Projets

Comparer les révisions

Les modifications sont affichées comme si la révision source était fusionnée avec la révision cible. En savoir plus sur la comparaison des révisions.

Source

Sélectionner le projet cible
No results found
Sélectionner une révision Git

Cible

Sélectionner le projet cible
  • ls2n-drones/ls2n_drone_env
1 résultat
Sélectionner une révision Git
Afficher les modifications
Validations sur la source (5)
...@@ -46,3 +46,6 @@ ...@@ -46,3 +46,6 @@
[submodule "ls2n_drone_interfaces"] [submodule "ls2n_drone_interfaces"]
path = ls2n_drone_interfaces path = ls2n_drone_interfaces
url = git@gitlab.univ-nantes.fr:ls2n-drones/ls2n_drone_interfaces.git url = git@gitlab.univ-nantes.fr:ls2n-drones/ls2n_drone_interfaces.git
[submodule "ls2n_drone_bringup"]
path = ls2n_drone_bringup
url = git@gitlab.univ-nantes.fr:ls2n-drones/ls2n_drone_bringup.git
# syntax=docker/dockerfile:1
# Author: Lionel GENEVE
# Description: dockerfile for creating the simulation environment of the LS2N drones
# with ROS2 humble, Gazebo Forteress and the PX4 stack
FROM osrf/ros:humble-desktop-full
# Build arguments
ARG USER_NAME=user
ARG USER_UID=1000
ARG USER_GID=$USER_UID
ARG ROS_DOMAIN_ID=11
# Environment variables
ENV ROS_WS=/home/$USER_NAME/workspace/ros2_ws
ENV ROS_DISTRO=humble
ENV TZ=Europe/Paris
# Update system packages
RUN apt update -y --fix-missing && apt upgrade -y
# Install commom packages
RUN apt install -y apt-utils locales curl wget git tree cmake gnupg gnupg2 \
lsb-release software-properties-common x11-apps mesa-utils libgl1-mesa-glx
RUN apt install -y nano less xterm clang-format ccache lcov lld gdb \
bash-completion valgrind kcachegrind heaptrack hotspot
RUN apt install -y gnome-terminal
RUN apt install -y python3-pip python3-colcon-common-extensions python3-vcstool \
python3-rosdep
RUN pip3 install -U argcomplete rosbags
RUN pip3 install kconfiglib configlib jinja2 jsonschema pyros-genmsg
# Install additional ROS packages
RUN apt update && apt install -y ros-dev-tools \
ros-$ROS_DISTRO-rqt* \
ros-$ROS_DISTRO-rviz2 \
ros-$ROS_DISTRO-gazebo-ros-pkgs \
ros-$ROS_DISTRO-gazebo-ros \
ros-$ROS_DISTRO-gazebo-ros-pkgs \
ros-$ROS_DISTRO-joint-state-publisher \
ros-$ROS_DISTRO-robot-state-publisher
# Install Gazebo Fortress
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" | tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null
RUN apt update && apt install -y ignition-fortress && apt clean
#RUN apt -y install wget lsb-release gnupg
#RUN 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 http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
# Create ROS2 workspace
RUN mkdir -p $ROS_WS/src
# Clone ls2_drone_env repository
RUN cd $ROS_WS/src && git clone --depth 1 -b test_uxcre --recurse-submodules https://gitlab.univ-nantes.fr/ls2n-drones/ls2n_drone_env.git
# Init and update rosdep
#RUN rosdep init
RUN rosdep update
RUN . /opt/ros/$ROS_DISTRO/setup.sh \
&& cd $ROS_WS \
&& rosdep install --from-paths src --ignore-src -y -r
# Build ROS2 workspace
RUN . /opt/ros/$ROS_DISTRO/setup.sh \
&& cd $ROS_WS \
&& colcon build
# make bash default to run the setup.bash
SHELL ["/bin/bash", "-c"]
# Source ROS2
RUN source /opt/ros/$ROS_DISTRO/setup.bash
#RUN ros2 launch ls2n_drone_sitl sitl_drone_bridge.launch.py display_terminal:=false
COPY ./ros2_entrypoint.sh /home/$USER_NAME
RUN chmod +x /home/$USER_NAME/ros2_entrypoint.sh
ENTRYPOINT ["/home/$USER_NAME/ros2_entrypoint.sh"]
#CMD ["sleep", "infinity"]
ENV ROS_DOMAIN_ID=$ROS_DOMAIN_ID
#RUN export ROS_DOMAIN_ID=$ROS_DOMAIN_ID
EXPOSE 8888
\ No newline at end of file
#!/bin/bash
set -e
# Source the ROS2 environment setup
source /opt/ros/$ROS_DISTRO/setup.bash
# Source the Gazebo environment setup to avoid assertion error in gz-client
#source /usr/share/gazebo/setup.bash
# activate the colcon autocomplete
source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash
# It's worth noting that exec "$@" is often used in combination with the -e option,
# which sets the exit code of the script to the exit code of the last command executed.
# This allows you to propagate errors from the command line to the script and handle them appropriately.
exec "$@"
\ No newline at end of file
docker run -it --entrypoint /bin/bash ls2n_drone_sim
Subproject commit 1e4a959f3f53d0e562cfd893e72ea842b8258a01 Subproject commit cf8398959c6ab321e776640cf1f81006bc399ec0
Subproject commit ffb8aa4520475f83aa4a08af9e971568e612e68a
Subproject commit c1bb877ef78b3afa0af798042affc8ce8871bb53 Subproject commit a3ae1ca07a7fcfcf37052f4ec328a6e2c8c3eef6
Subproject commit 7e2778c58f04928c8c8afaf486318a2fade2a73a Subproject commit 04f08c0e29ba24112606811ca2565a01907b1a1e
Subproject commit 36bb30ac88293a584dfdeddc9d5976ba533e9d07 Subproject commit 7135a67c8961325bc8c17bb43c50b5c12d4cfa69
Subproject commit b0d837f684b82545bc78968b6af8319fcfa4eb50 Subproject commit 76a3f407213c55b1a7e2b3f6d1fcb63beb14a954
Subproject commit c2bb3a8cd82725048d8292c34fa7db3ec2ddde63 Subproject commit 8f9c8a0bcdf53dbf57aa9a0bce804cf763b43447
Subproject commit 0f24f4bdf213788682adca5d0013c37d5f06a349 Subproject commit d24b3114a909728c8cc89c9577e89e5096e0b139