Skip to content

Commit 5a1d788

Browse files
committed
Add ROS1 dockerfile
* Modeled after https://github.com/nachovizzo/ros_in_docker * Clarify install instructions in README Signed-off-by: Ryan Friedman <[email protected]>
1 parent 98203ad commit 5a1d788

File tree

2 files changed

+61
-4
lines changed

2 files changed

+61
-4
lines changed

README.md

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,49 @@ This package includes a global planner based on Dubins RRT* enabling low altitud
77
![overview3](https://github.com/ethz-asl/terrain-navigation/assets/5248102/90e43b60-ea8c-49db-9fb3-257b145fc35c)
88

99
## Setup
10-
Install the dependencies. This package depends on gdal, to read georeferenced images and GeoTIFF files.
10+
11+
### Setting up the Build Environment using Docker
12+
13+
If your operating system doesn't support ROS 1 noetic, docker is a great alternative.
14+
15+
First, create the image, with the build context at the root of this repo
16+
17+
```
18+
docker build --file docker/Dockerfile --tag terrain-navigation-ros1 .
19+
```
20+
21+
You can see the image exists:
22+
```
23+
docker images
24+
>>> REPOSITORY TAG IMAGE ID CREATED SIZE
25+
>>> terrain-navigation-ros1 latest 5565f845ab4f 2 weeks ago 774MB
1126
```
12-
apt install libgdal-dev
27+
28+
Next, run the image, mounting in the source into a workspace. All the dependencies are now installed.
29+
```
30+
docker run --network=host -it -v $(pwd):/root/catkin_ws/src/terrain-navigation -w /root/catkin_ws terrain-navigation-ros1 bash
1331
```
32+
33+
### Running the Build
34+
1435
Configure the catkin workspace
1536
```
1637
catkin config --extend "/opt/ros/noetic"
1738
catkin config --merge-devel
1839
```
1940

20-
Pull in dependencies using rosinstall / rosdep
41+
For dependencies that do not have binaries available, pull them in using rosinstall.
2142
```
2243
wstool init src src/terrain-navigation/dependencies.rosinstall
2344
wstool update -t src -j4
45+
```
46+
47+
For dependencies available through binaries, use rosdep.
48+
This package depends on [GDAL](https://gdal.org/index.html) to read georeferenced images and GeoTIFF files.
49+
```
2450
rosdep update
25-
rosdep install --from-paths src --ignore-src -y --rosdistro noetic
51+
source /opt/ros/noetic/setup.bash
52+
rosdep install --from-paths src --ignore-src -y
2653
```
2754

2855
Build the package
@@ -32,6 +59,7 @@ catkin build -j$(nproc) -l$(nproc) terrain_navigation_ros
3259
```
3360

3461
## Running with PX4 SITL(Software-In-The-Loop)
62+
3563
To setup PX4, clone the [ETHZ ASL PX4 autopilot project](https://github.com/ethz-asl/ethzasl_fw_px4/tree/pr-hinwil-testing)
3664
The setup instructions can be found in the [documentation](https://docs.px4.io/main/en/dev_setup/dev_env_linux_ubuntu.html)
3765

docker/Dockerfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# https://github.com/osrf/docker_images/blob/df19ab7d5993d3b78a908362cdcd1479a8e78b35/ros/noetic/ubuntu/focal/ros-core/Dockerfile
2+
FROM ros:noetic-ros-core-focal
3+
4+
SHELL ["/bin/bash", "-c"]
5+
6+
WORKDIR /root/catkin_ws/src/terrain-navigation
7+
8+
COPY mav_planning_rviz/package.xml mav_planning_rviz/package.xml
9+
COPY planner_msgs/package.xml planner_msgs/package.xml
10+
COPY terrain_navigation/package.xml terrain_navigation/package.xml
11+
COPY terrain_navigation_ros/package.xml terrain_navigation_ros/package.xml
12+
COPY terrain_planner/package.xml terrain_planner/package.xml
13+
COPY terrain_planner_benchmark/package.xml terrain_planner_benchmark/package.xml
14+
15+
WORKDIR /root/catkin_ws/
16+
17+
RUN apt-get update \
18+
# https://ros.org/reps/rep-2001.html#dev-tools
19+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
20+
ros-dev-tools \
21+
ros-noetic-catkin \
22+
python3-catkin-tools \
23+
python3-pip \
24+
&& rosdep init \
25+
&& rosdep update \
26+
&& DEBIAN_FRONTEND=noninteractive rosdep install --from-paths src --ignore-src -r -y \
27+
&& python3 -m pip install \
28+
wstool \
29+
&& rm -rf /var/lib/apt/lists/*

0 commit comments

Comments
 (0)