Skip to main content

PB 车辆配置/标定文件(vehicle_config.proto)反序列化校验、解析为 YAML、从 YAML 组装为 .pb.txt。V0.1.3:VehicleConfig 新增 vehicle_lidar_config(enable_ids),兼容 mdrive_conf master_T5 标定。

Project description

pb-calibration

当前版本:0.1.3

基于 vehicle_config.proto 的 PB 车辆配置/标定文件(.pb.txt)反序列化校验、解析为 YAML、从 YAML 按顺序组装为 .pb.txt
V0.1.3:在 V0.1.2 基础上为 VehicleConfig 增加 vehicle_lidar_configenable_ids),与 mdrive_conf 新标定一致。
V0.1.2:VehicleInfo 新增字段 colormanufacturer 等;Point3D/Quaternion 保留在单文件内,无外部 import。

环境与安装

推荐使用 Conda 环境 py310,并在该环境中安装本包及依赖:

conda activate py310
pip install -e .   # 开发安装
# 或
pip install .      # 普通安装

若仅安装不开发,也可:

pip install pb-calibration

功能

  1. 反序列化检查:检查 pb.txt 是否存在格式问题(能否正常解析)。
  2. 解析为 YAML:将 pb.txt 解析为每个单独的 yaml 文件,输出到指定目录;该目录与后续「组合」时使用的目录一致。
  3. 从 YAML 组装:按顺序将指定目录中的单独 yaml 文件组装成 pb.txt(输入目录与解析输出目录一致,可指定)。
  4. YamlConfigManager:类,存储默认 YAML 路径;不缓存 YAML 内容,每次从默认路径读取,保证多程序共同维护时数据为最新。支持 read_yaml / update_yamlread_order_manifest / update_order_manifestrescan / get_cached / get
  5. 函数式 APIread_yamlupdate_yamlread_order_manifestupdate_order_manifest(显式传路径,无状态)。

命令行

# 1. 检查 pb.txt 格式
pb-calibration check -i /path/to/vehicle_config.pb.txt

# 2. 解析 pb.txt 为 yaml,输出到指定目录(该目录即后续 build 的输入)
pb-calibration parse -i /path/to/vehicle_config.pb.txt -o /path/to/yaml_dir

# 3. 从指定目录按顺序组装为 pb.txt(目录与 parse 的 -o 一致)
pb-calibration build -i /path/to/yaml_dir -o /path/to/vehicle_config_out.pb.txt

测试

在项目根目录(V0.1.2)下执行:

conda activate py310
pip install -e .
pytest test/ -v

或单独运行:pytest test/test_roundtrip.py -vpytest test/test_api.py -vpytest test/test_yaml_manager.py -v

依赖

  • Python >= 3.10(推荐在 conda 环境 py310 下使用)
  • PyYAML >= 6.0
  • protobuf >= 4.21.0

License

MIT

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

pb_calibration-0.1.3.tar.gz (23.5 kB view details)

Uploaded Source

Built Distribution

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

pb_calibration-0.1.3-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

Details for the file pb_calibration-0.1.3.tar.gz.

File metadata

  • Download URL: pb_calibration-0.1.3.tar.gz
  • Upload date:
  • Size: 23.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for pb_calibration-0.1.3.tar.gz
Algorithm Hash digest
SHA256 f06b8866a8a5dba2004dab1f47bdae2c1b93c2fbf518edf0a93480e0e4492f0e
MD5 8f8ee188e8f02144d6e496fb8c60e50d
BLAKE2b-256 5df0ba24db25df90231387312d84287637bca815eb6c1698c1e101f60c89e459

See more details on using hashes here.

File details

Details for the file pb_calibration-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: pb_calibration-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for pb_calibration-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6b939b77a57d318047345982b369eba2f7c2df9c43fc487b292c12e3ade7dfdf
MD5 a96434af2282d3d8ea4108008f2826a6
BLAKE2b-256 75d95baf82f1d9ab5d71ce132b74d4e42197b73ce5611c1d76f874138406e5c1

See more details on using hashes here.

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