Skip to content

Commit

Permalink
added docker support
Browse files Browse the repository at this point in the history
  • Loading branch information
hsd-dev committed May 23, 2020
1 parent 1c315c5 commit ace2189
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,28 @@ pip3 install roslibpy
https://pypi.python.org/pypi/service_identity
```

## Building docker image
```bash
sudo docker build -t rosgraph_monitor:0.1 .
sudo docker run -it rosgraph_monitor:0.1
//once inside the image
roscore
```
In a new terminal
```bash
sudo docker ps -l
// check for NAMES
sudo docker exec -it NAME bash
//once inside the image
source /graph_ws/devel/setup.bash
rosrun rosgraph_monitor monitor
```


## Running the system
```
roslaunch rosbridge_server rosbridge_websocket.launch
roslaunch rosgraph_monitor demo.launch
python3 src/rosgraph_monitor/nav_model.py
rosservice call /load_observer "name: 'NavObserver'"
```
```
16 changes: 16 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM osrf/ros:melodic-desktop-bionic

RUN apt-get update \
&& apt-get install -y git \
python-catkin-tools

RUN mkdir -p /graph_ws/src
WORKDIR /graph_ws/src
RUN git clone --depth=1 -b nav_observer https://github.com/ipa-hsd/rosgraph_monitor/
RUN git clone --depth=1 -b SoSymPaper https://github.com/ipa-nhg/ros_graph_parser

WORKDIR /graph_ws/
RUN rosdep install --from-paths src --ignore-src -r -y
RUN . /opt/ros/melodic/local_setup.sh \
&& catkin build \
&& . devel/local_setup.sh
6 changes: 6 additions & 0 deletions docker/ros_entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -e

# setup ros environment
source "graph_ws/devel/setup.bash"
exec "$@"

0 comments on commit ace2189

Please sign in to comment.