クラス rcsc::PlayerAgent

basic player agent class [詳細]

#include <player_agent.h>

rcsc::PlayerAgentに対する継承グラフ

rcsc::SoccerAgent すべてのメンバ一覧

Public メソッド

 PlayerAgent ()
 create internal modules
virtual ~PlayerAgent ()
 virtual destructor
const PlayerConfigconfig () const
 get configuration set
DebugClientdebugClient ()
 get debug client interface
const WorldModelworld () const
 get worldmodel
const ActionEffectoreffector () const
 get action effector
const BodySensorbodySensor () const
 get body sensor
const VisualSensorvisualSensor () const
 get visual sensor
const AudioSensoraudioSensor () const
 get audio sensor
const FullstateSensorfullstateSensor () const
 get fullstate sensor
const SeeStateseeState () const
 get see state
const TimeStampbodyTimeStamp () const
 get time stamp when sense_body message is received
const TimeStampseeTimeStamp () const
 get time stamp of see message when see message is received
bool doKick (const double &power, const AngleDeg &rel_dir)
 register kick command
bool doDash (const double &power)
 register dash command
bool doTurn (const AngleDeg &moment)
 register turn command
bool doCatch ()
 register catch command. catch direction is automatically calculated.
bool doMove (const double &x, const double &y)
 register move command
bool doTackle (const double &power_or_dir)
 register tackle command
bool doTurnNeck (const AngleDeg &moment)
 register turn_neck command.
bool doChangeView (const ViewWidth &width)
 register change_view command.
bool doPointto (const double &x, const double &y)
 register say command. register pointto command.
bool doPointtoOff ()
 register pointto command. turn off mode
bool doAttentionto (SideID side, const int unum)
 register attentionto command by off mode
bool doAttentiontoOff ()
 register attentionto command. turn off mode
void setArmAction (ArmAction *act)
 reserve pointto action
void setNeckAction (NeckAction *act)
 reserve turn neck action
void setViewAction (ViewAction *act)
 reserve change view action
void addSayMessage (const SayMessage *message)
 add say message to the action effector
bool removeSayMessage (const char header)
 remove the registered say message if exist
void setIntention (SoccerIntention *intention)
 set intention object
bool doIntention ()
 execute queued intention if exist.
void finalize ()
 finalize all things when program quits

Protected メソッド

virtual bool initImpl (CmdLineParser &cmd_parser)
 analyze command line options
virtual bool handleStart ()
 handle start event
virtual void handleMessage ()
 handle server message event
virtual void handleTimeout (const int timeout_count, const int waited_msec)
 handle timeout event
virtual void handleExit ()
 handle exit event
void addSayMessageParser (boost::shared_ptr< SayMessageParser > parser)
 register new say message parser object
void removeSayMessageParser (const char header)
 remove registered parser object
void setFreeformParser (boost::shared_ptr< FreeformParser > parser)
 set new freeform message parser
virtual void actionImpl ()=0
 pure virtual method. register body action to ActionEffector.
virtual void communicationImpl ()
 virtual method. register say action to ActionEffector
virtual void outputDebug ()
 output debug messages to file or debug server
virtual void handleServerParam ()
 this method is called just after analyzing server_param message.
virtual void handlePlayerParam ()
 this method is called just after analyzing player_param message.
virtual void handlePlayerType ()
 this method is called just after analyzing player_type message.

Protected 変数

PlayerConfig M_config
 configuration parameter set
DebugClient M_debug_client
 debug client interface
WorldModel M_worldmodel
 mental memory of world status
ActionEffector M_effector
 action info manager

説明

basic player agent class


関数

const PlayerConfig& rcsc::PlayerAgent::config (  )  const [inline]

get configuration set

戻り値:
const reference to the configuration class object

DebugClient& rcsc::PlayerAgent::debugClient (  )  [inline]

get debug client interface

戻り値:
reference to the DebugClient object

const WorldModel& rcsc::PlayerAgent::world (  )  const [inline]

get worldmodel

戻り値:
const reference to world model instance

const ActionEffector& rcsc::PlayerAgent::effector (  )  const [inline]

get action effector

戻り値:
reference to action effector

const BodySensor & rcsc::PlayerAgent::bodySensor (  )  const

get body sensor

戻り値:
const reference to the body sensor instance

const VisualSensor & rcsc::PlayerAgent::visualSensor (  )  const

get visual sensor

戻り値:
const reference to the visual sensor instance

const AudioSensor & rcsc::PlayerAgent::audioSensor (  )  const

get audio sensor

戻り値:
const reference to the audio sensor instance

const FullstateSensor & rcsc::PlayerAgent::fullstateSensor (  )  const

get fullstate sensor

戻り値:
const reference to the fullstate sensor instance

const SeeState & rcsc::PlayerAgent::seeState (  )  const

get see state

戻り値:
const reference to the see state instance

const TimeStamp & rcsc::PlayerAgent::bodyTimeStamp (  )  const

get time stamp when sense_body message is received

戻り値:
const reference to the time stamp object

const TimeStamp & rcsc::PlayerAgent::seeTimeStamp (  )  const

get time stamp of see message when see message is received

戻り値:
const reference to the time stamp object

bool rcsc::PlayerAgent::doKick ( const double &  power,
const AngleDeg rel_dir 
)

register kick command

引数:
power command argument kick power
rel_dir command argument kick direction relative to body angle
戻り値:
true if successfully registered.

bool rcsc::PlayerAgent::doDash ( const double &  power  ) 

register dash command

引数:
power command argument dash power
戻り値:
true if successfully registered.

bool rcsc::PlayerAgent::doTurn ( const AngleDeg moment  ) 

register turn command

引数:
moment command argument moment
戻り値:
true if successfully registered.

bool rcsc::PlayerAgent::doCatch (  ) 

register catch command. catch direction is automatically calculated.

戻り値:
true if successfully registered.

bool rcsc::PlayerAgent::doMove ( const double &  x,
const double &  y 
)

register move command

引数:
x move target x
y move target y
戻り値:
true if successfully registered.

bool rcsc::PlayerAgent::doTackle ( const double &  power_or_dir  ) 

register tackle command

引数:
power_or_dir command argument tackle power or direction
戻り値:
true if successfully registered.

bool rcsc::PlayerAgent::doTurnNeck ( const AngleDeg moment  ) 

register turn_neck command.

引数:
moment command argument moment
戻り値:
true if successfully registered.

bool rcsc::PlayerAgent::doChangeView ( const ViewWidth width  ) 

register change_view command.

引数:
width new view width
戻り値:
true if successfully registered.
ViewQuality should not be changed by user

bool rcsc::PlayerAgent::doPointto ( const double &  x,
const double &  y 
)

register say command. register pointto command.

引数:
x target point x
y target point y
戻り値:
true if successfully registered.

bool rcsc::PlayerAgent::doPointtoOff (  ) 

register pointto command. turn off mode

戻り値:
true if successfully registered.

bool rcsc::PlayerAgent::doAttentionto ( SideID  side,
const int  unum 
)

register attentionto command by off mode

引数:
side target player's side
unum target player's uniform number
戻り値:
true if successfully registered.

bool rcsc::PlayerAgent::doAttentiontoOff (  ) 

register attentionto command. turn off mode

戻り値:
true if successfully registered.

void rcsc::PlayerAgent::setArmAction ( ArmAction act  ) 

reserve pointto action

引数:
act pointer to the action. must be a dynamically allocated object.

void rcsc::PlayerAgent::setNeckAction ( NeckAction act  ) 

reserve turn neck action

引数:
act pointer to the action. must be a dynamically allocated object.

void rcsc::PlayerAgent::setViewAction ( ViewAction act  ) 

reserve change view action

引数:
act pointer to the action. must be a dynamically allocated object.

void rcsc::PlayerAgent::addSayMessage ( const SayMessage message  ) 

add say message to the action effector

引数:
message pointer to the say mesage builder. this must be a dynamically allocated object.

bool rcsc::PlayerAgent::removeSayMessage ( const char  header  ) 

remove the registered say message if exist

引数:
header message header character
戻り値:
true if removed

void rcsc::PlayerAgent::setIntention ( SoccerIntention intention  ) 

set intention object

引数:
intention pointer to the intention. this must be a dynamically allocated object.

bool rcsc::PlayerAgent::doIntention (  ) 

execute queued intention if exist.

戻り値:
true if action is executed
false if queue is empty, or action is failed.

bool rcsc::PlayerAgent::initImpl ( CmdLineParser cmd_parser  )  [protected, virtual]

analyze command line options

引数:
cmd_parser command line parser object
戻り値:
only if "help" option is given, false is returned.
This method is called from SoccerAgent::init( argc, argv ) SoccerAgent::init(argc,argv) should be called in main().

rcsc::SoccerAgentを実装しています。

bool rcsc::PlayerAgent::handleStart (  )  [protected, virtual]

handle start event

戻り値:
status of start procedure.
This method is called when client starts to run. The concrete agent must connect to the server and send init command. Do NOT call this method by yourself!

rcsc::SoccerAgentを実装しています。

void rcsc::PlayerAgent::handleMessage (  )  [protected, virtual]

handle server message event

This method is called from BasicClient::run() method. Do NOT call this method by yourself!

rcsc::SoccerAgentを実装しています。

void rcsc::PlayerAgent::handleTimeout ( const int  timeout_count,
const int  waited_msec 
) [protected, virtual]

handle timeout event

引数:
timeout_count count of timeout without sensory message.
waited_msec elapsed milliseconds since last sensory message. This method is called from BasicClient::run() method. Do NOT call this method by yourself!

rcsc::SoccerAgentを実装しています。

void rcsc::PlayerAgent::addSayMessageParser ( boost::shared_ptr< SayMessageParser parser  )  [protected]

register new say message parser object

引数:
parser pointer to the say mesage parser.

void rcsc::PlayerAgent::removeSayMessageParser ( const char  header  )  [protected]

remove registered parser object

引数:
header say message header character

void rcsc::PlayerAgent::setFreeformParser ( boost::shared_ptr< FreeformParser parser  )  [protected]

set new freeform message parser

引数:
parser pointer to the freeform message parser.

virtual void rcsc::PlayerAgent::actionImpl (  )  [protected, pure virtual]

pure virtual method. register body action to ActionEffector.

This method is used to set player's action. This method is called from action(). So, do *NOT* call this method by yourself.

virtual void rcsc::PlayerAgent::communicationImpl (  )  [inline, protected, virtual]

virtual method. register say action to ActionEffector

This method is called just after doTurnNeck() in decideAction(); This method is used to set player's action. So, do *not* call this method by yourself.

void rcsc::PlayerAgent::outputDebug (  )  [protected, virtual]

output debug messages to file or debug server

This method is called in decideAction() and after send command. So, do *not* call this method by yourself.


このクラスの説明は次のファイルから生成されました:
librcscに対してThu May 1 15:41:27 2008に生成されました。  doxygen 1.5.0