-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔨 Updated foxy_devel with nitpicked commits from humble_devel branch.
Signed-off-by: Bey Hao Yun <[email protected]>
- Loading branch information
1 parent
590c42d
commit 5f1cc88
Showing
3 changed files
with
31 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
FROM ros:foxy-ros-base-focal | ||
|
||
MAINTAINER Bey Hao Yun <[email protected]> | ||
|
||
# Add user | ||
RUN adduser --quiet --disabled-password user | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install OpenCV | ||
RUN apt-get update && \ | ||
apt-get install -y libopencv-dev && \ | ||
apt-get install -y ros-foxy-cv-bridge && \ | ||
apt-get install -y xauth xxd x11-xserver-utils && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /home/user/ | ||
WORKDIR /home/user/virtual_camera_ws | ||
RUN mkdir src | ||
COPY . src/virtual_camera | ||
|
||
# colcon compilation | ||
RUN . /opt/ros/$ROS_DISTRO/setup.sh \ | ||
&& colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release | ||
|
||
RUN sed -i '$isource "/home/user/virtual_camera_ws/install/setup.bash"' /ros_entrypoint.sh | ||
|
||
# Get ROS2 package image_tools available for sourcing. | ||
RUN chown -R user:user /home/user/ | ||
USER user | ||
RUN git clone https://github.com/ros2/demos.git \ | ||
--branch foxy \ | ||
--single-branch \ | ||
--depth 1 | ||
|
||
WORKDIR /home/user | ||
ENTRYPOINT ["/ros_entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
docker build --tag vcam_image:foxy . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
xhost +local:docker | ||
|
||
docker run -it --rm \ | ||
--net host \ | ||
--name vcam_test_container \ | ||
-e DISPLAY=$DISPLAY \ | ||
-v /dev/shm:/dev/shm \ | ||
-v /tmp/.X11-unix:/tmp/.X11-unix \ | ||
-u user \ | ||
vcam_image:foxy bash -c \ | ||
"ros2 run virtual_camera virtual_camera" | ||
|
||
xhost -local:docker |