资源简介
robocup 2D中较强的yushan底层代码,虽说已经开源了,但是一些人可能找不到,分享分享
代码片段和文件信息
// -*-c++-*-
/*!
\file basic_actions.cpp
\brief basic player actions Source File
*/
/*
*Copyright:
Copyright (C) Hidehisa AKIYAMA
This code is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License or (at your option) any later version.
This library is distributed in the hope that it will be useful
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not write to the Free Software
Foundation Inc. 59 Temple Place Suite 330 Boston MA 02111-1307 USA
*EndCopyright:
*/
/////////////////////////////////////////////////////////////////////
#ifdef HAVE_CONFIG_H
#include
#endif
#include “basic_actions.h“
#include “bhv_scan_field.h“
#include “neck_scan_field.h“
#include “neck_scan_players.h“
#include yer/player_agent.h>
#include
#include
#include
//#define DEBUG
//#define DEBUG_NECK_TURN_TO_BALL
namespace rcsc {
/////////////////////////////////////////////////////////////////////
/*-------------------------------------------------------------------*/
/*!
*/
bool
Body_TurnToAngle::execute( PlayerAgent * agent )
{
dlog.addText( Logger::ACTION
__FILE__“: Body_TurnToAngle“ );
const Selfobject & self = agent->world().self();
if ( ! self.faceValid() )
{
agent->doTurn( 0.0 );
return false;
}
agent->doTurn( M_angle - self.body() );
return true;
}
/////////////////////////////////////////////////////////////////////
/*-------------------------------------------------------------------*/
/*!
*/
bool
Body_TurnToPoint::execute( PlayerAgent * agent )
{
dlog.addText( Logger::ACTION
__FILE__“: Body_TurnToPoint“ );
const Selfobject & self = agent->world().self();
if ( ! self.posValid() )
{
return agent->doTurn( 60.0 );
}
// relative angle from my predicted pos & body angle to point
Vector2D my_point = self.inertiaPoint( M_cycle );
AngleDeg target_rel_angle
= ( M_point - my_point ).th() - self.body();
// not consider about max effective turn (inertia moment)
// try to face to point greedy
agent->doTurn( target_rel_angle );
if ( target_rel_angle.abs() < 1.0 )
{
return false;
}
return true;
}
/////////////////////////////////////////////////////////////////////
/*-------------------------------------------------------------------*/
/*!
*/
bool
Body_TurnToBall::execute( PlayerAgent * agent )
{
dlog.addText( Logger::ACTION
__FILE__“: Body_TurnToBall“ );
if ( ! agent->world().ba
相关资源
- A*算法的2D演示(带源码)
- Scratch 我的世界.2d.sb3
- Scratch:(我的世界2D).sb3
- S32K144仿真软件S32DS操作指南
- STM32F042F6P6 Uart12DMA;发送中断接收
- cocos2d-x飞机大战项目
- HP ProCurve-SR-7102dl产品手册
- 血小板live2d模型
- Cocos2d-x开发游戏的坐标系知识介绍
- Cocos2d-x 3.x 头像选择器功能扩展Image
- 2DDL Pro 2D Dynamic Lights and Shadows
- NVIDIAOpticalFlowSDK-79c6cee80a2df9a196f20afd6
- 易语言D2D图层应用源码
- 节奏大师源码
- 炸弹人(cocos2d-x 3.2)
- 5种爆炸序列帧贴图
- 2012robocup3d 冠军南邮可执行代码
- unity2D猛禽战机空战游戏完整源码
- 幻城探险2D横版通关小游戏原工程+e
- Unity3D 实战视频教程 保卫萝卜 2D 游戏
- 2D横版忍者跑酷游戏《刀叶如飞》游戏
- Unity 2D飞行射击源码加资源
- Seismic Frequency-domain Full waveform 2-D inv
- 通过模糊球面几何从2D SYM构造4D N =
- RTL8197D+RTL8192CE+RTL8192DR双频无线路由器
- x64dbg x32dbg中文帮助文档
- 论文研究 - 在多层HetNet中平衡D2D通信
- Cocos Creator 实现的超级玛丽小游戏de
- Corgi Engine - 2D 25D Platformer 5.4
- res2dmod电法正演
评论
共有 条评论