Hand-Eye Calibration Repository
controller.infrastructure.persistence.hand_eye_calibration_repository
手眼标定配置仓储 - Infrastructure层 负责从文件系统读取配置
HandEyeCalibrationRepository
HandEyeCalibrationRepository(config_path: str = None)
手眼标定配置仓储 - Infrastructure层。
负责从文件系统读取配置。
职责: - 从 JSON 文件加载配置 - 转换为 Domain 层的值对象 - 处理文件不存在等异常
属性:
| 名称 | 类型 | 描述 |
|---|---|---|
config_path |
Path
|
配置文件路径。 |
初始化配置仓储。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
config_path
|
str
|
配置文件路径. Defaults to None. 如果为 None,则按以下优先级查找: 1. ROS2 share 目录 (controller/config/hand_eye_calibration.json) 2. 开发环境相对路径 (../../config/hand_eye_calibration.json) |
None
|
源代码位于: src/controller/controller/infrastructure/persistence/hand_eye_calibration_repository.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
load
load() -> HandEyeCalibrationConfig
加载手眼标定配置。
返回:
| 名称 | 类型 | 描述 |
|---|---|---|
HandEyeCalibrationConfig |
HandEyeCalibrationConfig
|
配置值对象。 |
引发:
| 类型 | 描述 |
|---|---|
FileNotFoundError
|
配置文件不存在。 |
ValueError
|
配置格式错误。 |
源代码位于: src/controller/controller/infrastructure/persistence/hand_eye_calibration_repository.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | |
save
save(config: HandEyeCalibrationConfig)
保存配置到文件(可选功能,用于标定工具)。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
config
|
HandEyeCalibrationConfig
|
手眼标定配置对象。 |
必需 |
源代码位于: src/controller/controller/infrastructure/persistence/hand_eye_calibration_repository.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | |