Skip to content

Commit

Permalink
Set up local environment
Browse files Browse the repository at this point in the history
  • Loading branch information
paucarre committed May 23, 2021
1 parent 1e5fcff commit 4b01072
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
29 changes: 28 additions & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Introduction
# Building image and running container

To build the docker image ( `tsdf-plusplus-ros-catkin-build` ) run:
```bash
Expand All @@ -12,6 +12,33 @@ To run the docker image use:

The workspace is located in `/home/ros/tsdf-plusplus_ws` and the `docker` user is `ros`.

# Getting environment up and running

If you want to get quicky up and runing, keeping sources on your computer
and using docker as a as a perdictable build system you can run:
```bash
./build-ros-image.sh
./set-me-up.sh
```

You can skip running `build-ros-image.sh` if the image is already built.

This `set-me-up.sh` script will do the following:
- Run a docker container
- Copy the built workspace to the destination folder of choice
- Stop the container

Note that if you want to change the remote to SSH or your fork you'll need to edit the origin in the cloned repos.
For instance, in the `tsdf-plusplus` project use something like:tsdf-plusplus.git
```bash
git remote set-url origin [email protected]:ethz-asl/tsdf-plusplus.git
```

You can confirm you have the right origin URL by running:
```bash
git remote show origin
```

TODO:
- Allow mounted local workspaced in docker
- Automatically build the current (remote) branch
Expand Down
8 changes: 7 additions & 1 deletion docker/run-ros-image.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/bin/bash
docker container run --rm -it \
mode=$1
if [ -z "$1" ]
then
mode="it"
fi
docker container run --rm -$mode \
--user 1001 \
--name tsdf-plusplus \
--workdir /home/ros/catkin_ws \
tsdf-plusplus-ros-catkin-build:v0.1 \
bash
9 changes: 9 additions & 0 deletions docker/set-me-up.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
./run-ros-image.sh dt
sleep 5
container_id=$(docker ps -aqf "name=tsdf-plusplus" | tr -d '\n')
echo "Docker container $container_id"
echo "Write absolute path of the folder on your computer, you want the entire '/home/ros/catkin_ws' folder on the docker machine to be copied into:"
read destination_folder
docker cp $container_id:/home/ros/catkin_ws $destination_folder
docker stop -t 1 $container_id

0 comments on commit 4b01072

Please sign in to comment.