-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile_foxy
79 lines (66 loc) · 2.53 KB
/
Dockerfile_foxy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
FROM px4io/px4-dev-ros-noetic:2021-09-08
# setup environment
ENV ROS_DISTRO foxy
# setup ros2 keys
RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
# setup sources.list
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null
RUN apt-get update -y
RUN apt install tmux nano htop -y
# install bootstrap tools
RUN apt-get update \
&& apt-get install --quiet -y \
python3-colcon-common-extensions \
python3-colcon-mixin \
python3-rosdep \
python3-vcstool \
&& apt-get -y autoremove \
&& apt-get clean autoclean \
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*
# install ros2 desktop
RUN apt-get install --quiet --no-install-recommends -y \
ros-$ROS_DISTRO-desktop \
ros-$ROS_DISTRO-launch-testing-ament-cmake \
ros-$ROS_DISTRO-ros2bag \
ros-$ROS_DISTRO-rosidl-generator-dds-idl \
ros-$ROS_DISTRO-gazebo-ros-pkgs \
&& apt-get -y autoremove \
&& apt-get clean autoclean \
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*
# Install Python 3 packages needed for testing
RUN pip3 install -U \
argcomplete \
flake8 \
flake8-blind-except \
flake8-builtins \
flake8-class-newline \
flake8-comprehensions \
flake8-deprecated \
flake8-docstrings \
flake8-import-order \
flake8-quotes \
pytest-repeat \
pytest-rerunfailures
RUN pip3 install torch==2.0 pandas notebook
# bootstrap rosdep
RUN rosdep update
# setup colcon mixin and metadata
RUN colcon mixin add default \
https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml \
&& colcon mixin update \
&& colcon metadata add default \
https://raw.githubusercontent.com/colcon/colcon-metadata-repository/master/index.yaml \
&& colcon metadata update
WORKDIR /src
# Repository forked in order to avoid by default "missing RC" failsafe when in offboard mode
RUN git clone --branch rcl_except_4 https://github.com/carlo98/PX4-Autopilot.git
WORKDIR /src/PX4-Autopilot
RUN HEADLESS=1 make px4_sitl_default gazebo
RUN rm Tools/sitl_gazebo/models/iris/iris.sdf.jinja
RUN mv iris.sdf.jinja Tools/sitl_gazebo/models/iris/
RUN rm Tools/sitl_gazebo/worlds/iris_irlock.world
RUN mv iris_irlock.world Tools/sitl_gazebo/worlds/
RUN rm Tools/sitl_gazebo/models/iris_irlock/iris_irlock.sdf
RUN mv iris_irlock.sdf Tools/sitl_gazebo/models/iris_irlock/
RUN HEADLESS=1 make px4_sitl_rtps gazebo
WORKDIR /