30 lines
1.1 KiB
C++
30 lines
1.1 KiB
C++
#ifndef VORONOI_ROUTE_PARAMS_IO_H_
|
|
#define VORONOI_ROUTE_PARAMS_IO_H_
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "voronoi_route/params.h"
|
|
|
|
namespace voronoi_route {
|
|
|
|
/**
|
|
* @brief First file named `name` under `dir`, searched recursively — the lookup
|
|
* robot_costmap_2d uses for its layer YAMLs, so "the robot's config dir" means the same
|
|
* thing here. Empty string if not found or `dir` is not a directory.
|
|
*/
|
|
std::string findConfigFile(const std::string& dir, const std::string& name);
|
|
|
|
/**
|
|
* @brief Load `voronoi_route_params.yaml` (root key `voronoi_route`). Missing keys keep defaults;
|
|
* every missing key is listed in `notes` so a typo does not silently become a default.
|
|
* Out-of-range values are clamped by validateRouteParams(), also reported in `notes`.
|
|
* @return false only when the file cannot be read or parsed at all.
|
|
*/
|
|
bool loadRouteParams(const std::string& yaml_path, RouteParams* params, std::string* err,
|
|
std::vector<std::string>* notes);
|
|
|
|
} // namespace voronoi_route
|
|
|
|
#endif // VORONOI_ROUTE_PARAMS_IO_H_
|