Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add docker and make file #33

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Use the official ROS Melodic base image
FROM osrf/ros:melodic-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 \
python \
python-pip\
libarmadillo-dev\
wget

# Download, extract, and build nlopt
RUN git clone -b v2.7.1 https://github.com/stevengj/nlopt.git && \
cd nlopt && \
mkdir build && \
cd build && \
cmake .. && \
make && \
make install && \
ldconfig


# Download, extract, and build LKH
RUN wget http://akira.ruc.dk/~keld/research/LKH-3/LKH-3.0.6.tgz && \
tar xvfz LKH-3.0.6.tgz && \
cd LKH-3.0.6 && \
make && \
cp LKH /usr/local/bin && \
cd .. && \
rm -rf LKH-3.0.6 LKH-3.0.6.tgz

COPY . /workspace/src/

WORKDIR /workspace

RUN . /opt/ros/melodic/setup.sh && catkin_make

# Set entry point to start ROS
CMD ["bash"]
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Build docker project
.PHONY : docker_build
docker_build:
docker build -t racer .

# Run docker project
.PHONY : docker_run
docker_run:
docker run -it --network host --env="DISPLAY" --env="QT_X11_NO_MITSHM=1" --device=/dev/video0:/dev/video0 --mount type=bind,source=$(CURDIR),target=/workspace/src --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" --entrypoint /bin/bash racer
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,45 @@ By default you can see a pillar-like environment. Trigger the quadrotor to start
<img src="files/racer3.gif" width = "600" height = "325"/>
</p>

## Docker Setup

If your operating system doesn't support ROS melodic, docker is a great alternative.

First of all, you have to build the project and create an image like so:

```bash
## Assuimg you are in the correct project directory
docker build -t racer .
```
To use a shortcut, you may use the following command:

```bash
## Assuimg you are in the correct project directory
make docker_build
```

After the image is created, copy and paste the following command to the terminal to run the image:

```bash
## Assuimg you are in the correct project directory
docker run -it --net=host --ipc=host --privileged --env="DISPLAY" --env="QT_X11_NO_MITSHM=1" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" --volume="${XAUTHORITY}:/root/.Xauthority" --entrypoint /bin/bash racer
```
To use a shortcut, you may use following command:

```bash
make docker_run
```
## Running the package at docker image

If you are in the docker image , this project is already sourced and the default launch file can be run as the following command;

```bash
source devel/setup.bash && roslaunch exploration_manager rviz.launch
```
then run the simulation (run in a new terminals):
```bash
source devel/setup.bash && roslaunch exploration_manager swarm_exploration.launch
```
## Exploring Different Environments

The exploration environments in our simulator are represented by [.pcd files](https://pointclouds.org/documentation/tutorials/pcd_file_format.html).
Expand Down