| 172 | } |
| 173 | |
| 174 | double Astar::pathLength(const vector<Eigen::Vector3d>& path) { |
| 175 | double length = 0.0; |
| 176 | if (path.size() < 2) return length; |
| 177 | for (int i = 0; i < path.size() - 1; ++i) length += (path[i + 1] - path[i]).norm(); |
| 178 | return length; |
| 179 | } |
| 180 | |
| 181 | void Astar::backtrack(const NodePtr& end_node, const Eigen::Vector3d& end) { |
| 182 | path_nodes_.push_back(end); |
no test coverage detected