diff --git a/Client/plugins/sim/configwidget.cpp b/Client/plugins/sim/configwidget.cpp index 3247a37..0863b4d 100644 --- a/Client/plugins/sim/configwidget.cpp +++ b/Client/plugins/sim/configwidget.cpp @@ -16,26 +16,26 @@ namespace{ #define ADD_VALUE(parent,type,name,defaultvalue,namestring) \ ppm->loadParam(v_##name,#parent"/"#name,defaultvalue); -#define ADD_CLIENT_VALUE(parent, type, name, defaultvalue, namestring) \ - zpm->loadParam(v_##name, #parent "/" #name, defaultvalue); +#define ADD_CLIENT_VALUE(parent, type, name, defaultvalue, namestring, ratio) \ + v_##name = zpm->value(#parent "/" #namestring, QVariant(ratio * defaultvalue)).to##type() / ratio; ConfigWidget::ConfigWidget() { ADD_VALUE(game_vars,Int,Robots_Count, 16, "Robots Count") ADD_VALUE(field_vars,Double,Field_Line_Width,0.020,"Line Thickness") - ADD_VALUE(field_vars,Double,Field_Length,9.000,"Length") - ADD_VALUE(field_vars,Double,Field_Width,6.000,"Width") + ADD_CLIENT_VALUE(field,Double,Field_Length,9.000,width, 1000.0) + ADD_CLIENT_VALUE(field,Double,Field_Width,6.000,height, 1000.0) ADD_VALUE(field_vars,Double,Field_Rad,0.500,"Radius") ADD_VALUE(field_vars,Double,Field_Free_Kick,0.700,"Free Kick Distanse From Defense Area") - ADD_VALUE(field_vars,Double,Field_Penalty_Width,2.0,"Penalty width") - ADD_VALUE(field_vars,Double,Field_Penalty_Depth,1.0,"Penalty depth") + ADD_CLIENT_VALUE(field,Double,Field_Penalty_Width,2.0,penaltyLength, 1000.0) + ADD_CLIENT_VALUE(field,Double,Field_Penalty_Depth,1.0,penaltyWidth, 1000.0) ADD_VALUE(field_vars,Double,Field_Penalty_Point,1.0,"Penalty point") ADD_VALUE(field_vars,Double,Field_Margin,0.4,"Margin") ADD_VALUE(field_vars,Double,Field_Referee_Margin,0.0,"Referee margin") ADD_VALUE(field_vars,Double,Wall_Thickness,0.050,"Wall thickness") ADD_VALUE(field_vars,Double,Goal_Thickness,0.020,"Goal thickness") - ADD_VALUE(field_vars,Double,Goal_Depth,0.200,"Goal depth") - ADD_VALUE(field_vars,Double,Goal_Width,1.000,"Goal width") + ADD_CLIENT_VALUE(field,Double,Goal_Depth,0.200,goalDepth, 1000.0) + ADD_CLIENT_VALUE(field,Double,Goal_Width,1.000,goalWidth, 1000.0) ADD_VALUE(field_vars,Double,Goal_Height,0.160,"Goal height") ADD_VALUE(field_vars,Double,overlap,0.20,"Camera Overlap") diff --git a/Core/src/Strategy/skill/SmartGotoPosition.cpp b/Core/src/Strategy/skill/SmartGotoPosition.cpp index 0a13387..986bf88 100644 --- a/Core/src/Strategy/skill/SmartGotoPosition.cpp +++ b/Core/src/Strategy/skill/SmartGotoPosition.cpp @@ -66,7 +66,6 @@ namespace{ CGeoPoint lastFinalPoint[PARAM::Field::MAX_PLAYER]; CGeoPoint veryStart[PARAM::Field::MAX_PLAYER]; bool isExecuting[PARAM::Field::MAX_PLAYER]; - const double Fake_PENALTY_AREA_R = 150; // added by ftq const double TEAMMATE_AVOID_DIST = PARAM::Vehicle::V2::PLAYER_SIZE + 40.0f; // 2014/03/13 修改,为了减少stop的时候卡住的概率 yys const double OPP_AVOID_DIST = PARAM::Vehicle::V2::PLAYER_SIZE + 55.0f; const double BALL_AVOID_DIST = PARAM::Field::BALL_SIZE + 50.0f; diff --git a/Core/src/Utils/utils.cpp b/Core/src/Utils/utils.cpp index 5df9474..2755d78 100644 --- a/Core/src/Utils/utils.cpp +++ b/Core/src/Utils/utils.cpp @@ -330,301 +330,89 @@ namespace Utils{ return (pInter + Polar2Vector(delta, dir)); } - // GetDefendPos的处理细节 - // 给定点和方向求它和禁区线的交点 - //给定点需在禁区内 - //modified by Wang in 2018/3/17 CGeoPoint GetInterPos(double dir, const CGeoPoint targetPoint) { using namespace PARAM::Field; - if ( IF_USE_ELLIPSE ){ - // ellipse penalty - // 禁区的两段圆弧,用圆来表示 - CGeoCirlce c1(CGeoPoint(-PITCH_LENGTH/2, PENALTY_AREA_L/2), PENALTY_AREA_R); - CGeoCirlce c2(CGeoPoint(-PITCH_LENGTH/2, -PENALTY_AREA_L/2), PENALTY_AREA_R); - CGeoPoint targetPointInstead = targetPoint; - if (dir >= PARAM::Math::PI/2 - 5/180*PARAM::Math::PI && dir <= PARAM::Math::PI) - return CGeoPoint(-PITCH_LENGTH/2,PENALTY_AREA_L/2+PENALTY_AREA_R); - else if (dir <= -PARAM::Math::PI/2 + 5/180*PARAM::Math::PI && dir >= -PARAM::Math::PI) - return CGeoPoint(-PITCH_LENGTH/2,-PENALTY_AREA_L/2-PENALTY_AREA_R); - - // 连接两段圆弧的直线(pLine),用直线来表示 - CGeoPoint pend1(-PITCH_LENGTH/2+PENALTY_AREA_R, PENALTY_AREA_L/2); - CGeoPoint pend2(-PITCH_LENGTH/2+PENALTY_AREA_R, -PENALTY_AREA_L/2); - CGeoLine pLine(pend1, pend2); - // 过给定的点和方向, 作一条直线 - CGeoLine dirLine(targetPointInstead, dir); - - // 求该直线和c1的交点 - if (targetPoint.y() == c1.Center().y()) - { - if (dir>=0 && dir=0 && dir1<=PARAM::Math::PI/2) - { - return p1; - - } - else if (dir2>=0 && dir2<=PARAM::Math::PI/2) - { - return p2; - - } - } - } - - // 求该直线和c2的交点 - if (targetPoint.y() == c2.Center().y()) - { - if ( dir<=0 && dir>(-PARAM::Math::PI/2)) - { - CGeoPoint p = c2.Center()+Polar2Vector(PENALTY_AREA_R,dir); - return p; - } - } - else{ - CGeoLineCircleIntersection dirLine_c2_inter(dirLine, c2); - if (dirLine_c2_inter.intersectant()) - { - CGeoPoint p1 = dirLine_c2_inter.point1(); - CGeoPoint p2 = dirLine_c2_inter.point2(); - double dir1 = Normalize((p1-c2.Center()).dir()); - double dir2 = Normalize((p2-c2.Center()).dir()); - if (dir1>=(-PARAM::Math::PI/2) && dir1<=0) - { - return p1; - - } - else if (dir2>=(-PARAM::Math::PI/2) && dir2<=0) - { - return p2; - - } - } - } - // 求该直线和连接两条圆弧的线段pLine的交点 - CGeoLineLineIntersection pline_dirline_inter(pLine, dirLine); - if (pline_dirline_inter.Intersectant()) - { - CGeoPoint p = pline_dirline_inter.IntersectPoint(); - if (p.y() <= pend1.y() && p.y() >= pend2.y()) - { - return p; - - } - } - //// 返回一个默认点,禁区顶部的中点 -// std::cout<<"our default pos!!"<gui_debug_x(inter_p1, 3);//黄 + CGeoPoint inter_p2 = inter2.IntersectPoint(); + GDebugEngine::Instance()->gui_debug_x(inter_p2, 4);//绿 + CGeoPoint inter_p3 = inter3.IntersectPoint(); + GDebugEngine::Instance()->gui_debug_x(inter_p3, 9);//黑 + CGeoPoint returnPoint = targetPoint;//返回值 + + //if (targetPoint.x() >= -PITCH_LENGTH / 2 + PENALTY_AREA_DEPTH) { + if (targetPoint.y() <= 0) {//case 1 + if (InOurPenaltyArea(inter_p1, 10)) returnPoint = inter_p1; + else returnPoint = inter_p2; } - else { - // rectangle penalty - CGeoPoint p1(-PITCH_LENGTH / 2, -PENALTY_AREA_WIDTH / 2);//禁区左下 - CGeoPoint p2(-PITCH_LENGTH / 2 + PENALTY_AREA_DEPTH, -PENALTY_AREA_WIDTH / 2);//禁区左上 - CGeoPoint p3(-PITCH_LENGTH / 2 + PENALTY_AREA_DEPTH, PENALTY_AREA_WIDTH / 2);//禁区右上 - CGeoPoint p4(-PITCH_LENGTH / 2, PENALTY_AREA_WIDTH / 2);//禁区右下 - CGeoLine line1(p1, p2);//禁区左边线 - CGeoLine line2(p2, p3);//禁区前边线 - CGeoLine line3(p3, p4);//禁区右边线 - CGeoLine dirLine(targetPoint, dir); - - CGeoLineLineIntersection inter1(line1, dirLine); - CGeoLineLineIntersection inter2(line2, dirLine); - CGeoLineLineIntersection inter3(line3, dirLine); - - CGeoPoint inter_p1 = inter1.IntersectPoint(); - GDebugEngine::Instance()->gui_debug_x(inter_p1, 3);//黄 - CGeoPoint inter_p2 = inter2.IntersectPoint(); - GDebugEngine::Instance()->gui_debug_x(inter_p2, 4);//绿 - CGeoPoint inter_p3 = inter3.IntersectPoint(); - GDebugEngine::Instance()->gui_debug_x(inter_p3, 9);//黑 - CGeoPoint returnPoint = targetPoint;//返回值 - - //if (targetPoint.x() >= -PITCH_LENGTH / 2 + PENALTY_AREA_DEPTH) { - if (targetPoint.y() <= 0) {//case 1 - if (InOurPenaltyArea(inter_p1, 10)) returnPoint = inter_p1; - else returnPoint = inter_p2; - } - else {//case 2 - if (InOurPenaltyArea(inter_p3, 10)) returnPoint = inter_p3; - else returnPoint = inter_p2;//随便选的 - } - GDebugEngine::Instance()->gui_debug_x(returnPoint, 0); - CGeoPoint p0(-PITCH_LENGTH / 2, 0); - GDebugEngine::Instance()->gui_debug_line(returnPoint, p0, 0); - return returnPoint; + else {//case 2 + if (InOurPenaltyArea(inter_p3, 10)) returnPoint = inter_p3; + else returnPoint = inter_p2;//随便选的 } - //} - /* - else if (std::fabs(targetPoint.y()) <= PENALTY_AREA_WIDTH / 2) {//case 3 - if (InOurPenaltyArea(inter_p2, 0)) return inter_p2; - else return p2;//随便选的 - } - else { - if (targetPoint.y() <= 0) {//case 4 - if (InOurPenaltyArea(inter_p1, 0)) return inter_p1; - else if (InOurPenaltyArea(inter_p2, 0)) return inter_p2; - else return p2;//随便选的 - } - else {//case 5 - if (InOurPenaltyArea(inter_p2, 0)) return inter_p2; - else if (InOurPenaltyArea(inter_p3, 0)) return inter_p3; - else return p3;//随便选的 - } - } - */ + GDebugEngine::Instance()->gui_debug_x(returnPoint, 0); + CGeoPoint p0(-PITCH_LENGTH / 2, 0); + GDebugEngine::Instance()->gui_debug_line(returnPoint, p0, 0); + return returnPoint; } - //modified by Wang in 2018/3/17 CGeoPoint GetTheirInterPos(double dir, const CGeoPoint& targetPoint) { using namespace PARAM::Field; - if ( IF_USE_ELLIPSE ){ - // ellipse penalty - // 禁区的两段圆弧,用圆来表示 - CGeoCirlce c1(CGeoPoint(-PITCH_LENGTH/2, PENALTY_AREA_L/2), PENALTY_AREA_R); - CGeoCirlce c2(CGeoPoint(-PITCH_LENGTH/2, -PENALTY_AREA_L/2), PENALTY_AREA_R); - CGeoPoint targetPointInstead = targetPoint; - if (dir >= PARAM::Math::PI/2 - 5/180*PARAM::Math::PI && dir <= PARAM::Math::PI) - return CGeoPoint(-PITCH_LENGTH/2,PENALTY_AREA_L/2+PENALTY_AREA_R); - else if (dir <= -PARAM::Math::PI/2 + 5/180*PARAM::Math::PI && dir >= -PARAM::Math::PI) - return CGeoPoint(-PITCH_LENGTH/2,-PENALTY_AREA_L/2-PENALTY_AREA_R); - - // 连接两段圆弧的直线(pLine),用直线来表示 - CGeoPoint pend1(-PITCH_LENGTH/2+PENALTY_AREA_R, PENALTY_AREA_L/2); - CGeoPoint pend2(-PITCH_LENGTH/2+PENALTY_AREA_R, -PENALTY_AREA_L/2); - CGeoLine pLine(pend1, pend2); - // 过给定的点和方向, 作一条直线 - CGeoLine dirLine(targetPointInstead, dir); - - // 求该直线和c1的交点 - if (targetPoint.y() == c1.Center().y()) - { - if (dir>=0 && dir=0 && dir1<=PARAM::Math::PI/2) - { - return p1; - - } - else if (dir2>=0 && dir2<=PARAM::Math::PI/2) - { - return p2; - - } - } - } - - // 求该直线和c2的交点 - if (targetPoint.y() == c2.Center().y()) - { - if ( dir<=0 && dir>(-PARAM::Math::PI/2)) - { - CGeoPoint p = c2.Center()+Polar2Vector(PENALTY_AREA_R,dir); - return p; - } - } - else{ - CGeoLineCircleIntersection dirLine_c2_inter(dirLine, c2); - if (dirLine_c2_inter.intersectant()) - { - CGeoPoint p1 = dirLine_c2_inter.point1(); - CGeoPoint p2 = dirLine_c2_inter.point2(); - double dir1 = Normalize((p1-c2.Center()).dir()); - double dir2 = Normalize((p2-c2.Center()).dir()); - if (dir1>=(-PARAM::Math::PI/2) && dir1<=0) - { - return p1; - - } - else if (dir2>=(-PARAM::Math::PI/2) && dir2<=0) - { - return p2; - - } - } + // rectangle penalty + CGeoPoint p1(PITCH_LENGTH / 2, -PENALTY_AREA_WIDTH / 2);//禁区左上 + CGeoPoint p2(PITCH_LENGTH / 2 - PENALTY_AREA_DEPTH, -PENALTY_AREA_WIDTH / 2);//禁区左下 + CGeoPoint p3(PITCH_LENGTH / 2 - PENALTY_AREA_DEPTH, PENALTY_AREA_WIDTH / 2);//禁区右下 + CGeoPoint p4(PITCH_LENGTH / 2, PENALTY_AREA_WIDTH / 2);//禁区右上 + CGeoLine line1(p1, p2);//禁区左边线 + CGeoLine line2(p2, p3);//禁区下边线 + CGeoLine line3(p3, p4);//禁区右边线 + CGeoLine dirLine(targetPoint, dir); + + CGeoLineLineIntersection inter1(line1, dirLine); + CGeoLineLineIntersection inter2(line2, dirLine); + CGeoLineLineIntersection inter3(line3, dirLine); + + CGeoPoint inter_p1 = inter1.IntersectPoint(); + CGeoPoint inter_p2 = inter2.IntersectPoint(); + CGeoPoint inter_p3 = inter3.IntersectPoint(); + CGeoPoint returnPoint = targetPoint;//返回值 + + if (targetPoint.x() >= PITCH_LENGTH / 2 - PENALTY_AREA_DEPTH) { + if (targetPoint.y() <= 0) {//case 1 + if (InOurPenaltyArea(inter_p1, 0)) return inter_p1; + else return p2;//随便选的 } - // 求该直线和连接两条圆弧的线段pLine的交点 - CGeoLineLineIntersection pline_dirline_inter(pLine, dirLine); - if (pline_dirline_inter.Intersectant()) - { - CGeoPoint p = pline_dirline_inter.IntersectPoint(); - if (p.y() <= pend1.y() && p.y() >= pend2.y()) - { - return p; - - } + else {//case 2 + if (InOurPenaltyArea(inter_p3, 0)) return inter_p3; + else return p3;//随便选的 } - //// 返回一个默认点,禁区顶部的中点 -// std::cout<<"our default pos!!"<= PITCH_LENGTH / 2 - PENALTY_AREA_DEPTH) { - if (targetPoint.y() <= 0) {//case 1 - if (InOurPenaltyArea(inter_p1, 0)) return inter_p1; - else return p2;//随便选的 - } - else {//case 2 - if (InOurPenaltyArea(inter_p3, 0)) return inter_p3; - else return p3;//随便选的 - } - } - else if (std::fabs(targetPoint.y()) <= PENALTY_AREA_WIDTH / 2) {//case 3 - if (InOurPenaltyArea(inter_p2, 0)) return inter_p2; + else if (std::fabs(targetPoint.y()) <= PENALTY_AREA_WIDTH / 2) {//case 3 + if (InOurPenaltyArea(inter_p2, 0)) return inter_p2; + else return p2;//随便选的 + } + else { + if (targetPoint.y() <= 0) {//case 4 + if (InOurPenaltyArea(inter_p1, 0)) return inter_p1; + else if (InOurPenaltyArea(inter_p2, 0)) return inter_p2; else return p2;//随便选的 } - else { - if (targetPoint.y() <= 0) {//case 4 - if (InOurPenaltyArea(inter_p1, 0)) return inter_p1; - else if (InOurPenaltyArea(inter_p2, 0)) return inter_p2; - else return p2;//随便选的 - } - else {//case 5 - if (InOurPenaltyArea(inter_p2, 0)) return inter_p2; - else if (InOurPenaltyArea(inter_p3, 0)) return inter_p3; - else return p3;//随便选的 - } + else {//case 5 + if (InOurPenaltyArea(inter_p2, 0)) return inter_p2; + else if (InOurPenaltyArea(inter_p3, 0)) return inter_p3; + else return p3;//随便选的 } } } @@ -694,41 +482,6 @@ namespace Utils{ } } } - // 2019, china open, ellipse penalty - else if (PARAM::Rule::Version == 2019 && - PARAM::Field::IF_USE_ELLIPSE) { - CGeoCirlce c1(CGeoPoint(-PARAM::Field::PITCH_LENGTH/2, - PARAM::Field::PENALTY_AREA_L/2), - PARAM::Field::PENALTY_AREA_R + avoidBuffer); - CGeoCirlce c2(CGeoPoint(-PARAM::Field::PITCH_LENGTH/2, - -PARAM::Field::PENALTY_AREA_L/2), - PARAM::Field::PENALTY_AREA_R + avoidBuffer); - CGeoRectangle defenseBox( - -PARAM::Field::PITCH_LENGTH / 2 + - PARAM::Field::PENALTY_AREA_R + - avoidBuffer, - -PARAM::Field::PENALTY_AREA_L / 2, - -PARAM::Field::PITCH_LENGTH / 2, - PARAM::Field::PENALTY_AREA_L/ 2); - CGeoLineCircleIntersection intersection1(moving_seg, c1); - CGeoLineCircleIntersection intersection2(moving_seg, c2); - CGeoLineRectangleIntersection intersection3(moving_seg, - defenseBox); - if (intersection1.intersectant() || - intersection2.intersectant() || - intersection3.intersectant()) { - if (moving_seg.IsPointOnLineOnSegment(intersection1.point1()) || - moving_seg.IsPointOnLineOnSegment(intersection1.point2())|| - moving_seg.IsPointOnLineOnSegment(intersection2.point1())|| - moving_seg.IsPointOnLineOnSegment(intersection2.point2())|| - moving_seg.IsPointOnLineOnSegment(intersection3.point1())|| - moving_seg.IsPointOnLineOnSegment(intersection3.point2())) { - _canGo = false; // 要经过禁区 - return _canGo; - } - } - - } else {// 2018年的规则禁区是矩形 CGeoRectangle defenseBox(-PARAM::Field::PITCH_LENGTH / 2 + PARAM::Field::PENALTY_AREA_DEPTH + avoidBuffer, -PARAM::Field::PENALTY_AREA_WIDTH / 2 - avoidBuffer, -PARAM::Field::PITCH_LENGTH / 2, PARAM::Field::PENALTY_AREA_WIDTH / 2 + avoidBuffer); CGeoLineRectangleIntersection intersection(moving_seg, defenseBox); diff --git a/ZBin/lua_scripts/worldmodel/param.lua b/ZBin/lua_scripts/worldmodel/param.lua index b5c5fb7..c7804ac 100644 --- a/ZBin/lua_scripts/worldmodel/param.lua +++ b/ZBin/lua_scripts/worldmodel/param.lua @@ -18,14 +18,14 @@ module(..., package.seeall) maxPlayer = 16 -pitchLength = 9000 -pitchWidth = 6000 -goalWidth = 1000 -goalDepth = 200 +pitchLength = CGetSettings("field/width","Int") +pitchWidth = CGetSettings("field/height","Int") +goalWidth = CGetSettings("field/goalWidth","Int") +goalDepth = CGetSettings("field/goalDepth","Int") freeKickAvoidBallDist = 500 playerRadius = 90 -penaltyWidth = 2000 -penaltyDepth = 1000 +penaltyWidth = CGetSettings("field/penaltyLength","Int") +penaltyDepth = CGetSettings("field/penaltyWidth","Int") penaltyRadius = 1000 penaltySegment = 500 playerFrontToCenter = 76 diff --git a/share/staticparams.cpp b/share/staticparams.cpp new file mode 100644 index 0000000..62fc37c --- /dev/null +++ b/share/staticparams.cpp @@ -0,0 +1,15 @@ +#include "staticparams.h" +#include "parammanager.h" + +auto zpm = ZSS::ZParamManager::instance(); + +namespace PARAM { +namespace Field { +const double PITCH_LENGTH = zpm->value("field/width",QVariant(9000)).toFloat(); +const double PITCH_WIDTH = zpm->value("field/height",QVariant(6000)).toFloat(); +const double PENALTY_AREA_WIDTH = zpm->value("field/penaltyLength",QVariant(2000)).toFloat(); +const double PENALTY_AREA_DEPTH = zpm->value("field/penaltyWidth",QVariant(1000)).toFloat(); +const double GOAL_WIDTH = zpm->value("field/goalWidth",QVariant(1000)).toFloat(); +const double GOAL_DEPTH = zpm->value("field/goalDepth",QVariant(200)).toFloat(); +} +} \ No newline at end of file diff --git a/share/staticparams.h b/share/staticparams.h index 2b20beb..ce4a0bb 100644 --- a/share/staticparams.h +++ b/share/staticparams.h @@ -12,7 +12,6 @@ namespace PARAM { const int BLUE = 0; const int YELLOW = 1; const int BALLMERGEDISTANCE = 0; - const int ROBOTMERGEDOSTANCE = 100; const int TEAMS = 2; namespace Field{ @@ -26,26 +25,23 @@ namespace PARAM { const double BALL_DECAY = -0.8; // 阻力对球的加速度和速度成正比,单位为 /s /* Player */ const double MAX_PLAYER_SIZE = 180; - const double PITCH_LENGTH = 12000; // 场地长 - const double PITCH_WIDTH = 9000; // 场地宽 + + extern const double PITCH_LENGTH; // 场地长 + extern const double PITCH_WIDTH; // 场地宽 + extern const double PENALTY_AREA_WIDTH; // rectangle禁区宽度 + extern const double PENALTY_AREA_DEPTH; // rectangle禁区深度 + extern const double GOAL_WIDTH; + extern const double GOAL_DEPTH; + const double PITCH_MARGIN = 10; // 边界宽度 const double CENTER_CIRCLE_R = 500; // 中圈半径 const double GOAL_POST_AVOID_LENGTH = 20; //伸进场地内门柱的避障长度 const double GOAL_POST_THICKNESS = 20; //门柱宽度 - const bool IF_USE_ELLIPSE = false; // whether use ellipse penalty - const double PENALTY_AREA_WIDTH = 2400; // rectangle禁区宽度 - const double PENALTY_AREA_DEPTH = 1200; // rectangle禁区深度 - const double PENALTY_AREA_R = 800; // ellipse penalty 两个圆弧 - const double PENALTY_AREA_L = 350; // ellipse penalty 连接两个圆弧的线段 - const double PENALTY_L = 500; //代替PENALTY_AREA_L + const double PENALTY_MARK_X = 4800; // 点球点的X坐标 const double OUTER_PENALTY_AREA_WIDTH = 1950; // 外围禁区宽度(界外开球时不能站在该线内) const double FREE_KICK_AVOID_BALL_DIST = 500; // 开任意球的时候,对方必须离球这么远 - // const double FIELD_WALL_DIST = 20; // 场地护栏到边界的距离 - const double GOAL_WIDTH = 1000; - const double GOAL_DEPTH = 200; - const double RATIO = 1.5; } namespace Rule{ const int Version = 2019; // 规则的版本/年份 @@ -70,44 +66,16 @@ namespace PARAM { const double PLAYER_FRONT_TO_CENTER = 80.0; const double PLAYER_CENTER_TO_BALL_CENTER = 93; const double KICK_ANGLE = PARAM::Math::PI*30/180; // 可以击球的最大相对身体角度 - const double DRIBBLE_SIZE = PLAYER_FRONT_TO_CENTER + PARAM::Field::BALL_SIZE; // 带球时离球的距离 const double DRIBBLE_ANGLE = PARAM::Math::PI*17/180; // 可以带球的最大相对身体角度 const double HEAD_ANGLE = 57*PARAM::Math::PI/180; // 前面的开口角度 - //const double TOUCH_SHIFT_DIST = 10.06; // Touch时后退的距离 - const double TOUCH_SHIFT_DIST = 93; } } namespace AvoidDist{ //避障所用参数 - //const double TEAMMATE_AVOID_DIST = PARAM::Field::MAX_PLAYER_SIZE/2+15.0f; // 厘米 12 const double TEAMMATE_AVOID_DIST = PARAM::Vehicle::V2::PLAYER_SIZE*3; const double OPP_AVOID_DIST = PARAM::Field::MAX_PLAYER_SIZE; // 厘米 18 const double BALL_AVOID_DIST = PARAM::Field::BALL_SIZE/2+20.0; // 厘米3 - const double DEFENDKICK_MARKING_DIST = 65; - } - #ifdef _WIN32 - namespace File{ - const std::string DataDir = "data\\"; - const char* const ParamDir = "params\\"; - const std::string RobotPosFilterDir = "vision\\Robot_Param\\Pos\\"; - const std::string RobotRotFilterDir = "vision\\Robot_Param\\Rotation\\"; - const std::string BallFilterDir = "vision\\Ball_Param\\"; - const std::string PlayBookPath = "play_books\\"; - const std::string CBayesReader_SCRIPT_PATH = "params\\GameFilterParam\\"; - const std::string OppConfigPath = "defence_config\\"; - } - #else // not windows - namespace File{ - const std::string DataDir = "data/"; - const char* const ParamDir = "params/"; - const std::string RobotPosFilterDir = "vision/Robot_Param/Pos/"; - const std::string RobotRotFilterDir = "vision/Robot_Param/Rotation/"; - const std::string BallFilterDir = "vision/Ball_Param/"; - const std::string PlayBookPath = "play_books/"; - const std::string CBayesReader_SCRIPT_PATH = "params/GameFilterParam/"; - const std::string OppConfigPath = "defence_config/"; } - #endif } namespace ZSS { const QString ZSS_ADDRESS = "233.233.233.233";