Skip to content

Commit

Permalink
Merge pull request #374 from RoyAmoyal/fix_installation_ubuntu20.04_2…
Browse files Browse the repository at this point in the history
…2.04
  • Loading branch information
wouter-heerwegh authored Oct 23, 2024
2 parents c1f1a2a + a823958 commit ad74992
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 14 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -28,18 +28,16 @@ jobs:
uses: betwo/[email protected]
with:
# Version range or exact version of ROS version to use, using SemVer's version range syntax.
ros-version: 'melodic'
ros-version: 'noetic'
build-tool: 'catkin_tools'
# Root directory of the catkin workspace
workspace: ./ros

- name: Compilation settings
run: |
sudo apt-get -y install gcc-8 g++-8 rsync libyaml-cpp-dev libcurl4-openssl-dev
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 700 --slave /usr/bin/g++ g++ /usr/bin/g++-7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8
sudo apt-get -y install rsync libyaml-cpp-dev libcurl4-openssl-dev
- name: Setup AirSim
- name: Setup AirSim
run: |
./setup.sh
./build.sh
Expand All @@ -48,7 +46,7 @@ jobs:
- name: Build catkin ws
run: |
set -ex o pipefail
catkin build
working-directory: ./ros
catkin build
working-directory: ./ros
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
4 changes: 4 additions & 0 deletions AirSim/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ fi

# variable for build output
build_dir=build_debug
VERSION=$(lsb_release -rs | cut -d. -f1)
if [ "$(uname)" == "Darwin" ]; then
export CC=/usr/local/opt/llvm@8/bin/clang
export CXX=/usr/local/opt/llvm@8/bin/clang++
elif [ "$VERSION" -lt "22" ]; then
export CC="clang-8"
export CXX="clang++-8"
else
export CC="clang-12"
export CXX="clang++-12"
Expand Down
51 changes: 51 additions & 0 deletions AirSim/docker_build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
FROM ubuntu:20.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
sudo \
git \
build-essential \
cmake \
libboost-all-dev \
libasio-dev \
libtinyxml2-dev \
libcurl4-openssl-dev \
libglfw3-dev \
libglew-dev \
libpng-dev \
libjpeg-dev \
libopencv-dev \
libtiff-dev \
python3 \
python3-pip \
python3-dev \
unzip \
wget \
lsb-release \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN apt-get update && apt-get install -y \
clang-8 \
lld-8 \
llvm-8 \
llvm-8-dev \
llvm-8-tools

RUN apt-get update && apt-get install -y \
g++ \
libc++-dev \
libc++abi-dev

RUN apt-get update && apt-get install -y \
wget \
software-properties-common \
gnupg \
rsync \
&& apt-get clean

WORKDIR /home/airsim/Formula-Student-Driverless-Simulator/AirSim

ENTRYPOINT ["/bin/bash"]

9 changes: 5 additions & 4 deletions AirSim/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ VERSION=$(lsb_release -rs | cut -d. -f1)
# Since Ubuntu 17 clang is part of the core repository
# See https://packages.ubuntu.com/search?keywords=clang-8
if [ "$VERSION" -lt "20" ]; then
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 12
sudo apt-get install -y clang-8 clang++-8 libc++-8-dev libc++abi-8-dev
elif [ "$VERSION" -lt "22" ]; then
sudo apt-get install -y clang-8 libc++-8-dev libc++abi-8-dev
else
sudo apt-get install -y clang-12 clang++-12 libc++-12-dev libc++abi-12-dev
fi
sudo apt-get install -y clang-12 clang++-12 libc++-12-dev libc++abi-12-dev

#install additional tools
sudo apt-get install -y build-essential
Expand Down
32 changes: 31 additions & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Try driving the car around using the arrowkeys.
If you get a black screen with some buttons, make sure the folder with the binary is in your user folder (Windows: `C:\Users\username\Formula-Student-Driverless-Simulator`, Linux: `~/Formula-Student-Driverless-Simulator`)

If all that works, you can continue to [the ROS interface](getting-started-with-ros.md) or [the python interface](getting-started-with-python.md).

### From source using the Unreal Engine Editor
Instead of running the simulator from release binaries, you can compile it manually using unreal engine.
This is usefull if you want to get the latest changes or if you want to make changes to the maps or the simulation itself.
Expand Down Expand Up @@ -76,7 +77,36 @@ On Windows, open the _Developer Command Prompt for VS 2019_, go to `Formula-Stud
build.cmd
```

On Ubuntu, go to folder `AirSim` and run `setup.sh` and `build.sh`.
On Ubuntu 18.04 and 20.04, go to folder `AirSim` and run `setup.sh` and `build.sh`.

##### For Ubuntu 22.04+
**Written by Roy Amoyal, Head of the Autonomous Division at BGRacing 2024 (Formula Student Driverless Project at Ben Gurion University)**
First, install Docker on your Ubuntu system.

Change to the Docker Build Directory: Note that this directory is within the AirSim folder, not the root of the Formula-Student-Driverless-Simulator repository.

cd /home/$USER/Formula-Student-Driverless-Simulator/AirSim/docker_build

1. Build the Docker Image:

docker build -t formula-simulator .

2. Run the Docker Container: After the build completes, mount your local folder into the container:

docker run --rm -it -v $PWD/../..:/home/airsim/Formula-Student-Driverless-Simulator formula-simulator

3. Run the Setup and Build:

./setup.sh && ./build.sh

4. Exit the Docker Container: Press Ctrl + D in the terminal to exit.

5. Build the final project, use the following command (this process may take some time):

~/UnrealEngine/Engine/Binaries/ThirdParty/Mono/Linux/bin/mono ~/UnrealEngine/Engine/Binaries/DotNET/UnrealBuildTool.exe Development Linux -Project=/home/$uSER/Formula-Student-Driverless-Simulator/UE4Project/FSOnline.uproject -TargetType=Editor -Progress

Congratulations! You have successfully built the project from source. You can now continue with Unreal Engine.


> So what does build.cmd or setup.sh+build.sh do?
It downloads any nessesary libraries and compiles AirLib.
Expand Down

0 comments on commit ad74992

Please sign in to comment.