智能网联平台API
Project description
MetaCar - 智能网联平台API
MetaCar 是一个用于智能网联汽车仿真平台的 Python API,提供了与仿真环境通信、获取场景数据以及发送车辆控制命令的功能。
功能特性
- 与仿真环境的 TCP 通信
- 获取场景静态数据(道路、路径等)
- 实时获取车辆状态和传感器数据
- 发送车辆控制命令(油门、刹车、转向等)
- 摄像头视频流处理
- 矢量计算和几何工具
- 丰富的数据模型
安装
pip install metacar
基本使用
from metacar import SceneAPI, VehicleControl, GearMode
# 创建 API 实例并连接
api = SceneAPI()
api.connect()
# 获取场景静态数据
static_data = api.get_scene_static_data()
# 主循环
for sim_car_msg, frame in api.main_loop():
# 创建控制命令
vc = VehicleControl()
vc.throttle = 0.5 # 设置油门 (0-1)
vc.steering = 0.0 # 设置方向盘 (-1 左, 0 中, 1 右)
# 发送控制命令
api.set_vehicle_control(vc)
示例代码
在 examples 目录中包含了多个示例:
main.py- 基础的键盘控制示例gui.py- 带图形界面的状态显示示例
文档
完整的文档可以在以下方式获取:
- 在线文档 - 查看最新的 API 文档
- 本地构建:
cd docs pip install -r requirements.txt make html
系统要求
- Python 3.9 或更高版本
- OpenCV (cv2)
- NumPy
许可证
本项目使用 MIT 许可证。详见 LICENSE 文件。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file metacar-0.1.1.tar.gz.
File metadata
- Download URL: metacar-0.1.1.tar.gz
- Upload date:
- Size: 20.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7755b0b8fdfed45bbc2c2b4fb48112e945c255236a49696fed1015b6390ada96
|
|
| MD5 |
48faa452e6a4366c9a9acb051f93e6d5
|
|
| BLAKE2b-256 |
27029f300577e534a1641da92edb0e3acc90e75a25a36b7eb84c6d75e514d2d1
|
Provenance
The following attestation bundles were made for metacar-0.1.1.tar.gz:
Publisher:
python-publish.yml on YDL-Simulation/autodrive_api_python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metacar-0.1.1.tar.gz -
Subject digest:
7755b0b8fdfed45bbc2c2b4fb48112e945c255236a49696fed1015b6390ada96 - Sigstore transparency entry: 192902723
- Sigstore integration time:
-
Permalink:
YDL-Simulation/autodrive_api_python@2d28f18ffaea7a3f93f3c2c6fc577462ab8505a6 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/YDL-Simulation
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@2d28f18ffaea7a3f93f3c2c6fc577462ab8505a6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file metacar-0.1.1-py3-none-any.whl.
File metadata
- Download URL: metacar-0.1.1-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28c09ebb87a4c3bbaa7eb04b4c9b2ef5259fa2445e2ff56ce4bbcf0a477d494d
|
|
| MD5 |
42f80164f04f7fb5675efba622550981
|
|
| BLAKE2b-256 |
fcae2f64eb02a12258bf07d9c09434a676a5a56c554818a009722ab3d56510f0
|
Provenance
The following attestation bundles were made for metacar-0.1.1-py3-none-any.whl:
Publisher:
python-publish.yml on YDL-Simulation/autodrive_api_python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metacar-0.1.1-py3-none-any.whl -
Subject digest:
28c09ebb87a4c3bbaa7eb04b4c9b2ef5259fa2445e2ff56ce4bbcf0a477d494d - Sigstore transparency entry: 192902724
- Sigstore integration time:
-
Permalink:
YDL-Simulation/autodrive_api_python@2d28f18ffaea7a3f93f3c2c6fc577462ab8505a6 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/YDL-Simulation
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@2d28f18ffaea7a3f93f3c2c6fc577462ab8505a6 -
Trigger Event:
release
-
Statement type: