-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.dev
184 lines (149 loc) · 6.68 KB
/
Dockerfile.dev
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# Borrowed from https://github.com/sskorol/ros2-humble-docker-dev-template
ARG ROS_DISTRO=humble
FROM osrf/ros:${ROS_DISTRO}-desktop-full
# FROM ros:humble
# docker pull ros:humble-ros-core-jammy
# RUN apt update && \
# apt-get install -y software-properties-common curl && \
# add-apt-repository universe && \
# apt-get update && \
# curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros2-latest-archive-keyring.gpg && \
# echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros2-latest-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null
# # TODO: Cleanup. i.e. nano, install vim
# # TODO: Learn tmuxinator
# # Install git, supervisor, VNC, & X11 packages
RUN apt-get update && \
apt-get install -y \
cmake \
curl \
gazebo \
libglu1-mesa-dev \
vim \
python3-pip \
python3-pydantic \
ros-${ROS_DISTRO}-gazebo-ros \
ros-${ROS_DISTRO}-gazebo-ros-pkgs \
ros-${ROS_DISTRO}-joint-state-publisher \
ros-${ROS_DISTRO}-robot-localization \
ros-${ROS_DISTRO}-plotjuggler-ros \
ros-${ROS_DISTRO}-robot-state-publisher \
ros-${ROS_DISTRO}-ros2bag \
ros-${ROS_DISTRO}-rosbag2-storage-default-plugins \
ros-${ROS_DISTRO}-rqt-tf-tree \
ros-${ROS_DISTRO}-rmw-fastrtps-cpp \
ros-${ROS_DISTRO}-rmw-cyclonedds-cpp \
ros-${ROS_DISTRO}-slam-toolbox \
ros-${ROS_DISTRO}-turtlebot3 \
ros-${ROS_DISTRO}-turtlebot3-msgs \
ros-${ROS_DISTRO}-twist-mux \
ros-${ROS_DISTRO}-usb-cam \
ros-${ROS_DISTRO}-xacro \
ros-${ROS_DISTRO}-navigation2 \
ros-${ROS_DISTRO}-nav2-bringup \
ros-${ROS_DISTRO}-foxglove-bridge \
ros-${ROS_DISTRO}-turtlebot3-gazebo \
ros-${ROS_DISTRO}-depthai-ros-driver \
ros-${ROS_DISTRO}-hls-lfcd-lds-driver \
ros-${ROS_DISTRO}-rqt* \
ros-${ROS_DISTRO}-joint-state-publisher-gui \
ros-${ROS_DISTRO}-imu-pipeline \
ros-dev-tools \
joystick jstest-gtk evtest \
x11-apps \
xtl-dev \
ruby-dev \
rviz \
tmux \
wget \
xorg-dev \
build-essential \
gcc-arm-none-eabi \
libnewlib-arm-none-eabi \
zsh && \
rm -rf /var/lib/apt/lists/
RUN pip3 install setuptools==58.2.0
RUN wget https://github.com/openrr/urdf-viz/releases/download/v0.44.0/urdf-viz-x86_64-unknown-linux-gnu.tar.gz && \
tar -xvzf urdf-viz-x86_64-unknown-linux-gnu.tar.gz -C /usr/local/bin/ && \
chmod +x /usr/local/bin/urdf-viz && \
rm -f urdf-viz-x86_64-unknown-linux-gnu.tar.gz
RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v1.1.2/zsh-in-docker.sh)" -- \
-p git \
-p https://github.com/zsh-users/zsh-autosuggestions \
-p https://github.com/zsh-users/zsh-completions
RUN gem install tmuxinator && \
wget https://raw.githubusercontent.com/tmuxinator/tmuxinator/master/completion/tmuxinator.zsh -O /usr/local/share/zsh/site-functions/_tmuxinator
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
ENV ROS_ROOT=/opt/ros/${ROS_DISTRO} \
ROS2_WS=/ros_ws \
ROS_PACKAGE=deepdrive \
RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
# micro ros
RUN git clone --recurse-submodules https://github.com/raspberrypi/pico-sdk.git /usr/src/pico-sdk
ENV PICO_SDK_PATH=/usr/src/pico-sdk
ENV UROS_WS=/uros_ws
WORKDIR $UROS_WS
RUN git clone -b $ROS_DISTRO https://github.com/micro-ROS/micro_ros_setup.git src/micro_ros_setup
RUN bash -c "source /opt/ros/${ROS_DISTRO}/setup.sh && \
apt-get update && \
rosdep update && \
rm -rf /opt/ros/humble/build/pluginlib/pluginlib_enable_plugin_testing && \
rosdep install --from-paths src --ignore-src -y "
RUN bash -c "source /opt/ros/${ROS_DISTRO}/setup.sh && \
colcon build --symlink-install && \
source $UROS_WS/install/setup.sh && \
ros2 run micro_ros_setup create_agent_ws.sh && \
ros2 run micro_ros_setup build_agent.sh"
RUN echo "source /root/.ros2" >> /root/.bashrc
RUN echo "source /root/.ros2" >> /root/.zshrc
RUN echo "export DISABLE_AUTO_TITLE=true" >> /root/.ros2
RUN echo 'LC_NUMERIC="en_US.UTF-8"' >> /root/.ros2
RUN echo "source $ROS_ROOT/setup.sh" >> /root/.ros2
RUN echo "source $UROS_WS/install/setup.sh" >> /root/.ros2
RUN echo "source $ROS2_WS/install/setup.sh" >> /root/.ros2
RUN echo "source /usr/share/gazebo/setup.sh" >> /root/.ros2
RUN echo 'alias rosdi="rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y"' >> /root/.ros2
RUN echo 'alias cbuild="colcon build --symlink-install"' >> /root/.ros2
RUN echo 'alias ssetup="source $ROS2_WS/install/setup.sh"' >> /root/.ros2
RUN echo 'alias cyclone="export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp"' >> /root/.ros2
RUN echo 'alias fastdds="export RMW_IMPLEMENTATION=rmw_fastrtps_cpp"' >> /root/.ros2
RUN echo 'export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp' >> /root/.ros2
# RUN echo "autoload -U bashcompinit" >> /root/.ros2
# RUN echo "bashcompinit" >> /root/.ros2
RUN echo 'eval "$(register-python-argcomplete3 ros2)"' >> /root/.ros2
RUN echo 'eval "$(register-python-argcomplete3 colcon)"' >> /root/.ros2
COPY .session.yml /root/.session.yml
COPY .tmux.conf /root/.tmux.conf
CMD [ "tmuxinator", "start", "-p", "/root/.session.yml" ]
# ----------------------------------------------------------------------------
# Install JetsonGPIO
WORKDIR /usr/src
RUN git clone https://github.com/pjueon/JetsonGPIO.git && \
cd JetsonGPIO && \
mkdir build && \
cd build && \
cmake .. -DJETSON_GPIO_POST_INSTALL=OFF && \
cmake --build . --target install
# Add ROS2 code
WORKDIR $ROS2_WS
# COPY src/deepdrive_hardware/requirements.txt src/deepdrive_hardware/requirements.txt
# RUN pip3 install -r src/deepdrive_hardware/requirements.txt
# COPY src/deepdrive_vision/requirements.txt src/deepdrive_vision/requirements.txt
# RUN pip3 install -r src/deepdrive_vision/requirements.txt
COPY src/imu_bno08x/requirements.txt src/imu_bno08x/requirements.txt
RUN pip3 install -r src/imu_bno08x/requirements.txt
VOLUME /tmp
ENV GAZEBO_MODEL_PATH=$ROS2_WS/src/:$GAZEBO_MODEL_PATH
ENV DEEPDRIVE_MODEL=deepdrive
RUN ln -s /usr/bin/python3 /usr/bin/python
# CMD [ "bash" ]
# COPY src ./src/
# RUN bash -c "source $ROS_ROOT/setup.bash && colcon build --symlink-install"
# RUN bash -c "source $ROS2_WS/install/setup.bash && colcon build --symlink-install"
# RUN bash /opt/ros/humble/setup_ws.sh libgazebo_ros_diff_drive
# libgazebo_ros_imu_sensor.so
# libgazebo_ros_ray_sensor.so
# libgazebo_ros_diff_drive.so
# libgazebo_ros_camera.so
# gazebo_plugins