Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge main branch into feature branch 285 #329

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
f32c39b
Refactor student_roles24.md
ll7 Oct 4, 2024
197c02e
Add git-mob extension to .vscode/extensions.json
ll7 Oct 4, 2024
1db1d6e
Validation Engineer role abbreviation
ll7 Oct 4, 2024
4fae063
Refactor student_roles24.md
ll7 Oct 4, 2024
3a17b04
remove redundant whitespace
ll7 Oct 4, 2024
98a5e54
Merge pull request #305 from una-auxme/304-Adapt-student-roles
ll7 Oct 4, 2024
6fa7d2e
Merge pull request #307 from una-auxme/306-add-vscode-co-author-exten…
ll7 Oct 4, 2024
b287690
Changed route of dev to simple route
JulianTrommer Oct 7, 2024
e51d677
Merge pull request #308 from una-auxme/296-verify-that-docker-compose…
ll7 Oct 7, 2024
254c7f5
[Bug]: vulkan device
ll7 Oct 7, 2024
7aba600
Fix broken links in installation documentation
ll7 Oct 7, 2024
ca15e73
Merge pull request #311 from una-auxme/310-Bug-vulkan-device
ll7 Oct 7, 2024
17ed54a
Updated all occurences of name paf
JulianTrommer Oct 7, 2024
69f79be
Merge pull request #312 from una-auxme/283-feature-rename-repository-…
JulianTrommer Oct 7, 2024
1dabc13
Removed b5 from project
JulianTrommer Oct 8, 2024
070da81
Merge pull request #314 from una-auxme/274-feature-discuss-how-to-dea…
JulianTrommer Oct 8, 2024
6c9b3da
Removed PyCharm & changed docstring settings
JulianTrommer Oct 8, 2024
87178de
Changed docs to adhere to new markdown linting
JulianTrommer Oct 8, 2024
179f704
Merge pull request #318 from una-auxme/315-feature-remove-pycharm-fro…
JulianTrommer Oct 8, 2024
bf6d0b2
Removed precommit hooks & comlipy
JulianTrommer Oct 8, 2024
120dde3
Merge pull request #322 from una-auxme/265-feature-remove-the-precomm…
JulianTrommer Oct 8, 2024
8c043bb
Renamed compose files for execution
JulianTrommer Oct 9, 2024
0aece19
Removed obsolete shell scripts
JulianTrommer Oct 9, 2024
ca4fdae
Updated build documentation
JulianTrommer Oct 9, 2024
daa6369
Fixed names of compose files
JulianTrommer Oct 9, 2024
22becfc
Merge pull request #323 from una-auxme/319-feature-change-docker-comp…
JulianTrommer Oct 9, 2024
622ff16
Removed leading numbers from folders & files
JulianTrommer Oct 9, 2024
2b1dc93
Fixed uppercase for README files
JulianTrommer Oct 9, 2024
4de3c97
Refactored research docs
JulianTrommer Oct 9, 2024
eacde11
Refactord docs to wiki page template
JulianTrommer Oct 10, 2024
642bc6c
Updated execution & development notes
JulianTrommer Oct 10, 2024
5082d81
Removed blank line from markdown
JulianTrommer Oct 10, 2024
e82a042
Merge pull request #325 from una-auxme/275-feature-rework-documentati…
JulianTrommer Oct 14, 2024
c5c3e9f
Added black action & refactored actions
JulianTrommer Oct 14, 2024
60501bb
Fixed issues with file permissions & black linter
JulianTrommer Oct 14, 2024
e97dae5
Added black formatter to project
JulianTrommer Oct 15, 2024
5d522eb
Applied black formatting
JulianTrommer Oct 15, 2024
daf2255
Refactored repo with linters
JulianTrommer Oct 15, 2024
7d10c04
Merge pull request #327 from una-auxme/289-feature-add-automatic-code…
JulianTrommer Oct 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ insert_final_newline = true
trim_trailing_whitespace = true

[*.py]
max_line_length = 80
max_line_length = 88
indent_size = 4

[*.md]
Expand Down
8 changes: 2 additions & 6 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[flake8]
exclude= code/planning/src/behavior_agent/behavior_tree.py,
code/planning/src/behavior_agent/behaviours/__init__.py,
code/planning/src/behavior_agent/behaviours,
code/planning/__init__.py,
doc/02_development/templates/template_class_no_comments.py,
doc/02_development/templates/template_class.py
max-line-length = 88
extend-ignore = E203,E701
2 changes: 1 addition & 1 deletion .github/workflows/add-to-project.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Add bugs to bugs project
name: Add issue to project

on:
issues:
Expand Down
90 changes: 6 additions & 84 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Build, publish and run tests
name: Build and push image

on:
push:
branches: [ 'main' ]
pull_request:
workflow_run:
workflows: ["Check code format", "Linter markdown and code"]
types:
- completed

env:
REGISTRY: ghcr.io
Expand Down Expand Up @@ -38,19 +39,6 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Bump version and push tag
# only run on push to main
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
id: tag
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
release_branches: main

- name: Get commit hash
id: hash
run: echo "hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Build and push Docker image
id: build
uses: docker/build-push-action@v3
Expand All @@ -59,72 +47,6 @@ jobs:
file: ./build/docker/build/Dockerfile
push: true
# tag 'latest' and version on push to main, otherwise use the commit hash
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.new_version == '' && steps.hash.outputs.hash || steps.tag.outputs.new_version }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && 'latest' || steps.hash.outputs.hash }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Output version
id: version
# take either the created tag or the commit hash
run: echo "version=${{ steps.tag.outputs.new_version == '' && steps.hash.outputs.hash || steps.tag.outputs.new_version }}" >> $GITHUB_OUTPUT
drive:
runs-on: self-hosted
needs: build-and-push-image
# run only on pull request for now
if: github.event_name == 'pull_request'
env:
AGENT_VERSION: ${{ needs.build-and-push-image.outputs.version }}
COMPOSE_FILE: ./build/docker-compose_cicd.yaml
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Print environment variables (DEBUG)
run: |
echo "AGENT_VERSION=${AGENT_VERSION}"
echo "COMPOSE_FILE=${COMPOSE_FILE}"
- name: Get commit hash
id: hash
run: echo "hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Set AGENT_VERSION from hash (workaround)
run: echo "AGENT_VERSION=${{ steps.hash.outputs.hash }}" >> $GITHUB_ENV
- name: Run docker-compose
run: docker compose up --quiet-pull --exit-code-from agent
- name: Copy results
run: docker compose cp agent:/tmp/simulation_results.json .
- name: Stop docker-compose
# always run this step, to clean up even on error
if: always()
run: docker compose down -v
# add rendered JSON as comment to the pull request
- name: Add simulation results as comment
if: github.event_name == 'pull_request'
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
# this script reads the simulation_results.json and creates a comment on the pull request with the results.
script: |
const fs = require('fs');
// read the simulation results
const results = fs.readFileSync('./simulation_results.json', 'utf8');
let resultsJson = JSON.parse(results);
// create a markdown table of the results
let resultsTable = resultsJson.values.map((values, i) => {
return `| ${resultsJson.labels[i]} | ${values} |`;
});
// create a markdown table header
let resultsTableHeader = `| Metric | Value |`;
// create a markdown table divider
let resultsTableDivider = `| --- | --- |`;
// add everything to the resultsTable
resultsTable = resultsTableHeader + '\n' + resultsTableDivider + '\n' + resultsTable.join('\n');
// add the results as a comment to the pull request
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "## Simulation results\n" + resultsTable
});
- name: Prune all images older than 30 days from self-hosted runner
run: docker image prune -a --force --filter "until=720h"
63 changes: 63 additions & 0 deletions .github/workflows/drive.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Evaluate agent

on:
workflow_run:
workflows: ["Build and push image"]
types:
- completed

jobs:
drive:
runs-on: self-hosted
needs: build-and-push-image
# run only on pull request for now
if: github.event_name == 'pull_request'
env:
AGENT_VERSION: latest
COMPOSE_FILE: ./build/docker-compose.cicd.yaml
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Print environment variables (DEBUG)
run: |
echo "AGENT_VERSION=${AGENT_VERSION}"
echo "COMPOSE_FILE=${COMPOSE_FILE}"
- name: Run docker-compose
run: docker compose up --quiet-pull --exit-code-from agent
- name: Copy results
run: docker compose cp agent:/tmp/simulation_results.json .
- name: Stop docker-compose
# always run this step, to clean up even on error
if: always()
run: docker compose down -v
# add rendered JSON as comment to the pull request
- name: Add simulation results as comment
if: github.event_name == 'pull_request'
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
# this script reads the simulation_results.json and creates a comment on the pull request with the results.
script: |
const fs = require('fs');
// read the simulation results
const results = fs.readFileSync('./simulation_results.json', 'utf8');
let resultsJson = JSON.parse(results);
// create a markdown table of the results
let resultsTable = resultsJson.values.map((values, i) => {
return `| ${resultsJson.labels[i]} | ${values} |`;
});
// create a markdown table header
let resultsTableHeader = `| Metric | Value |`;
// create a markdown table divider
let resultsTableDivider = `| --- | --- |`;
// add everything to the resultsTable
resultsTable = resultsTableHeader + '\n' + resultsTableDivider + '\n' + resultsTable.join('\n');
// add the results as a comment to the pull request
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "## Simulation results\n" + resultsTable
});
- name: Prune all images older than 30 days from self-hosted runner
run: docker image prune -a --force --filter "until=720h"
21 changes: 21 additions & 0 deletions .github/workflows/format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Check code format

on:
pull_request:
branches:
- "main"

jobs:
format:
name: Check code files format
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
# Execute the python formatter
- name: Run the python formatter
uses: addnab/docker-run-action@v3
with:
image: pyfound/black
options: -v ${{ github.workspace}}:/apps
run: black --check ./apps/
18 changes: 9 additions & 9 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: linter
name: Linter markdown and code

on: pull_request
on:
pull_request:
branches:
- "main"

jobs:
linter:
Expand All @@ -13,16 +16,13 @@ jobs:
- name: Run the markdown linter
uses: addnab/docker-run-action@v3
with:
image: peterdavehello/markdownlint:0.32.2
options: -v ${{ github.workspace }}:/md
run: |
markdownlint .
image: peterdavehello/markdownlint:0.32.2
options: -v ${{ github.workspace }}:/md
run: markdownlint .
# Execute the python linter (executes even if the previous step failed)
- name: Run the python linter
if: always()
uses: addnab/docker-run-action@v3
with:
image: alpine/flake8
options: -v ${{ github.workspace }}:/apps
run: |
flake8 code
run: flake8 .
2 changes: 1 addition & 1 deletion .markdownlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MD013:
tables: false

MD004:
style: "consistent"
style: dash

MD051: false

Expand Down
6 changes: 5 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
"njpwerner.autodocstring",
"ms-azuretools.vscode-docker",
"ms-python.flake8",
"bierner.markdown-mermaid"
"bierner.markdown-mermaid",
"richardkotze.git-mob",
"ms-vscode-remote.remote-containers",
"valentjn.vscode-ltex",
"ms-python.black-formatter"
]
}
11 changes: 9 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"githubIssues.issueBranchTitle": "${issueNumber}-${sanitizedIssueTitle}",
"githubIssues.queries": [

{
"label": "My Issues",
"query": "default"
Expand All @@ -19,5 +18,13 @@
"query": "state:open repo:${owner}/${repository} sort:created-desc"
}
],
"ltex.language": "en-US"
"ltex.language": "en-US",
"docker.commands.composeUp": [
{
"label": "Compose Up",
"template": "xhost +local: && USERNAME=$(whoami) USER_UID=$(id -u) USER_GID=$(id -g) ${composeCommand} ${configurationFile} up"
}
],
"workbench.iconTheme": "vscode-icons",
"editor.formatOnSave": true
}
32 changes: 11 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Praktikum Autonomes Fahren 2023 - PAF23
# Praktikum Autonomes Fahren - PAF

This repository contains the source code for the "Praktikum Autonomes Fahren" at the Chair of Mechatronics from the University of Augsburg in the winter semester of 2023/2024.
This repository contains the source code for the "Praktikum Autonomes Fahren" at the Chair of Mechatronics from the University of Augsburg.
The goal of the project is to develop a self-driving car that can navigate through a simulated environment.
The project is based on the [CARLA simulator](https://carla.org/) and uses the [ROS](https://www.ros.org/) framework for communication between the different components.
In the future, the project aims to contribute to the [CARLA Autonomous Driving Challenge](https://leaderboard.carla.org/challenge/).
Expand All @@ -21,32 +21,22 @@ To be able to execute and develop the project, you need a Linux system equipped

As the project is still in early development, these requirements are subject to change.

## Installation
## Getting started

To run the project you have to install [b5](https://github.com/team23/b5)
and [docker](https://docs.docker.com/engine/install/) with NVIDIA GPU support,
### Installation

To run the project you have to install [docker](https://docs.docker.com/engine/install/) with NVIDIA GPU support,
[nvidia-docker](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker).
`b5` is used to simplify some of the docker commands and to provide a more user-friendly interface.
`docker` and `nvidia-docker` are used to run the project in a containerized environment with GPU support.

Afterwards, you can set up and execute the project with the following two commands:

```bash
# Setup project
b5 install

# Run project
b5 run
```

More detailed instructions about setup and execution can be found [here](./doc/01_general/Readme.md).

More available b5 commands are documented [here](./doc/01_general/03_commands.md).
More detailed instructions about the setup can be found [here](./doc/general/installation.md).

## Development

If you contribute to this project please read the guidelines first. They can be found [here](./doc/02_development/Readme.md).
To get an overview of the current architecture of the agent you can look at the general documentation [here](./doc/general/architecture.md). The individual components are explained in the README files of their subfolders.

If you contribute to this project please read the guidelines first. They can be found [here](./doc/development/README.md).

## Research

The research on existing projects we did can be found [here](./doc/03_research/Readme.md).
The research on existing projects we did can be found [here](./doc/research/README.md).
Loading
Loading