初始提交:龙芯2K0300智能车卖家Demo完整代码

This commit is contained in:
spdis
2026-05-28 15:24:33 +08:00
commit b6b631cef3
80 changed files with 7153 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
#include "global.h"
double target_speed;
// 从文件读取双精度值
double readDoubleFromFile(const std::string &filename)
{
std::ifstream file(filename);
double value = 0.0;
if (file.is_open())
{
file >> value; // 读取文件中的值
file.close();
}
else
{
std::cerr << "Failed to open " << filename << std::endl;
}
return value;
}
// 从文件中读取标志
bool readFlag(const std::string &filename)
{
std::ifstream file(filename);
int flag = 0;
if (file.is_open())
{
file >> flag; // 读取文件中的更新标志
file.close();
}
else
{
std::cerr << "Failed to open " << filename << std::endl;
}
return flag;
}