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

kitech/path-tracking-asw Private

[참조 MVP] 작업경로 추종 A-SW — 현재 자세와 경로에서 Pure Pursuit 방식의 조향 명령을 계산합니다.

https://git.agrithing.ai/kitech/path-tracking-asw.git
6 commits
1 items · main
·/ src/component.cpp
text · 508 B · efb1c97 Download
#include "component.hpp"#include <algorithm>#include <cmath>#include <stdexcept>namespace asw {TrackingCommand pure_pursuit(double target_x, double target_y, double heading_rad, double lookahead_m, double wheelbase_m) {  if (lookahead_m <= 0 || wheelbase_m <= 0) throw std::invalid_argument("positive geometry required");  const double alpha = std::atan2(target_y, target_x) - heading_rad;  return {std::atan2(2 * wheelbase_m * std::sin(alpha), std::max(lookahead_m, 0.01)), std::abs(target_y)};}}