A-SW Hub / Repositories
Local Gitea · READ ONLY
← 저장소 Repositories
REPOSITORY

kitech/path-generation-asw Private

[참조 MVP] 작업경로 생성 A-SW — 직사각형 농경지와 작업 폭으로 왕복형 커버리지 경로를 생성합니다.

https://git.agrithing.ai/kitech/path-generation-asw.git
6 commits
1 items · main
·/ src/component.cpp
text · 636 B · 5e9cac8 Download
#include "component.hpp"#include <stdexcept>namespace asw {std::vector<Point> generate_path(double width, double height, double spacing, double headland) {  if (width <= 0 || height <= 0 || spacing <= 0 || headland < 0 || headland * 2 >= width || headland * 2 >= height) throw std::invalid_argument("invalid field geometry");  std::vector<Point> points; bool forward = true;  for (double y = headland; y <= height - headland + 1e-9; y += spacing) {    points.push_back({forward ? headland : width - headland, y});    points.push_back({forward ? width - headland : headland, y});    forward = !forward;  }  return points;}}