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

kitech/speed-control-asw Private

[참조 MVP] 작업 속도 제어 A-SW — 곡률, 작업 종류와 장애물 거리를 이용해 안전 목표 속도를 산정합니다.

https://git.agrithing.ai/kitech/speed-control-asw.git
6 commits
1 items · main
·/ src/component.cpp
text · 598 B · 218b148 Download
#include "component.hpp"#include <algorithm>#include <cmath>#include <stdexcept>namespace asw {SpeedCommand target_speed(double maximum, double curvature, double mode_factor, double obstacle_distance_m) {  if (maximum <= 0 || mode_factor <= 0) throw std::invalid_argument("positive limits required");  double target = maximum * mode_factor / (1 + 3.5 * std::abs(curvature)); bool limited = false;  if (obstacle_distance_m < 2) { target = 0; limited = true; }  else if (obstacle_distance_m < 5) { target = std::min(target, maximum * 0.25); limited = true; }  return {target, limited};}}