Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

Kodu::KoduAgent Class Reference

#include <KoduAgent.h>


Detailed Description

Definition at line 28 of file KoduAgent.h.

List of all members.

Public Member Functions

 KoduAgent ()
 Constructor.
 ~KoduAgent ()
 Destructor.
KoduAgentoperator= (const KoduAgent &)
 Assignment operator.
const std::vector< Point > & getGazePoints () const
bool isExecutingManipAction () const
 ================================ Grasper functions ================================ ///
bool isHoldingAnObject () const
 States whether or not the agent is (supposed to be) holding something.
void manipulationComplete ()
 Signals the robot has completed the manipulation task (sets a particular set of flags).
void setIsExecutingManipActionFlag (bool bval=true)
 Sets the "(agent) is attempting grab" flag.
void setTargetInGripperFlag (bool bval=true)
 Sets the "target object is in gripper" flag.
void setWantsToDropObjectFlag (bool bval=true)
 Signals that the agent wants to drop something.
void setWantsToGrabObjectFlag (bool bval=true)
 Signals that the agent wants to grab something.
void signalDropActionStart ()
 Signals the robot wants to drop an object (sets a particular set of flags).
void signalGrabActionStart ()
 Signals the robot wants to grab an object (sets a particular set of flags).
bool wantsToDropObject () const
 States whether or not the agent wants to drop an object.
bool wantsToGrabObject () const
 States whether or not the agent has an object it wants to grab.
void setWantsToGiveObjectFlag (bool bval=true)
 ================================ Give functions =================================== ///
void signalGiveActionStart ()
 Signals the robot wants to give an objec to another robot (sets flags).
void setIsReceiving (bool bval=true)
 Signals whether the agent is currently receiving.
bool wantsToGiveObject () const
 States whether or not the agent wants to give an object to another agent.
bool bodyIsInMotion () const
 ================================ Motion functions ================================ ///
bool isExecutingMotionAction () const
 Checks if the agent is walking (returns value of "agent is walking" flag).
bool needsToLocalize () const
 Checks if the agent needs to localize.
void motionComplete ()
 Signals the robot has completed a motion command.
void signalMotionActionStart ()
 Signals the robot is executing a motion command.
void setIsExecutingMotionActionFlag (bool bval=true)
 Sets the 'agent is executing motion command' flag (default value = true).
void setMotionCommand (const MotionCommand &)
 Sets the current motion command.
KoduPagegetCurrentPage () const
 ================================ Page functions ================================ ///
KoduPagegetPage (unsigned int pageNumber) const
 Returns the specified page (using it's page number).
KoduPagegetPageInPos (unsigned int pageIndex) const
 Returns the specified page (using it's location in the vector--(PAGE# - 1)).
bool hasNewPageNumber () const
 Checks if the agent wants to switch pages.
bool hasNewScoreChanges () const
 ================================ Scoring functions ================================ ///
bool hasTextToSay () const
 ================================ Speech functions ================================ ///
bool hasSoundsToPlay () const
 ================================ Sound functions ================================ ///

Public Attributes

ShapeRoot gripperObject
 The object the agent is holding/will be holding.
bool agentIsExecutingManipAction
 (flag) States if the agent is attempting to grab an object
bool agentWantsToDropObject
 (flag) States if the agent wants to drop an object
bool agentWantsToGrabObject
 (flag) States if the agent wants to grab an object
bool targetObjectIsInGripper
 (flag) States if the target object is in the gripper
bool agentIsExecutingMotionAction
MotionCommand currMotionCmd
 The current motion command.
float distanceTravelled
 The accumulated distance the robot has travelled.
bool agentWantsToGiveObject
 (flag) States if the agent wants to give an object
Shape< AgentData > giveTargetObject
bool agentIsReceiving
int agentReceivingFrom
bool gotGiveReady
bool gotGiveInformation
float giveAngleToTurn
std::string giveObjType
std::vector< KoduPage * > pages
 The vector of pages containing kode.
unsigned int currPageIndex
 The page (index) currently being executed.
unsigned int newReqdPage
 Stores the page number the agent wants to switch to.
std::queue< PerceptualTaskBase * > ptasks
 A queue containing all the perceptual tasks.
std::queue< ScoreChangescoreQueue
 The queue of score operations and their value.
std::string stringToSpeak
 The string the agent wants to speak.
std::queue< std::string > playQueue
 The queue of sound files the agent wants to play.

Static Public Attributes

static const float kLocalizationDistanceThreshold = 1000.0f
 The mininum travelling distance (including turns) to consider performing localization.

Private Member Functions

void generateGazePoints ()
 ================================ Gaze functions ================================ ///
 DISALLOW_COPY (KoduAgent)

Private Attributes

std::vector< Point > agentGazePoints
 egocentric (relative to the robot's body) points to look at

Constructor & Destructor Documentation

Kodu::KoduAgent::KoduAgent (  ) 

Constructor.

Definition at line 18 of file KoduAgent.cc.

Kodu::KoduAgent::~KoduAgent (  ) 

Destructor.

Definition at line 48 of file KoduAgent.cc.


Member Function Documentation

bool Kodu::KoduAgent::bodyIsInMotion (  )  const

================================ Motion functions ================================ ///

================================ Motion functions ================================ /// Checks if the robot's body is moving (during motion action the body may stop)

Definition at line 169 of file KoduAgent.cc.

Referenced by Kodu::VisualNavErrMonTask::canExecute(), and Kodu::VisualGripperMonitorTask::canExecute().

Kodu::KoduAgent::DISALLOW_COPY ( KoduAgent   )  [private]
void Kodu::KoduAgent::generateGazePoints (  )  [private]

================================ Gaze functions ================================ ///

================================ Gaze functions ================================ /// Generates the agent's gaze points (the points in space to search for objects)

Definition at line 80 of file KoduAgent.cc.

Referenced by KoduAgent().

KoduPage * Kodu::KoduAgent::getCurrentPage (  )  const

================================ Page functions ================================ ///

================================ Page functions ================================ /// Returns the page currently being evaluated (determined by current page index variable)

Definition at line 222 of file KoduAgent.cc.

Referenced by KoduInterpreter::KoduConditionEvaluator::resetChildRulesWithOnceEnabled().

const std::vector< Point > & Kodu::KoduAgent::getGazePoints (  )  const

================================ Gazing functions ================================ /// Returns the gaze points

Definition at line 101 of file KoduAgent.cc.

Referenced by KoduInterpreter::InitializeAgent::LookAround::doStart().

KoduPage * Kodu::KoduAgent::getPage ( unsigned int  pageNumber  )  const

Returns the specified page (using it's page number).

Definition at line 226 of file KoduAgent.cc.

KoduPage * Kodu::KoduAgent::getPageInPos ( unsigned int  pageIndex  )  const

Returns the specified page (using it's location in the vector--(PAGE# - 1)).

Definition at line 230 of file KoduAgent.cc.

Referenced by getPage().

bool Kodu::KoduAgent::hasNewPageNumber (  )  const

Checks if the agent wants to switch pages.

Definition at line 239 of file KoduAgent.cc.

Referenced by KoduInterpreter::KoduActionRunner::doStart().

bool Kodu::KoduAgent::hasNewScoreChanges (  )  const

================================ Scoring functions ================================ ///

================================ Scoring functions ================================ /// Checks if the agent has a string to speak

Definition at line 217 of file KoduAgent.cc.

Referenced by KoduInterpreter::KoduActionRunner::doStart().

bool Kodu::KoduAgent::hasSoundsToPlay (  )  const

================================ Sound functions ================================ ///

================================ Sound functions ================================ /// Checks if the agent has sounds to play

Definition at line 249 of file KoduAgent.cc.

Referenced by KoduInterpreter::PlayActuator::doStart(), KoduInterpreter::PlayActionRunner::PlayEnd::doStart(), and KoduInterpreter::KoduActionRunner::doStart().

bool Kodu::KoduAgent::hasTextToSay (  )  const

================================ Speech functions ================================ ///

================================ Speech functions ================================ /// Checks if the agent has a string to speak

Definition at line 244 of file KoduAgent.cc.

Referenced by KoduInterpreter::KoduActionRunner::doStart().

bool Kodu::KoduAgent::isExecutingManipAction (  )  const

================================ Grasper functions ================================ ///

================================ Grasper functions ================================ /// States if the agent is attempting to grab an object

Definition at line 106 of file KoduAgent.cc.

Referenced by KoduInterpreter::KoduActionRunner::doStart().

void Kodu::KoduAgent::manipulationComplete (  ) 

Signals the robot has completed the manipulation task (sets a particular set of flags).

Definition at line 114 of file KoduAgent.cc.

Referenced by KoduInterpreter::GiveActionRunner::GiveActionSend::doStart(), KoduInterpreter::GrabActionRunner::GrabActionEnd::doStart(), and KoduInterpreter::DropActionRunner::DropActionEnd::doStart().

void Kodu::KoduAgent::motionComplete (  ) 
bool Kodu::KoduAgent::needsToLocalize (  )  const

Checks if the agent needs to localize.

Definition at line 177 of file KoduAgent.cc.

KoduAgent & Kodu::KoduAgent::operator= ( const KoduAgent kAgent  ) 

Assignment operator.

Definition at line 54 of file KoduAgent.cc.

void Kodu::KoduAgent::setIsExecutingManipActionFlag ( bool  bval = true  ) 

Sets the "(agent) is attempting grab" flag.

Definition at line 128 of file KoduAgent.cc.

Referenced by manipulationComplete(), setIsReceiving(), signalDropActionStart(), signalGiveActionStart(), and signalGrabActionStart().

void Kodu::KoduAgent::setIsExecutingMotionActionFlag ( bool  bval = true  ) 

Sets the 'agent is executing motion command' flag (default value = true).

Definition at line 191 of file KoduAgent.cc.

Referenced by KoduInterpreter::GiveActionRunner::GiveActionSend::doStart(), motionComplete(), setIsReceiving(), signalGiveActionStart(), and signalMotionActionStart().

void Kodu::KoduAgent::setIsReceiving ( bool  bval = true  ) 

Signals whether the agent is currently receiving.

Definition at line 204 of file KoduAgent.cc.

Referenced by KoduInterpreter::KoduEventListener::doEvent(), and KoduInterpreter::ReceiveActionRunner::ReceiveActionEnd::doStart().

void Kodu::KoduAgent::setMotionCommand ( const MotionCommand kCmd  ) 

Sets the current motion command.

Definition at line 195 of file KoduAgent.cc.

void Kodu::KoduAgent::setTargetInGripperFlag ( bool  bval = true  ) 

Sets the "target object is in gripper" flag.

Definition at line 132 of file KoduAgent.cc.

Referenced by manipulationComplete().

void Kodu::KoduAgent::setWantsToDropObjectFlag ( bool  bval = true  ) 

Signals that the agent wants to drop something.

Definition at line 136 of file KoduAgent.cc.

Referenced by manipulationComplete(), and signalDropActionStart().

void Kodu::KoduAgent::setWantsToGiveObjectFlag ( bool  bval = true  ) 

================================ Give functions =================================== ///

================================ Give functions ================================== /// Signals that the agent wants to give something

Definition at line 200 of file KoduAgent.cc.

Referenced by KoduInterpreter::GiveActionRunner::GiveActionSend::doStart(), and signalGiveActionStart().

void Kodu::KoduAgent::setWantsToGrabObjectFlag ( bool  bval = true  ) 

Signals that the agent wants to grab something.

Definition at line 140 of file KoduAgent.cc.

Referenced by manipulationComplete(), and signalGrabActionStart().

void Kodu::KoduAgent::signalDropActionStart (  ) 

Signals the robot wants to drop an object (sets a particular set of flags).

Definition at line 144 of file KoduAgent.cc.

void Kodu::KoduAgent::signalGiveActionStart (  ) 

Signals the robot wants to give an objec to another robot (sets flags).

Definition at line 154 of file KoduAgent.cc.

void Kodu::KoduAgent::signalGrabActionStart (  ) 

Signals the robot wants to grab an object (sets a particular set of flags).

Definition at line 149 of file KoduAgent.cc.

void Kodu::KoduAgent::signalMotionActionStart (  ) 

Signals the robot is executing a motion command.

Definition at line 187 of file KoduAgent.cc.

Referenced by KoduInterpreter::MotionActionRunner::MotionStart::doStart().

bool Kodu::KoduAgent::wantsToDropObject (  )  const

States whether or not the agent wants to drop an object.

Definition at line 160 of file KoduAgent.cc.

Referenced by KoduInterpreter::KoduActionRunner::doStart().

bool Kodu::KoduAgent::wantsToGiveObject (  )  const

States whether or not the agent wants to give an object to another agent.

Definition at line 211 of file KoduAgent.cc.

Referenced by KoduInterpreter::KoduActionRunner::doStart().

bool Kodu::KoduAgent::wantsToGrabObject (  )  const

States whether or not the agent has an object it wants to grab.

Definition at line 164 of file KoduAgent.cc.

Referenced by KoduInterpreter::KoduActionRunner::doStart().


Member Data Documentation

std::vector<Point> Kodu::KoduAgent::agentGazePoints [private]

egocentric (relative to the robot's body) points to look at

Definition at line 190 of file KoduAgent.h.

Referenced by generateGazePoints(), getGazePoints(), and operator=().

(flag) States if the agent is attempting to grab an object

Definition at line 148 of file KoduAgent.h.

Referenced by isExecutingManipAction(), operator=(), and setIsExecutingManipActionFlag().

(flag) States if the agent wants to drop an object

Definition at line 149 of file KoduAgent.h.

Referenced by manipulationComplete(), operator=(), setWantsToDropObjectFlag(), and wantsToDropObject().

(flag) States if the agent wants to give an object

Definition at line 161 of file KoduAgent.h.

Referenced by KoduInterpreter::KoduEventListener::doEvent(), setWantsToGiveObjectFlag(), and wantsToGiveObject().

(flag) States if the agent wants to grab an object

Definition at line 150 of file KoduAgent.h.

Referenced by operator=(), setWantsToGrabObjectFlag(), and wantsToGrabObject().

The page (index) currently being executed.

Definition at line 172 of file KoduAgent.h.

Referenced by KoduInterpreter::PageSwitchActionRunner::SwitchToNewPage::doStart(), getCurrentPage(), and operator=().

The accumulated distance the robot has travelled.

Definition at line 158 of file KoduAgent.h.

Referenced by KoduInterpreter::WalkMonitor::doStart(), needsToLocalize(), and operator=().

Definition at line 168 of file KoduAgent.h.

Referenced by KoduInterpreter::KoduEventListener::doEvent().

The object the agent is holding/will be holding.

Definition at line 147 of file KoduAgent.h.

Referenced by Kodu::VisualBumpDetectionTask::canExecute(), KoduInterpreter::GiveActionRunner::GiveActionSend::doStart(), KoduInterpreter::GrabActionRunner::GrabActionEnd::doStart(), KoduInterpreter::GrabActionRunner::ExecuteGrabAction::CreateGripMonTask::doStart(), KoduInterpreter::GrabActionRunner::ExecuteGrabAction::PrepareForAnotherGrasp::RepositionGripperObject::doStart(), KoduInterpreter::GrabActionRunner::ExecuteGrabAction::PrepareForAnotherGrasp::FindObjectAgain::doStart(), KoduInterpreter::GrabActionRunner::ExecuteGrabAction::PrepareForAnotherGrasp::RepositionBody::doStart(), KoduInterpreter::GrabActionRunner::ExecuteGrabAction::GrabObject::doStart(), KoduInterpreter::GrabActionRunner::PrepareBody::ReverseBody::doStart(), KoduInterpreter::GrabActionRunner::PrepareBody::FaceObject::doStart(), KoduInterpreter::GrabActionRunner::GrabActionStart::IsObjectNear::doStart(), KoduInterpreter::DropActionRunner::ExecuteDrop::RepositionReleasedObject::RepositionObject::doStart(), KoduInterpreter::DropActionRunner::ExecuteDrop::RepositionReleasedObject::LookForObjectAgain::doStart(), KoduInterpreter::DropActionRunner::ExecuteDrop::RecordAprilTagPos::doStart(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::GetTagLocation::doStart(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::PrepareForAnotherGrasp::RepositionGripperObject::doStart(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::PrepareForAnotherGrasp::FindObjectAgain::doStart(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::PrepareForAnotherGrasp::RepositionBody::doStart(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::PrepareForItemRecovery::SetGrasperTarget::doStart(), Kodu::KoduConditionSee::evaluate(), Kodu::KoduConditionGot::evaluate(), and operator=().

The mininum travelling distance (including turns) to consider performing localization.

================================ Static initializations ================================ ///

Definition at line 155 of file KoduAgent.h.

Referenced by needsToLocalize().

Stores the page number the agent wants to switch to.

Definition at line 173 of file KoduAgent.h.

Referenced by KoduInterpreter::PageSwitchActionRunner::SwitchToNewPage::doStart(), hasNewPageNumber(), and operator=().

std::queue<std::string> Kodu::KoduAgent::playQueue

The queue of sound files the agent wants to play.

Definition at line 185 of file KoduAgent.h.

Referenced by KoduInterpreter::PlayActuator::doStart(), KoduInterpreter::PlayActionRunner::PlayStart::doStart(), hasSoundsToPlay(), and operator=().

The queue of score operations and their value.

Definition at line 179 of file KoduAgent.h.

Referenced by KoduInterpreter::ScoreActuator::doStart(), hasNewScoreChanges(), and operator=().

(flag) States if the target object is in the gripper

Definition at line 151 of file KoduAgent.h.

Referenced by Kodu::KoduConditionGot::evaluate(), isHoldingAnObject(), operator=(), and setTargetInGripperFlag().


The documentation for this class was generated from the following files:

Tekkotsu v5.1CVS
Generated Mon May 9 04:59:23 2016 by Doxygen 1.6.3