Skip to content

Commit 8200749

Browse files
committed
Update README and pyproject.toml
1 parent 935339b commit 8200749

File tree

5 files changed

+146
-112
lines changed

5 files changed

+146
-112
lines changed

README.md

Lines changed: 49 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,82 @@
11
<h1 align="center">
2-
Automated driving algorithms
2+
自动驾驶算法
33
</h1>
44
<p align="center">
5-
Python codes for automated driving algorithms.
5+
自动驾驶相关算法代码仓库,Python 语言版。
66
</p>
77
<p align="center">
8-
English | <a href="README_zh.md">简体中文</a>
8+
简体中文 | <a href="README_en.md">English</a>
99
</p>
1010

11-
## How to use
11+
[![GitHub Repo stars](https://img.shields.io/github/stars/muziing/PythonAutomatedDriving)](https://github.com/muziing/PythonAutomatedDriving)
12+
![License](https://img.shields.io/github/license/muziing/PythonAutomatedDriving)
1213

13-
### 1. Get source code
14+
[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)
15+
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
16+
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
17+
[![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)
18+
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/muziing/PythonAutomatedDriving/main.svg)](https://results.pre-commit.ci/latest/github/muziing/PythonAutomatedDriving/main)
1419

15-
1. Add star to this repo if you like it :smiley:
16-
2. Get source code by one of the following methods
17-
- [Download code zip](https://github.com/muziing/PythonAutomatedDriving/archive/refs/heads/main.zip)
18-
- (For development only) clone repo `git clone https://github.com/muziing/PythonAutomatedDriving.git`
19-
3. Go to the project directory `cd /your/path/to/PythonAutomatedDriving`
20+
## 简介
2021

21-
### 2. Creating Virtual Environment and Install requirements
22+
本代码仓库收录若干关于「自动驾驶-规划与控制算法」相关的代码,全部由 Python 语言实现。希望能为其他 PnC 算法学习者提供一批接口清晰统一、可直接复用的代码段,避免减少重复造轮子。
2223

23-
**Option A**: venv & pip
24+
## 如何使用
2425

25-
1. Ensure that the Python version matches the one required in [pyproject.toml](./pyproject.toml).
26-
2. Create virtual environment
26+
### 一、获取源码
27+
28+
1. Star 本仓库 :smiley:
29+
2. 通过以下方式之一获取源码:
30+
- 下载代码压缩包:<https://github.com/muziing/PythonAutomatedDriving/archive/refs/heads/main.zip>
31+
- (仅需要参与开发时)克隆仓库 `git clone https://github.com/muziing/PythonAutomatedDriving.git`
32+
3. 进入项目目录 `cd /your/path/to/PythonAutomatedDriving`
33+
34+
### 二、配置虚拟环境与安装依赖
35+
36+
**方式 A**: venv 与 pip
37+
38+
1. 确保 Python 版本与 [pyproject.toml](./pyproject.toml) 中要求的一致
39+
2. 创建虚拟环境
2740
- Windows: `python -m venv --upgrade-deps venv`
2841
- Linux/macOS: `python3 -m venv --upgrade-deps venv`
29-
3. Activate virtual environment
42+
3. 激活虚拟环境
3043
- Windows: `venv\Scripts\activate`
3144
- Linux/macOS: `. venv/bin/activate`
32-
4. Install the requirements `pip install -r requirements.txt`
45+
4. 安装依赖 `pip install -r requirements.txt`
46+
47+
**方式 B**[Poetry](https://python-poetry.org)
3348

34-
**Option B**: [Poetry](https://python-poetry.org)
49+
1. 确保 Python 版本与 [pyproject.toml](./pyproject.toml) 中要求的一致
50+
2.[官方文档](https://python-poetry.org/docs/#installation)指示安装 Poetry
51+
3. 创建虚拟环境:`poetry env use /full/path/to/python`(注意替换路径,使用符合版本要求的解释器)
52+
4. 安装依赖:`poetry install --no-dev`
53+
5. 使用该虚拟环境: `poetry shell`(或在 PyCharm 等 IDE 中配置)
3554

36-
1. Make sure the Python version is the same as required in [pyproject.toml](./pyproject.toml).
37-
2. Install Poetry as instructed in the [official documentation](https://python-poetry.org/docs/#installation).
38-
3. Create a virtual environment: `poetry env use /full/path/to/python`
39-
4. Install dependencies: `poetry install --no-dev`
40-
5. Use the virtual environment: `poetry shell` (or configure it in an IDE like PyCharm).
55+
**方式 C**[Anaconda](https://www.anaconda.com/)
4156

42-
**Option C**: [Anaconda](https://www.anaconda.com/)
57+
由于主要开发与测试工作仅在 Poetry 环境中进行,conda 环境可能出现意料之外的错误。请[提交 issue](https://github.com/muziing/PythonAutomatedDriving/issues) 帮助我发现和解决这些问题。
4358

4459
````shell
4560
conda env create -f environment.yml
4661
````
4762

48-
### 3. Run!
63+
### 三、运行!
4964

50-
Execute Python script in each directory.
65+
在每个子项目目录中运行 Python 脚本。
5166

52-
## Table of Contents
67+
## 目录
5368

54-
### [AuxiliaryFunctions](AuxiliaryFunctions)
69+
### [utilities](src/utilities) 辅助函数
5570

56-
- [curvature](AuxiliaryFunctions/curvature.py) calculate curvature
71+
- [coordinate_transformation](src/utilities/coordinate_transformation.py) - 坐标变换
72+
- [discrete_curve_funcs](src/utilities/discrete_curve_funcs.py) - 处理二维离散曲线的函数
73+
- [numpy_additional_funcs](src/utilities/numpy_additional_funcs.py) - 一些补充numpy功能的自实现函数
5774

58-
### [LocalPathPlanning](LocalPathPlanning)
75+
### [LocalPathPlanning](src/LocalPathPlanning) - 局部路径规划
5976

60-
- [FSAE Path Planning](LocalPathPlanning/FSAE_PathPlanning) 适用于 FSAE 无人赛车高速循迹项目的路径规划算法
77+
- [FSAE Path Planning](src/LocalPathPlanning/FSAE_PathPlanning) - 一种适用于 FSAE 无人赛车高速循迹项目的路径规划算法
6178

62-
## License
79+
## 许可协议
6380

6481
````text
6582
Copyright 2022-2023 muzing
@@ -68,7 +85,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
6885
you may not use this file except in compliance with the License.
6986
You may obtain a copy of the License at
7087
71-
http://www.apache.org/licenses/LICENSE-2.0
88+
https://www.apache.org/licenses/LICENSE-2.0
7289
7390
Unless required by applicable law or agreed to in writing, software
7491
distributed under the License is distributed on an "AS IS" BASIS,

README_en.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<h1 align="center">
2+
Automated driving algorithms
3+
</h1>
4+
<p align="center">
5+
Python codes for automated driving algorithms.
6+
</p>
7+
<p align="center">
8+
<a href="README.md">简体中文</a> | English
9+
</p>
10+
11+
[![GitHub Repo stars](https://img.shields.io/github/stars/muziing/PythonAutomatedDriving)](https://github.com/muziing/PythonAutomatedDriving)
12+
![License](https://img.shields.io/github/license/muziing/PythonAutomatedDriving)
13+
14+
[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)
15+
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
16+
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
17+
[![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)
18+
19+
## How to use
20+
21+
### 1. Get source code
22+
23+
1. Add star to this repo if you like it :smiley:
24+
2. Get source code by one of the following methods
25+
- [Download code zip](https://github.com/muziing/PythonAutomatedDriving/archive/refs/heads/main.zip)
26+
- (For development only) clone repo `git clone https://github.com/muziing/PythonAutomatedDriving.git`
27+
3. Go to the project directory `cd /your/path/to/PythonAutomatedDriving`
28+
29+
### 2. Creating Virtual Environment and Install requirements
30+
31+
**Option A**: venv & pip
32+
33+
1. Ensure that the Python version matches the one required in [pyproject.toml](./pyproject.toml).
34+
2. Create virtual environment
35+
- Windows: `python -m venv --upgrade-deps venv`
36+
- Linux/macOS: `python3 -m venv --upgrade-deps venv`
37+
3. Activate virtual environment
38+
- Windows: `venv\Scripts\activate`
39+
- Linux/macOS: `. venv/bin/activate`
40+
4. Install the requirements `pip install -r requirements.txt`
41+
42+
**Option B**: [Poetry](https://python-poetry.org)
43+
44+
1. Make sure the Python version is the same as required in [pyproject.toml](./pyproject.toml).
45+
2. Install Poetry as instructed in the [official documentation](https://python-poetry.org/docs/#installation).
46+
3. Create a virtual environment: `poetry env use /full/path/to/python`
47+
4. Install dependencies: `poetry install --no-dev`
48+
5. Use the virtual environment: `poetry shell` (or configure it in an IDE like PyCharm).
49+
50+
**Option C**: [Anaconda](https://www.anaconda.com/)
51+
52+
````shell
53+
conda env create -f environment.yml
54+
````
55+
56+
### 3. Run!
57+
58+
Execute Python script in each directory.
59+
60+
## Table of Contents
61+
62+
### [AuxiliaryFunctions](AuxiliaryFunctions)
63+
64+
- [curvature](AuxiliaryFunctions/curvature.py) calculate curvature
65+
66+
### [LocalPathPlanning](LocalPathPlanning)
67+
68+
- [FSAE Path Planning](LocalPathPlanning/FSAE_PathPlanning) 适用于 FSAE 无人赛车高速循迹项目的路径规划算法
69+
70+
## License
71+
72+
````text
73+
Copyright 2022-2023 muzing
74+
75+
Licensed under the Apache License, Version 2.0 (the "License");
76+
you may not use this file except in compliance with the License.
77+
You may obtain a copy of the License at
78+
79+
https://www.apache.org/licenses/LICENSE-2.0
80+
81+
Unless required by applicable law or agreed to in writing, software
82+
distributed under the License is distributed on an "AS IS" BASIS,
83+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
84+
See the License for the specific language governing permissions and
85+
limitations under the License.
86+
````

README_zh.md

Lines changed: 0 additions & 78 deletions
This file was deleted.

poetry.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ repository = "https://github.com/muziing/PythonAutomatedDriving"
1313

1414
[tool.poetry.dependencies]
1515
python = ">=3.9,<3.12"
16-
numpy = "^1.24.0"
16+
numpy = "^1.25.0"
1717
scipy = "^1.11.0"
1818
matplotlib = "^3.7.0"
1919
jupyter = "^1.0.0"
@@ -44,6 +44,15 @@ target-version = ['py311']
4444
profile = "black"
4545
line_length = 88
4646

47+
[tool.mypy]
48+
ignore_missing_imports = true
49+
check_untyped_defs = true
50+
51+
[tool.ruff]
52+
# 目前版本的 Ruff 对中文字符支持不佳,对包含中文注释的代码会误认为过长,
53+
# 所以需要在配置文件中设置较大的行长度。真正的行长度控制由 Black 完成
54+
line-length = 130
55+
4756
[build-system]
4857
requires = ["poetry-core"]
4958
build-backend = "poetry.core.masonry.api"

0 commit comments

Comments
 (0)