Librcsc阅读笔记:PlayerAgent/PlayerConfig
PlayerAgent
basic player agent class 最基本的球员智能体类
继承了SoccerAgent
类
struct Impl
implement即实行,就是保证agent部分功能运转的结构体。
public variables
PlayerAgent & agent_
reference to the agent instance 智能体句柄的指向
GameTime
变量
last_decision_time_
:last action decision game time
current_time_
: current game time
timeStamp
变量
body_time_stamp_
: time when sense_body is received
see_time_stamp_
: time when see is received
bool
变量
think_received_
:flag to check if (think) message was received or not.
server_cycle_stopped_
: flag to check if server cycle is stopped or not.
boost::shared_ptr
变量
数据类型和变量名 | 作用 |
---|---|
boost::shared_ptr<ArmAction> arm_action_ |
pointer to reserved action |
boost::shared_ptr<NeckAction> neck_action_ |
pointer to reserved action |
boost::shared_ptr<ViewAction> view_action_ |
pointer to reserved action |
boost::shared_ptr<SoccerIntention> intention_ |
intention queue |
int
变量
clang_min_
:supported minimal clang version
clang_max_
:supported maximal clang version
其他变量和函数
其他变量和函数自行在网页查看,主要是一个class一个对应变量以及对应函数。
public functions
动作型函数
比较重要的函数,涉及球员动作。下一步应该关注具体实现、与chain_action
关系和动作提升。
bool doKick (const double &power, const AngleDeg &rel_dir)
踢球bool doDash (const double &power, const AngleDeg &rel_dir=0.0)
冲刺bool doCatch ()
带球bool doMove (const double &x, const double &y)
移动bool doTackle (const double &power_or_dir, const bool foul=false)
铲球bool doTurnNeck (const AngleDeg &moment)
转头bool doChangeView (const ViewWidth &width)
变更视角bool doPointto (const double &x, const double &y)
bool doPointtoOff ()
bool doAttentionto (SideID side, const int unum)
bool doAttentiontoOff ()
void setArmAction (ArmAction *act)
void setNeckAction (NeckAction *act)
void setViewAction (ViewAction *act)
void addSayMessage (const SayMessage *message)
bool removeSayMessage (const char header)
void setIntention (SoccerIntention *intention)
bool doIntention ()
void addPreActionCallback (const PeriodicCallback::Ptr &ptr)
void addPostActionCallback (const PeriodicCallback::Ptr &ptr)
返回特定类的函数
const PlayerConfig & config () const
DebugClient & debugClient ()
const WorldModel & world () const
const WorldModel & fullstateWorld () const
const ActionEffector & effector () const
const BodySensor & bodySensor () const
const VisualSensor & visualSensor () const
const AudioSensor & audioSensor () const
const FullstateSensor & fullstateSensor () const
const SeeState & seeState () const
const TimeStamp & bodyTimeStamp () const
:get time stamp when sense_body message is receivedconst TimeStamp & seeTimeStamp () const
:get time stamp of see message when see message is received
如上所示,有一批agent的传感器。