From 55fc5d5032a4914d30a4f3355d154633d1e938a0 Mon Sep 17 00:00:00 2001 From: avcuenes Date: Wed, 17 Jan 2024 01:12:22 +0300 Subject: [PATCH] add docker and makefile --- Dockerfile | 46 ++++++++++++++++++++++++++++++++++++++++++++++ Makefile | 11 +++++++++++ 2 files changed, 57 insertions(+) create mode 100644 Dockerfile create mode 100644 Makefile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..86b2e03 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,46 @@ +# Use the official ROS Melodic base image +FROM osrf/ros:noetic-desktop-full + +# Set the working directory +WORKDIR /workspace + +# Install additional dependencies if needed +# For example, you can uncomment the line below to install a package +# Install additional dependencies +RUN apt-get update \ + && apt-get -y --quiet --no-install-recommends install \ + gcc \ + git \ + libxml2-dev \ + libxslt-dev \ + python3 \ + python3-pip\ + python3-scipy \ + ros-noetic-tf\ + ros-noetic-interactive-markers\ + ros-noetic-image-geometry\ + ros-noetic-xacro + +RUN pip3 install setuptools +RUN pip3 install pykalman catkin-tools +# Copy your ROS packages into the workspace +COPY . /workspace/src/ + +WORKDIR /workspace + + +# Set environment variables +ENV ROS_DISTRO noetic +ENV ROS_VERSION 1 +# RUN catkin build +RUN . /opt/ros/noetic/setup.sh && catkin_make + + +# Source the ROS setup file +RUN echo "source /workspace/devel/setup.bash" >> ~/.bashrc + +# Expose ROS master port +EXPOSE 11311 + +# Set entry point to start ROS +CMD ["roscore"] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..272ce71 --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +# Build docker project +.PHONY : docker_build +docker_build: + docker build -t egoplannerswarm . + +# Run docker project +.PHONY : docker_run +docker_run: + docker run -it --network host --env="DISPLAY" --env="QT_X11_NO_MITSHM=1" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" --entrypoint /bin/bash egoplannerswarm + +