-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.simulation
36 lines (31 loc) · 1.29 KB
/
Dockerfile.simulation
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
ARG ROS_DISTRO=humble
ARG BUILD_TEST=OFF
FROM husarnet/ros:${ROS_DISTRO}-ros-core
ENV HUSARION_ROS_BUILD_TYPE=simulation
STOPSIGNAL SIGINT
WORKDIR /ros2_ws
RUN apt-get update && \
apt-get install -y \
ros-dev-tools && \
# Setup workspace
git clone -b ros2-devel https://github.com/husarion/panther_ros.git src/panther_ros && \
vcs import src < src/panther_ros/panther/panther_${HUSARION_ROS_BUILD_TYPE}.repos && \
cp -r src/ros2_controllers/diff_drive_controller src && \
cp -r src/ros2_controllers/imu_sensor_broadcaster src && \
rm -rf src/ros2_controllers && \
# Install dependencies
rosdep init && \
rosdep update --rosdistro $ROS_DISTRO && \
rosdep install --from-paths src -y -i && \
# Build
source /opt/ros/$ROS_DISTRO/setup.bash && \
colcon build --symlink-install --packages-up-to panther --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=$BUILD_TEST && \
# Get version
echo $(cat /ros2_ws/src/panther_ros/panther/package.xml | grep '<version>' | sed -r 's/.*<version>([0-9]+.[0-9]+.[0-9]+)<\/version>/\1/g') >> /version.txt && \
# Size optimalization
export SUDO_FORCE_REMOVE=yes && \
apt-get remove -y \
ros-dev-tools && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*