清理编码器+死代码+可读性整理: 删除ENCODER类(含UB析构), MotorController简化为PWM+GPIO裸控制器, 移除mortor_kp/ki/kd全局变量, 排除vl53l0x/zebra_detect死代码, 修复image_cv行列写反, 清理无关include
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
+11
-13
@@ -24,31 +24,29 @@ int main(void)
|
||||
double dest_fps = readDoubleFromFile(destfps_file);
|
||||
if (dest_fps <= 0) dest_fps = 30.0;
|
||||
|
||||
cfg_load_all();
|
||||
|
||||
if (CameraInit(0, dest_fps, 320, 240) < 0) {
|
||||
std::cerr << "CameraInit failed" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
ControlInit();
|
||||
std::cout << "All services started (single-thread mode)" << std::endl;
|
||||
std::cout << "All services started" << std::endl;
|
||||
|
||||
int tick = 0;
|
||||
while (running.load())
|
||||
{
|
||||
if (CameraHandler() < 0) {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(5));
|
||||
continue;
|
||||
CameraHandler();
|
||||
|
||||
if (++tick % 7 == 0) {
|
||||
g_cfg.debug = readFlag(debug_file);
|
||||
}
|
||||
|
||||
if (++tick % 15 == 0)
|
||||
{
|
||||
target_speed = readDoubleFromFile(speed_file);
|
||||
mortor_kp = readDoubleFromFile(mortor_kp_file);
|
||||
mortor_ki = readDoubleFromFile(mortor_ki_file);
|
||||
mortor_kd = readDoubleFromFile(mortor_kd_file);
|
||||
kp = readDoubleFromFile(kp_file);
|
||||
ki = readDoubleFromFile(ki_file);
|
||||
kd = readDoubleFromFile(kd_file);
|
||||
if (g_cfg.debug) {
|
||||
cfg_load_all();
|
||||
}
|
||||
|
||||
target_speed = g_cfg.speed;
|
||||
}
|
||||
|
||||
std::cout << "Stopping..." << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user