
1、函数[std::vector<std::vector<float> > parseVVF(const std::string& input, std::string& error_return)]
功能:输入字符串数组的数组,输出vector容器储存的浮点数
如输入字符串[[1.0, 2.0], [3.3, 4.4, 5.5], ...]
输出vector<vector<1.0,2.0>,vector<3.3,4.4,5.5>>
如果输入多于两层则error_return错误的信息。
本文介绍costmap_2d库中array_parser.cpp的parseVVF函数,用于将输入的多层次字符串数组转换为vector容器的浮点数矩阵,如[[1.0,2.0],[3.3,4.4,5.5]]的处理。错误处理包括检查输入是否超过两层。

1、函数[std::vector<std::vector<float> > parseVVF(const std::string& input, std::string& error_return)]
功能:输入字符串数组的数组,输出vector容器储存的浮点数
如输入字符串[[1.0, 2.0], [3.3, 4.4, 5.5], ...]
输出vector<vector<1.0,2.0>,vector<3.3,4.4,5.5>>
如果输入多于两层则error_return错误的信息。
1723
2461
2881
1106

被折叠的 条评论
为什么被折叠?