-
Notifications
You must be signed in to change notification settings - Fork 0
/
SimulatorDockerfile
executable file
·106 lines (90 loc) · 3.42 KB
/
SimulatorDockerfile
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# syntax=docker/dockerfile:1
FROM ros:noetic-robot
# Create the image file structure
RUN mkdir /home/catkin_ws \
&& mkdir /home/catkin_ws/src \
&& mkdir /home/rosbags
# Setup the environments
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
ENV ROS_DISTRO=noetic
ENV HOME=/home/
ENV ROS_WS=/home/catkin_ws/
WORKDIR ${ROS_WS}
# Install utilities/dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
iputils-ping \
net-tools \
netbase \
python3 \
python3-pip \
git \
nano \
vim \
htop \
python3-lxml \
python3-catkin-tools \
python3-rosinstall-generator \
geographiclib-tools \
libgeographic-dev \
&& geographiclib-get-geoids egm96-5 \
&& geographiclib-get-gravity egm96 \
&& geographiclib-get-magnetic emm2015 \
&& rm -rf /var/lib/apt/lists/*
# Install Python packages
RUN pip3 install \
pyserial \
pymavlink
# Install ROS packages
RUN apt-get update && apt-get install -y --no-install-recommends \
ros-noetic-control-toolbox
# Build the ROS workspace
RUN . /opt/ros/${ROS_DISTRO}/setup.sh \
&& cd ${ROS_WS} \
&& rosdep update \
&& catkin init \
&& wstool init src
COPY Utilities/xbee-python-master /home/xbee-python-master
RUN pip3 install /home/xbee-python-master
# Install MAVROS
# Note that we perform this step as an independent layer to prevent
# requiring internet to rebuild swarm nodes
COPY swarm-nodes/mavros /home/catkin_ws/src/mavros
# Install MAVLink and configure workspace
RUN rosinstall_generator --rosdistro kinetic mavlink | tee /tmp/mavros.rosinstall \
&& wstool merge -t src /tmp/mavros.rosinstall \
&& wstool update -t src -j4 \
&& rosdep install --from-paths src --ignore-src -y
# We perform a build here to avoid triggering the ungodly long
# mavros builds when code changes are made in the field
RUN . /opt/ros/${ROS_DISTRO}/setup.sh \
&& catkin build
# Copy the swarm ROS nodes into the image
COPY swarm-nodes/custom_libs /home/catkin_ws/src/custom_libs
# COPY swarm-nodes/estimator /home/catkin_ws/src/estimator
# COPY swarm-nodes/hrl_lqi /home/catkin_ws/src/hrl_lqi
COPY swarm-nodes/swarm_msgs /home/catkin_ws/src/swarm_msgs
# dCOPY swarm-nodes/swarm_comms /home/catkin_ws/src/swarm_comms
# COPY swarm-nodes/clustering_control /home/catkin_ws/src/clustering_control
# COPY swarm-nodes/observer /home/catkin_ws/src/observer
# COPY swarm-nodes/hrl_planner /home/catkin_ws/src/hrl_planner
# COPY swarm-nodes/pre-planned_arl /home/catkin_ws/src/pre-planned_arl
# COPY swarm-nodes/live_gcs /home/catkin_ws/src/live_gcs
COPY swarm-nodes/command_xform /home/catkin_ws/src/command_xform
COPY swarm-nodes/state_provider /home/catkin_ws/src/state_provider
COPY swarm-nodes/lqr_control /home/catkin_ws/src/lqr_control
COPY swarm-nodes/hrl_command_interpret /home/catkin_ws/src/hrl_command_interpret
COPY swarm-nodes/hrl_control /home/catkin_ws/src/hrl_control
COPY swarm-nodes/bag_handler /home/catkin_ws/src/bag_handler
# Build the catkin workspace
RUN . /opt/ros/${ROS_DISTRO}/setup.sh \
&& catkin build
RUN chmod +x /home/catkin_ws/src/bag_handler/scripts/bag_handler.py
# Rosbag management
#COPY docker/drone/bag_manager.sh /home/
#RUN ["chmod","+x","/home/bag_manager.sh"]
# Overlay the ROS environment on top of the existing environment
COPY docker/drone/ros_entrypoint.sh /
RUN ["chmod", "+x", "/ros_entrypoint.sh"]
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["bash"]