Skip to content

Commit

Permalink
[Core] update
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-tz committed Apr 17, 2024
1 parent 587f557 commit 8c98588
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
15 changes: 10 additions & 5 deletions Core/src/MotionControl/CMmotion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,16 +488,21 @@ double expectedCMPathTime(const PlayerPoseT& start, const CGeoPoint& final, doub

double predictedTime(const PlayerVisionT& start, const CGeoPoint & Target, const CVector& targetVel) {
CVector x = start.Pos() - Target;
CVector v = (start.Vel().mod() < 2.5*10) ? CVector(0, 0) : start.Vel();
CVector v = start.Vel();
double time;
CVector a;
double accel_factor = 1.5;
double accel_factor = 1.8;
if(IS_SIMULATION) {
accel_factor = 1.0;
}
compute_motion_2d(x, v, targetVel,
// compute_motion_2d(x, v, targetVel,
// OUR_MAX_ACC,
// OUR_MAX_DEC,
// OUR_MAX_SPEED,
// accel_factor,
// a, time);
__new_compute_motion_2d(x, v, targetVel,
OUR_MAX_ACC,
OUR_MAX_DEC,
OUR_MAX_SPEED,
accel_factor,
a, time);
Expand All @@ -507,7 +512,7 @@ double predictedTime(const PlayerVisionT& start, const CGeoPoint & Target, const

double predictedTimeWithRawVel(const PlayerVisionT& start, const CGeoPoint & Target, const CVector& targetVel) {
CVector x = start.Pos() - Target;
CVector v = (start.RawVel().mod() < 2.5*10) ? CVector(0, 0) : start.RawVel();
CVector v = start.RawVel();
// GDebugEngine::Instance()->gui_debug_msg(start.Pos(), QString("vel: (%1, %2)").arg(v.x()).arg(v.y()).toLatin1());
double time;
CVector a;
Expand Down
2 changes: 1 addition & 1 deletion Core/tactics/skill/Touch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void CTouch::plan(const CVisionModule* pVision){
CGeoPoint bestPos = BallSpeedModel::instance()->poseForTime(1.0).Pos();
for(double dist = 0; dist < 3000; dist += 20){
auto pos = ballPos + Utils::Polar2Vector(dist, ballVelDir);
double t1 = predictedTimeWithRawVel(me, pos);
double t1 = predictedTime(me, pos);
double t2 = BallSpeedModel::Instance()->timeForDist(dist);
if (DEBUG_SWITCH){
GDebugEngine::Instance()->gui_debug_x(pos,COLOR_GREEN);
Expand Down
1 change: 0 additions & 1 deletion ZBin/lua_scripts/skill/GoCmuRush.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ function GoCmuRush(task)
local msender = task.sender or 0
local mrole = task.srole or ""
local macc = task.acc or 0
local mrec = task.rec or 0 --mrec判断是否吸球 gty 2016-6-15
local mvel
local mspeed = task.speed or 0
local mforce_maunal_set_running_param = task.force_manual or false
Expand Down

0 comments on commit 8c98588

Please sign in to comment.