|
LIBRCSC Docs
Documentation for HELIOS's BASE LIBRCSC library for RoboCup 2D Simulation League.
|
manages action effect, command counter More...
#include <action_effector.h>
Public Member Functions | |
| ActionEffector (const PlayerAgent &agent) | |
| init member variables More... | |
| ~ActionEffector () | |
| destruct dynamic allocated command objects | |
| void | reset () |
| reset all command effect. called just before action decision | |
| void | incCommandCount (const PlayerCommand::Type type) |
| increment command count More... | |
| void | checkCommandCount (const BodySensor &sense) |
| compare internal command count with sensed command count More... | |
| std::ostream & | makeCommand (std::ostream &to) |
| make command string and update last action time More... | |
| void | clearAllCommands () |
| delete all command objects and say messages. | |
| const PlayerBodyCommand * | bodyCommand () const |
| get const pointer to the player's body command object More... | |
| const PlayerTurnNeckCommand * | turnNeckCommand () const |
| get const pointer to the player's turn_neck command object More... | |
| const PlayerChangeViewCommand * | changeViewCommand () const |
| get const pointer to the player's change_view command object More... | |
| const PlayerSayCommand * | sayCommand () const |
| get const pointer to the player's say command object More... | |
| const PlayerPointtoCommand * | pointtoCommand () const |
| get const pointer to the player's pointto command object More... | |
| const PlayerAttentiontoCommand * | attentiontoCommand () const |
| get const pointer to the player's attentionto command object More... | |
| void | setKick (const double &power, const AngleDeg &rel_dir) |
| create kick command and its effect with kick parameter More... | |
| void | setDash (const double &power) |
| create dash command and its effect with dash parameter More... | |
| void | setDash (const double &power, const AngleDeg &rel_dir) |
| create dash command and its effect with dash parameter More... | |
| void | setTurn (const AngleDeg &moment) |
| create turn command and its effect with turn parameter More... | |
| void | setCatch () |
| create catch command. More... | |
| void | setMove (const double &x, const double &y) |
| create move command and its effect with move parameter More... | |
| void | setTackle (const double &power_or_dir, const bool foul) |
| create tackle command and its effect with tackle parameter More... | |
| void | setTurnNeck (const AngleDeg &moment) |
| create turn_neck command and its effect with turn_neck parameter More... | |
| void | setChangeView (const ViewWidth &width) |
| create change_view command More... | |
| void | setChangeFocus (const double moment_dist, const AngleDeg &moment_dir) |
| create change_focus command More... | |
| void | addSayMessage (SayMessage *message) |
| add new say message More... | |
| bool | removeSayMessage (const char header) |
| remove the registered say message if exist More... | |
| void | clearSayMessage () |
| remove all registered say messages | |
| void | setPointto (const double &x, const double &y) |
| create pointto command and its effect with pointto parameter More... | |
| void | setPointtoOff () |
| create pointto command by off mode | |
| void | setAttentionto (const SideID side, const int unum) |
| create attentionto command More... | |
| void | setAttentiontoOff () |
| create attentionto command by off mode | |
| const GameTime & | lastActionTime () const |
| get last command composition time More... | |
| PlayerCommand::Type | lastBodyCommandType () const |
| get last perfomed command type to update SelfObject More... | |
| PlayerCommand::Type | lastBodyCommandType (int i) const |
| get last perfomed command type to update SelfObject More... | |
| bool | doneTurnNeck () const |
| check if turn_neck is performed to update SelfObject More... | |
| void | getKickInfo (Vector2D *accel, Vector2D *accel_err) const |
| get estimated kick action effect More... | |
| void | getTurnInfo (double *moment, double *err) const |
| get estimated turn action effect More... | |
| void | getDashInfo (Vector2D *accel, double *power) const |
| get estimated dash action effect More... | |
| const Vector2D & | getMovePos () const |
| get move action effect More... | |
| const GameTime & | getCatchTime () const |
| get last time catch action is performed More... | |
| void | getTackleInfo (double *power, double *dir, bool *foul) const |
| get tackle action effect More... | |
| bool | tackleFoul () const |
| get the last tackle foul switch. More... | |
| double | getTurnNeckMoment () const |
| get turn_neck action effect More... | |
| const std::string & | getSayMessage () const |
| get say action effect More... | |
| int | getSayMessageLength () const |
| get the total length of current reserved messages More... | |
| const std::vector< SayMessage::Ptr > & | sayMessageCont () const |
| get the reserved say messages More... | |
| const Vector2D & | getPointtoPos () const |
| get pointto action effect More... | |
| AngleDeg | queuedNextSelfBody () const |
| get estimated next body angle using queued action effect More... | |
| AngleDeg | queuedNextMyBody () const |
| get estimated next body angle using queued action effect More... | |
| Vector2D | queuedNextSelfPos () const |
| get estimated next position using queued action effect More... | |
| Vector2D | queuedNextMyPos () const |
| get estimated next position using queued action effect More... | |
| bool | queuedNextBallKickable () const |
| check if ball will be kickable in the next cycle More... | |
| Vector2D | queuedNextBallPos () const |
| get estimated next ball position using queued action effect More... | |
| Vector2D | queuedNextBallVel () const |
| get estimated next ball velocity using queued action effect More... | |
| AngleDeg | queuedNextAngleFromBody (const Vector2D &target) const |
| get estimated next angle of target point relative to estimated body angle using queued action effect More... | |
| ViewWidth | queuedNextViewWidth () const |
| get next view width using queued action effect More... | |
| bool | queuedNextCanSeeWithTurnNeck (const Vector2D &point, const double &angle_buf) const |
| get the next focus distance estimated by the queued acction effect More... | |
| int | queuedNextSeeCycles () const |
| get cycles till next see message arrival using queued action effect More... | |
manages action effect, command counter
|
explicit |
init member variables
| agent | const reference to the PlayerAgent instance |
| void rcsc::ActionEffector::addSayMessage | ( | SayMessage * | message | ) |
add new say message
| message | pointer to the dynamically allocated say message object. |
|
inline |
get const pointer to the player's attentionto command object
|
inline |
get const pointer to the player's body command object
|
inline |
get const pointer to the player's change_view command object
| void rcsc::ActionEffector::checkCommandCount | ( | const BodySensor & | sense | ) |
compare internal command count with sensed command count
| sense | analyzed sense_body info |
This method is called when sense_body received. This method MUST be called before WorldModel update
|
inline |
check if turn_neck is performed to update SelfObject
|
inline |
get last time catch action is performed
|
inline |
get estimated dash action effect
| accel | variable pointer to store the estimated dash accel |
| power | variable pointer to store the used dash power |
get estimated kick action effect
| accel | variable pointer to store the estimated ball accel |
| accel_err | variable pointer to store the estimated ball accel error |
|
inline |
get move action effect
|
inline |
get pointto action effect
|
inline |
get say action effect
| int rcsc::ActionEffector::getSayMessageLength | ( | ) | const |
get the total length of current reserved messages
|
inline |
get tackle action effect
| power | variable pointer to store the used tackle power |
| dir | variable pointer to store the tackle direction |
|
inline |
get estimated turn action effect
| moment | variable pointer to store the estimated actual turned moment |
| err | variable pointer to store the estimated turned moment error |
|
inline |
get turn_neck action effect
| void rcsc::ActionEffector::incCommandCount | ( | const PlayerCommand::Type | type | ) |
increment command count
| type | target command type |
|
inline |
get last command composition time
|
inline |
get last perfomed command type to update SelfObject
|
inline |
get last perfomed command type to update SelfObject
| std::ostream & rcsc::ActionEffector::makeCommand | ( | std::ostream & | to | ) |
make command string and update last action time
| to | reference to the output stream |
After command string composition, all command objects are deleted.
|
inline |
get const pointer to the player's pointto command object
get estimated next angle of target point relative to estimated body angle using queued action effect
| target | target point |
| bool rcsc::ActionEffector::queuedNextBallKickable | ( | ) | const |
check if ball will be kickable in the next cycle
| Vector2D rcsc::ActionEffector::queuedNextBallPos | ( | ) | const |
get estimated next ball position using queued action effect
| Vector2D rcsc::ActionEffector::queuedNextBallVel | ( | ) | const |
get estimated next ball velocity using queued action effect
| bool rcsc::ActionEffector::queuedNextCanSeeWithTurnNeck | ( | const Vector2D & | point, |
| const double & | angle_buf | ||
| ) | const |
get the next focus distance estimated by the queued acction effect
get the next focus direction estimated by the queued acction effect
check if the target point can see only by turn_neck with the buffer
| point | target point |
| angle_buf | angle buffer for the half view width |
|
inline |
get estimated next body angle using queued action effect
|
inline |
get estimated next position using queued action effect
| int rcsc::ActionEffector::queuedNextSeeCycles | ( | ) | const |
get cycles till next see message arrival using queued action effect
| AngleDeg rcsc::ActionEffector::queuedNextSelfBody | ( | ) | const |
get estimated next body angle using queued action effect
| Vector2D rcsc::ActionEffector::queuedNextSelfPos | ( | ) | const |
get estimated next position using queued action effect
| ViewWidth rcsc::ActionEffector::queuedNextViewWidth | ( | ) | const |
get next view width using queued action effect
| bool rcsc::ActionEffector::removeSayMessage | ( | const char | header | ) |
remove the registered say message if exist
| header | message header character |
|
inline |
get const pointer to the player's say command object
|
inline |
get the reserved say messages
| void rcsc::ActionEffector::setAttentionto | ( | const SideID | side, |
| const int | unum | ||
| ) |
create attentionto command
| side | target player's side |
| unum | target player's uniform number |
| void rcsc::ActionEffector::setCatch | ( | ) |
create catch command.
command argumment, catch direction is calculated in this method. catch direction is calculated using diagonal line direction
| void rcsc::ActionEffector::setChangeFocus | ( | const double | moment_dist, |
| const AngleDeg & | moment_dir | ||
| ) |
create change_focus command
| moment_dist | distance added to the current focus point |
| moment_dir | direction added to the current focus point |
| void rcsc::ActionEffector::setChangeView | ( | const ViewWidth & | width | ) |
create change_view command
| width | view width that player wants. |
ViewQuality should not be changed by user
| void rcsc::ActionEffector::setDash | ( | const double & | power | ) |
create dash command and its effect with dash parameter
| power | dash power for command argument |
power is normalized by server parameter useless dash power is reduceed automatically.
| void rcsc::ActionEffector::setDash | ( | const double & | power, |
| const AngleDeg & | rel_dir | ||
| ) |
create dash command and its effect with dash parameter
| power | dash power for command argument |
| rel_dir | dash direction for command argument |
power is normalized by server parameter useless dash power is reduceed automatically.
| void rcsc::ActionEffector::setKick | ( | const double & | power, |
| const AngleDeg & | rel_dir | ||
| ) |
create kick command and its effect with kick parameter
| power | kick power for command argument |
| rel_dir | kick direction relative to body angle for command argument |
power is normalized by server parameter
| void rcsc::ActionEffector::setMove | ( | const double & | x, |
| const double & | y | ||
| ) |
create move command and its effect with move parameter
| x | move target point x |
| y | move target point y |
| void rcsc::ActionEffector::setPointto | ( | const double & | x, |
| const double & | y | ||
| ) |
create pointto command and its effect with pointto parameter
| x | target point x |
| y | target point y |
| void rcsc::ActionEffector::setTackle | ( | const double & | power_or_dir, |
| const bool | foul | ||
| ) |
create tackle command and its effect with tackle parameter
| power_or_dir | tackle power or directin for command argument |
| foul | intentional foul switch |
power is normalized by server parameter
| void rcsc::ActionEffector::setTurn | ( | const AngleDeg & | moment | ) |
create turn command and its effect with turn parameter
| moment | turn moment that player wants to perform |
command argument, moment is calculated using current player's speed and its inertia moment parameter. command argument moment is normalized by server parameter.
| void rcsc::ActionEffector::setTurnNeck | ( | const AngleDeg & | moment | ) |
create turn_neck command and its effect with turn_neck parameter
| moment | turn_neck moment that player wants to perform |
command argument moment is normalized by server parameter.
|
inline |
get the last tackle foul switch.
|
inline |
get const pointer to the player's turn_neck command object