Skip to main content

智能网联平台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, frames 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 - 带图形界面的状态显示示例

文档

完整的文档可以在以下方式获取:

  1. 在线文档 - 查看最新的 API 文档
  2. 本地构建:
    cd docs
    pip install -r requirements.txt
    make html
    

系统要求

  • Python 3.10 或更高版本

许可证

本项目使用 MIT 许可证。详见 LICENSE 文件。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metacar-0.4.0a1.tar.gz (23.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

metacar-0.4.0a1-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file metacar-0.4.0a1.tar.gz.

File metadata

  • Download URL: metacar-0.4.0a1.tar.gz
  • Upload date:
  • Size: 23.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for metacar-0.4.0a1.tar.gz
Algorithm Hash digest
SHA256 28f97c5249c703d82f4321ffafc240f50d5d477492a578866954f207712ad291
MD5 2ce784359b3b20c4c1d8ae84455a23c3
BLAKE2b-256 dad116915ee0522751a88a6bb99b1c9c2fb24b8467d0d681f0d3137b7dcf8c54

See more details on using hashes here.

Provenance

The following attestation bundles were made for metacar-0.4.0a1.tar.gz:

Publisher: python-publish.yml on YDL-Simulation/autodrive_api_python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file metacar-0.4.0a1-py3-none-any.whl.

File metadata

  • Download URL: metacar-0.4.0a1-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for metacar-0.4.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 bf74c6c6ae62de962f4244b6c5964ee35b8f4733073a3e81fb6ae28f330eaa45
MD5 9f7ff71cac9ca1c951623e33e68d4604
BLAKE2b-256 25ffb9c6caa795177294896312d5580ea8e60b0b4f0542c47005156f8f5f82e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for metacar-0.4.0a1-py3-none-any.whl:

Publisher: python-publish.yml on YDL-Simulation/autodrive_api_python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page