Skip to main content

GetRobotList

原型

using NamePath = std::pair<std::string, std::filesystem::path>;
std::optional<std::vector<NamePath>> GetRobotList(const std::string& brand);

功能

根据指定的机器人品牌获取可用的机器人型号列表及其配置文件路径。

参数

返回值

  • 成功时:返回包含机器人型号列表的 std::optional,每个元素为 NamePath 类型(即 std::pair<std::string, std::filesystem::path>)。
  • 失败时:返回 std::nullopt

示例

auto robotList = mpl::GetRobotList("abb");
if (robotList.has_value()) {
for (const auto& [name, path] : robotList.value()) {
std::cout << "Name: " << name
<< ", Path: " << path.string() << std::endl;
}
} else {
std::cout << "Failed to get robot list or no robots found." << std::endl;
}