|
GKD.RoboCtrl
RoboMaster Linux 电控:异步 IO、设备驱动与机器人控制
|
外部 JSON/YAML 配置的读取与启动前校验。 更多...
#include <algorithm>#include <expected>#include <filesystem>#include <fstream>#include <iterator>#include <ostream>#include <optional>#include <span>#include <string>#include <vector>#include <rfl/thirdparty/enchantum/enchantum.hpp>#include "config/base.hpp"#include "config/validate.hpp"#include "ctrl/power_manager.h"#include "device/aim_link.hpp"#include "device/remote_logger.hpp"#include "device/referee/referee.h"#include "device/super_cap.h"#include "device/motor/j6006.h"#include "device/motor/m9025.h"#include <rfl/NoExtraFields.hpp>#include <rfl/Processors.hpp>#include <rfl/json.hpp>#include <rfl/yaml.hpp>

类 | |
| struct | enchantum::enum_traits< roboctrl::device::dji_motor::type > |
| struct | roboctrl::config::runtime_config |
| 运行时配置根对象。 更多... | |
类型定义 | |
| using | roboctrl::config::configuration_result = std::expected< runtime_config, std::string > |
函数 | |
| void | roboctrl::config::validate_runtime_extensions (const runtime_config &config) |
| configuration_result | roboctrl::config::validate_runtime_configuration (runtime_config config) |
| 校验已解析的运行时配置。 | |
| std::expected< std::string, std::string > | roboctrl::config::read_text_file (const std::filesystem::path &path) |
| 读取整个文本文件。 | |
| configuration_result | roboctrl::config::load_configuration (const std::filesystem::path &path) |
| 从 YAML 或 JSON 文件加载并校验运行时配置。 | |
| std::filesystem::path | roboctrl::config::default_configuration_path () |
获取未指定 --config 时使用的默认配置路径。 | |
| void | roboctrl::config::print_available_configurations (std::ostream &output, const std::filesystem::path &directory) |
| 将指定目录下的 YAML/JSON 配置按名称排序后打印到输出流。 | |
| using roboctrl::config::configuration_result = typedef std::expected<runtime_config, std::string> |
在文件 runtime.hpp 第 80 行定义.
|
inline |
获取未指定 --config 时使用的默认配置路径。
configs/infantry.yaml(默认配置;其他车型通过 --config 选择)。 在文件 runtime.hpp 第 270 行定义.
引用了 roboctrl::config::default_configuration_path() , 以及 roboctrl::config::default_profile.
|
inline |
从 YAML 或 JSON 文件加载并校验运行时配置。
| path | 配置文件路径;扩展名必须为 .yaml、<tt>.yml 或 .json。 |
std::unexpected。 在文件 runtime.hpp 第 240 行定义.
引用了 roboctrl::config::load_configuration(), roboctrl::config::read_text_file() , 以及 roboctrl::config::validate_runtime_configuration().
|
inline |
将指定目录下的 YAML/JSON 配置按名称排序后打印到输出流。
| output | 输出流。 |
| directory | 要枚举的配置目录。 |
在文件 runtime.hpp 第 280 行定义.
引用了 roboctrl::config::print_available_configurations() , 以及 roboctrl::config::read_text_file().
|
inline |
读取整个文本文件。
| path | 文件路径。 |
std::unexpected。 在文件 runtime.hpp 第 223 行定义.
引用了 roboctrl::config::read_text_file().
被这些函数引用 roboctrl::config::load_configuration(), roboctrl::config::print_available_configurations() , 以及 roboctrl::config::read_text_file().
|
inline |
校验已解析的运行时配置。
| config | 待校验的配置对象;成功时按值返回,便于继续移动到初始化阶段。 |
std::unexpected。 在文件 runtime.hpp 第 189 行定义.
引用了 roboctrl::ctrl::robot::info_type::chassis_type, roboctrl::ctrl::robot::info_type::gimbal_type, roboctrl::config::validate_runtime_configuration() , 以及 roboctrl::config::validate_runtime_extensions().
被这些函数引用 roboctrl::config::load_configuration() , 以及 roboctrl::config::validate_runtime_configuration().
|
inline |
Check optional application links and policies before opening any IO resource.
在文件 runtime.hpp 第 83 行定义.
引用了 roboctrl::io::can::info_type::name , 以及 roboctrl::config::validate_runtime_extensions().
被这些函数引用 roboctrl::config::validate_runtime_configuration() , 以及 roboctrl::config::validate_runtime_extensions().