Skip to content

Commit ad74992

Browse files
Merge pull request #374 from RoyAmoyal/fix_installation_ubuntu20.04_22.04
2 parents c1f1a2a + a823958 commit ad74992

File tree

5 files changed

+98
-14
lines changed

5 files changed

+98
-14
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ jobs:
1414
# This workflow contains a single job called "build"
1515
build:
1616
# The type of runner that the job will run on
17-
runs-on: ubuntu-18.04
17+
runs-on: ubuntu-20.04
1818

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

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

3636
- name: Compilation settings
3737
run: |
38-
sudo apt-get -y install gcc-8 g++-8 rsync libyaml-cpp-dev libcurl4-openssl-dev
39-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 700 --slave /usr/bin/g++ g++ /usr/bin/g++-7
40-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8
38+
sudo apt-get -y install rsync libyaml-cpp-dev libcurl4-openssl-dev
4139
42-
- name: Setup AirSim
40+
- name: Setup AirSim
4341
run: |
4442
./setup.sh
4543
./build.sh
@@ -48,7 +46,7 @@ jobs:
4846
- name: Build catkin ws
4947
run: |
5048
set -ex o pipefail
51-
catkin build
52-
working-directory: ./ros
49+
catkin build
50+
working-directory: ./ros
5351
env:
5452
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'

AirSim/build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@ fi
2828

2929
# variable for build output
3030
build_dir=build_debug
31+
VERSION=$(lsb_release -rs | cut -d. -f1)
3132
if [ "$(uname)" == "Darwin" ]; then
3233
export CC=/usr/local/opt/llvm@8/bin/clang
3334
export CXX=/usr/local/opt/llvm@8/bin/clang++
35+
elif [ "$VERSION" -lt "22" ]; then
36+
export CC="clang-8"
37+
export CXX="clang++-8"
3438
else
3539
export CC="clang-12"
3640
export CXX="clang++-12"

AirSim/docker_build/Dockerfile

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
FROM ubuntu:20.04
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
5+
RUN apt-get update && apt-get install -y \
6+
sudo \
7+
git \
8+
build-essential \
9+
cmake \
10+
libboost-all-dev \
11+
libasio-dev \
12+
libtinyxml2-dev \
13+
libcurl4-openssl-dev \
14+
libglfw3-dev \
15+
libglew-dev \
16+
libpng-dev \
17+
libjpeg-dev \
18+
libopencv-dev \
19+
libtiff-dev \
20+
python3 \
21+
python3-pip \
22+
python3-dev \
23+
unzip \
24+
wget \
25+
lsb-release \
26+
&& apt-get clean \
27+
&& rm -rf /var/lib/apt/lists/*
28+
29+
RUN apt-get update && apt-get install -y \
30+
clang-8 \
31+
lld-8 \
32+
llvm-8 \
33+
llvm-8-dev \
34+
llvm-8-tools
35+
36+
RUN apt-get update && apt-get install -y \
37+
g++ \
38+
libc++-dev \
39+
libc++abi-dev
40+
41+
RUN apt-get update && apt-get install -y \
42+
wget \
43+
software-properties-common \
44+
gnupg \
45+
rsync \
46+
&& apt-get clean
47+
48+
WORKDIR /home/airsim/Formula-Student-Driverless-Simulator/AirSim
49+
50+
ENTRYPOINT ["/bin/bash"]
51+

AirSim/setup.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ VERSION=$(lsb_release -rs | cut -d. -f1)
2727
# Since Ubuntu 17 clang is part of the core repository
2828
# See https://packages.ubuntu.com/search?keywords=clang-8
2929
if [ "$VERSION" -lt "20" ]; then
30-
wget https://apt.llvm.org/llvm.sh
31-
chmod +x llvm.sh
32-
sudo ./llvm.sh 12
30+
sudo apt-get install -y clang-8 clang++-8 libc++-8-dev libc++abi-8-dev
31+
elif [ "$VERSION" -lt "22" ]; then
32+
sudo apt-get install -y clang-8 libc++-8-dev libc++abi-8-dev
33+
else
34+
sudo apt-get install -y clang-12 clang++-12 libc++-12-dev libc++abi-12-dev
3335
fi
34-
sudo apt-get install -y clang-12 clang++-12 libc++-12-dev libc++abi-12-dev
3536

3637
#install additional tools
3738
sudo apt-get install -y build-essential

docs/getting-started.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Try driving the car around using the arrowkeys.
4747
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`)
4848

4949
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).
50+
5051
### From source using the Unreal Engine Editor
5152
Instead of running the simulator from release binaries, you can compile it manually using unreal engine.
5253
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.
@@ -76,7 +77,36 @@ On Windows, open the _Developer Command Prompt for VS 2019_, go to `Formula-Stud
7677
build.cmd
7778
```
7879

79-
On Ubuntu, go to folder `AirSim` and run `setup.sh` and `build.sh`.
80+
On Ubuntu 18.04 and 20.04, go to folder `AirSim` and run `setup.sh` and `build.sh`.
81+
82+
##### For Ubuntu 22.04+
83+
**Written by Roy Amoyal, Head of the Autonomous Division at BGRacing 2024 (Formula Student Driverless Project at Ben Gurion University)**
84+
First, install Docker on your Ubuntu system.
85+
86+
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.
87+
88+
cd /home/$USER/Formula-Student-Driverless-Simulator/AirSim/docker_build
89+
90+
1. Build the Docker Image:
91+
92+
docker build -t formula-simulator .
93+
94+
2. Run the Docker Container: After the build completes, mount your local folder into the container:
95+
96+
docker run --rm -it -v $PWD/../..:/home/airsim/Formula-Student-Driverless-Simulator formula-simulator
97+
98+
3. Run the Setup and Build:
99+
100+
./setup.sh && ./build.sh
101+
102+
4. Exit the Docker Container: Press Ctrl + D in the terminal to exit.
103+
104+
5. Build the final project, use the following command (this process may take some time):
105+
106+
~/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
107+
108+
Congratulations! You have successfully built the project from source. You can now continue with Unreal Engine.
109+
80110

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

0 commit comments

Comments
 (0)