惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
Cisco Talos Blog
Cisco Talos Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
V
V2EX
博客园 - 三生石上(FineUI控件)
Martin Fowler
Martin Fowler
WordPress大学
WordPress大学
D
Docker
S
SegmentFault 最新的问题
博客园 - 聂微东
美团技术团队
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
M
MIT News - Artificial intelligence
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The GitHub Blog
The GitHub Blog
GbyAI
GbyAI
L
LangChain Blog
Vercel News
Vercel News
博客园 - 叶小钗
MongoDB | Blog
MongoDB | Blog
Stack Overflow Blog
Stack Overflow Blog
H
Help Net Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Cloudflare Blog
Engineering at Meta
Engineering at Meta
T
Threat Research - Cisco Blogs
T
Threatpost
Scott Helme
Scott Helme
T
Tailwind CSS Blog
Latest news
Latest news
Stack Overflow Blog
Stack Overflow Blog
Blog — PlanetScale
Blog — PlanetScale
The Register - Security
The Register - Security
罗磊的独立博客
P
Proofpoint News Feed
腾讯CDC
S
Schneier on Security
雷峰网
雷峰网
A
About on SuperTechFans
T
Tenable Blog
F
Full Disclosure
Cyberwarzone
Cyberwarzone
博客园_首页
有赞技术团队
有赞技术团队
K
Kaspersky official blog

文章列表

不改一行插件代码,实现消息优先级与阻断 洛玖定时任务系统 在 butterfly 主题中添加首页点集动画(基于p2line项目) 你好,2026 stm32f4xx-ads1256驱动 stm32f4xx-ad9854并行驱动 主动式网站状态监测实现及其应用 右键菜单加入用Trae打开文件和文件夹 三角洲行动ID映射表 洛玖SDK说明 为网页文章开头添加原文连接 Hexo-Butterfly主题在主页添加GitHub贡献日历 Proteus中555定时器仿真问题 装饰器 洛玖开发日记 STS3032舵机获取力矩输出 kotlin网页前后端那些事 mspm0g3507-ad9850 Paddle模型转PaddleLite 人工智能考核 构建一个yolov3网络 yolo和paddle模型常见输出参数 PaddleDetection 随便写的一些东西
奇怪的bug
洛屿 · 2024-08-14 · via
#pragma once
#include "../src/main.h"
#include "json.hpp"
#include <cmath>
#include <fstream>
#include <iostream>

using namespace std;

class ValueConfig {
private:

public:
struct Params {
// 丢线场计数
int out_count = 10;

// 短直道场计数
int short_count = 3;

// 急减速场计数
int slow_count = 30;

// 加速场计数
int fast_count = 30;

// speed_debug = true时,所有速度均为speed_normal设置的速度
bool speed_debug = false;
// 速度
int speed_bridge = 20;
int speed_danger = 10;
int speed_parking = 10;
int speed_racing = 20;
int speed_rescue = 10;

int speed_normal = 38;
int speed_fast = 38;
int speed_slow = 30;
int speed_slowest = speed_slow - 15;
int speed_add = 40;

// 圆环速度
int speed_circle_begin = 26;
int speed_circle_min = 25;

int speed_circle_runningl_s = speed_circle_min;
int speed_circle_runningl_m = speed_circle_min + 2;
int speed_circle_runningl_l = speed_circle_min + 4;

int speed_circle_runningr_s = speed_circle_min;
int speed_circle_runningr_m = speed_circle_min + 2;
int speed_circle_runningr_l = speed_circle_min + 4;

// 偏差速度控制值abs(4500 - midAdd) > BIAS_SPEED_LIMIT后进入慢速控制
int bias_speed_limit = 150;

// 逆透视半径计算瞄点
int LR_num1 = 8;
int LR_num2 = 16;
int LR_num3 = 24;

int RR_num1 = 8;
int RR_num2 = 16;
int RR_num3 = 24;

int LR_F_num1 = 24;
int LR_F_num2 = 34;
int LR_F_num3 = 44;

int RR_F_num1 = 24;
int RR_F_num2 = 34;
int RR_F_num3 = 44;

double aim_distance = 0.62;
double servo_pid_P1 = 1.7; // 一阶比例系数:直线控制量
double servo_pid_P2 = 0.1; // 二阶比例系数:弯道控制量
double servo_pid_f = 0.1; // 前馈系数
double servo_pid_D = 0; // 一阶比例系数:转弯控制量
double servo_pid_k1 = 2.25;
double servo_pid_k2 = 1.34;
double servo_pid_k3 = 3;

bool ai_debug = false; // AI图像显示使能
bool bi_debug = false; // 二值化图像显示使能
bool track_debug = false; // 赛道线图像显示使能
bool nts_debug = false; // 逆透视图像显示使能
bool saveImage = false; // 存图使能
float disGarageEntry = 0.7; // 车库入库距离(斑马线Image占比)

float cone_score = 0.6;
float bomb_score = 0.6;
float block_score = 0.6;
float bridge_score = 0.6;
float crosswalk_score = 0.6;
float people_score = 0.6;
float car_score = 0.75;

char BLOCK_POI = 'L'; // 黑块位置(L / l 左 , R / r 右)

float L_MID_L = 154;
float L_MID_R = 179;
float L_BLOCK_MID_L = 158;
float L_BLOCK_MID_R = 166;
int L_BOMB_Y_TOP = 15; // 爆炸物录入起始行
int L_CONE_Y_TOP = 67; // 锥桶录入起始行
int L_CONE_Y_DOWN = 207; // 锥桶录入终止行

float R_MID_L = 150;
float R_MID_R = 170.1;
float R_BLOCK_MID_L = 158;
float R_BLOCK_MID_R = 166;
int R_BOMB_Y_TOP = 15; // 爆炸物录入起始行
int R_CONE_Y_TOP = 67; // 锥桶录入起始行
int R_CONE_Y_DOWN = 207; // 锥桶录入终止行

bool it_AI = true; // AI区域使能
bool it_RESCUE = true; // 救援区使能
bool it_RACING = true; // 追逐区使能
bool it_DANGER = true; // 危险区使能
bool it_BRIDGE = true; // 桥使能

NLOHMANN_DEFINE_TYPE_INTRUSIVE(
Params,
out_count, short_count, slow_count,fast_count,
speed_debug,
speed_bridge, speed_danger, speed_parking, speed_racing, speed_rescue,
speed_normal, speed_fast, speed_slow, speed_slowest, speed_add,
speed_circle_begin, speed_circle_min,
speed_circle_runningl_s, speed_circle_runningl_m, speed_circle_runningl_l,
speed_circle_runningr_s, speed_circle_runningr_m, speed_circle_runningr_l,
bias_speed_limit,
aim_distance,
servo_pid_P1, servo_pid_P2, servo_pid_f, servo_pid_D, //servo_pid_k1, servo_pid_k2, servo_pid_k3,
ai_debug, bi_debug, track_debug, nts_debug, saveImage,
disGarageEntry,
cone_score,bomb_score,block_score,bridge_score,crosswalk_score,people_score,car_score,
BLOCK_POI,
L_MID_L, L_MID_R, L_BLOCK_MID_L, L_BLOCK_MID_R, L_BOMB_Y_TOP, L_CONE_Y_TOP, L_CONE_Y_DOWN,
R_MID_L, R_MID_R, R_BLOCK_MID_L, R_BLOCK_MID_R, R_BOMB_Y_TOP, R_CONE_Y_TOP, R_CONE_Y_DOWN,
it_AI, it_RESCUE, it_RACING, it_DANGER, it_BRIDGE); // 添加构造函数
};

Params params; // 读取控制参数
/**
* @brief 加载配置参数Json
*/
ValueConfig() {
string jsonPath = "../src/config/value_config.json";
std::ifstream config_is(jsonPath);
if (!config_is.good()) {
std::cout << "Error: Params file path:[" << jsonPath << "] not find .\n";
exit(-1);
}

nlohmann::json js_value;
config_is >> js_value;

try {
params = js_value.get<Params>();
} catch (const nlohmann::detail::exception &e) {
std::cerr << "Json Params Parse failed :" << e.what() << '\n';
exit(-1);
}
cout <<"--- out_count: " << params.out_count << endl
<< " | short_count: " << params.short_count << endl
<< " | slow_count: " << params.slow_count << endl;
cout <<"--- speed_debug: " << (params.speed_debug ? "true" : "false") << endl;
cout <<"--- speed_normal: " << params.speed_normal << endl;

printf("cone_score : %.2f\t", params.cone_score);
printf("bomb_score : %.2f\t", params.bomb_score);
printf("block_score : %.2f\t", params.block_score);
printf("bridge_score : %.2f\t", params.bridge_score);
printf("crosswalk_score : %.2f\n", params.crosswalk_score);
printf("rescue_score : %.2f\n", params.people_score);
printf("car_score : %.2f\n", params.car_score);
}
};