StateNode Class Reference
Recursive data structure - both a state machine controller as well as a node within a state machine itself.
More...
#include <StateNode.h>
Inherits BehaviorBase.
Inherited by DualCoding::Pilot, DualCoding::Pilot::ClearOldPath, DualCoding::Pilot::CollisionChecker, DualCoding::Pilot::CollisionDispatch, DualCoding::Pilot::ConstructNavPlan, DualCoding::Pilot::Dispatch, DualCoding::Pilot::ExecutePlan, DualCoding::Pilot::ExecutePlan::ExecuteStep, DualCoding::Pilot::ExecutePlan::NextTask, DualCoding::Pilot::GoToShapeMachine, DualCoding::Pilot::GoToShapeMachine::CheckParameters, DualCoding::Pilot::GoToShapeMachine::SetMaxTurn, DualCoding::Pilot::GoToShapeMachine::SetUpPlanNode, DualCoding::Pilot::LocalizationMachine, DualCoding::Pilot::LocalizationUtility, DualCoding::Pilot::LocalizationUtility::CheckEnoughLandmarks, DualCoding::Pilot::LocalizationUtility::ChooseGazePoints, DualCoding::Pilot::LocalizationUtility::Localize, DualCoding::Pilot::LocalizationUtility::PrepareForNextGazePoint, DualCoding::Pilot::LocalizationUtility::ReturnToInitialHeading, DualCoding::Pilot::PlanPath, DualCoding::Pilot::PushObjectMachine, DualCoding::Pilot::PushObjectMachine::AddAcquirePt, DualCoding::Pilot::PushObjectMachine::AddBackupPt, DualCoding::Pilot::PushObjectMachine::CheckObjectPos, DualCoding::Pilot::PushObjectMachine::CheckParameters, DualCoding::Pilot::PushObjectMachine::ChoosePathInitToObj, DualCoding::Pilot::PushObjectMachine::ChoosePathObjToDest, DualCoding::Pilot::PushObjectMachine::DisplayPathInitToObj, DualCoding::Pilot::PushObjectMachine::DisplayPathObjToDest, DualCoding::Pilot::PushObjectMachine::DisplayStraightLineInitToObj, DualCoding::Pilot::PushObjectMachine::DisplayStraightLineObjToDest, DualCoding::Pilot::PushObjectMachine::MoveObjectPos, DualCoding::Pilot::PushObjectMachine::SetMaxTurn, DualCoding::Pilot::PushObjectMachine::SetUpExecute2, DualCoding::Pilot::PushObjectMachine::SetUpInitToObj, DualCoding::Pilot::PushObjectMachine::SetUpObjToDest, DualCoding::Pilot::PushObjectMachine::SetUpObjToDest2, DualCoding::Pilot::ReportCompletion, DualCoding::Pilot::RunMotionModel, DualCoding::Pilot::RunOpticalFlow, DualCoding::Pilot::SetOdometryMachine, DualCoding::Pilot::SetupLandmarkExtractor, DualCoding::Pilot::SetVelocityMachine, DualCoding::Pilot::TerminateDueToCollision, DualCoding::Pilot::VisualSearchMachine, DualCoding::Pilot::VisualSearchMachine::Check, DualCoding::Pilot::WalkMachine, DualCoding::Pilot::WalkMachine::SetWalking, DualCoding::Pilot::WaypointWalkMachine, DualCoding::Pilot::WaypointWalkMachine::SetWalking, FFPlanNode, Grasper, Grasper::CloseTheGripper, Grasper::DoArmApproach, Grasper::DoArmDeliver, Grasper::GrasperFailed, Grasper::GrasperSucceeded, Grasper::IfRequestIs, Grasper::NextRequest, Grasper::OpenTheGripper, Grasper::PathPlanConstrained, Grasper::PathPlanToRest, Grasper::PlanArmApproach, Grasper::PlanArmDeliver, Grasper::PlanBodyApproach, Grasper::PlanBodyTransport, Grasper::Rest, Grasper::Rest::GetOpenGripperFlag, Grasper::Rest::GetRestType, Grasper::SignalGraspError, Grasper::Verify::CheckGripperLoad, Grasper::Verify::CheckUserVerify, Grasper::Verify::VerifyDispatch, GrasperNode, GroupNode, KoduInterpreter::CompleteSayActuator, KoduInterpreter::DropActionRunner, KoduInterpreter::DropActionRunner::DropActionEnd, KoduInterpreter::DropActionRunner::DropActionStart, KoduInterpreter::DropActionRunner::ExecuteDrop, KoduInterpreter::DropActionRunner::ExecuteDrop::RecordAprilTagPos, KoduInterpreter::DropActionRunner::ExecuteDrop::RepositionReleasedObject, KoduInterpreter::DropActionRunner::ExecuteDrop::RepositionReleasedObject::RepositionObject, KoduInterpreter::GiveActionRunner, KoduInterpreter::GiveActionRunner::GiveActionSend, KoduInterpreter::GiveActionRunner::GiveActionStart, KoduInterpreter::GrabActionRunner, KoduInterpreter::GrabActionRunner::ExecuteGrabAction, KoduInterpreter::GrabActionRunner::ExecuteGrabAction::CreateGripMonTask, KoduInterpreter::GrabActionRunner::ExecuteGrabAction::PrepareForAnotherGrasp, KoduInterpreter::GrabActionRunner::ExecuteGrabAction::PrepareForAnotherGrasp::NeedToLookAround, KoduInterpreter::GrabActionRunner::ExecuteGrabAction::PrepareForAnotherGrasp::RepositionGripperObject, KoduInterpreter::GrabActionRunner::ExecuteGrabAction::VerifyObjectWasGrabbed, KoduInterpreter::GrabActionRunner::ExecuteGrabAction::VerifyObjectWasGrabbed::VerifyObjectInGripper, KoduInterpreter::GrabActionRunner::GrabActionEnd, KoduInterpreter::GrabActionRunner::GrabActionStart, KoduInterpreter::GrabActionRunner::GrabActionStart::GetTagId, KoduInterpreter::GrabActionRunner::GrabActionStart::IsObjectNear, KoduInterpreter::GrabActionRunner::PrepareBody, KoduInterpreter::InitializeAgent, KoduInterpreter::InitializeAgent::CreateWorld, KoduInterpreter::InitializeAgent::OrganizeWorld, KoduInterpreter::InitializeAgent::ParseKode, KoduInterpreter::KoduActionRunner, KoduInterpreter::KoduConditionEvaluator, KoduInterpreter::KoduEventListener, KoduInterpreter::MotionActionRunner, KoduInterpreter::MotionActionRunner::ExecuteMotionAction, KoduInterpreter::MotionActionRunner::ExecuteMotionAction::CheckMotionType, KoduInterpreter::MotionActionRunner::ExecuteMotionAction::ExecuteSimpleMotion, KoduInterpreter::MotionActionRunner::ExecuteMotionAction::ExecuteSimpleMotion::CheckForValidTarget, KoduInterpreter::MotionActionRunner::ExecuteMotionAction::ExecuteSimpleMotion::CreateFinalApproachCommand, KoduInterpreter::MotionActionRunner::MotionEnd, KoduInterpreter::MotionActionRunner::MotionStart, KoduInterpreter::NotificationMonitor, KoduInterpreter::PageSwitchActionRunner, KoduInterpreter::PageSwitchActionRunner::PageSwitchEnd, KoduInterpreter::PageSwitchActionRunner::PageSwitchStart, KoduInterpreter::PageSwitchActionRunner::SwitchToNewPage, KoduInterpreter::PerceptualMultiplexor, KoduInterpreter::PerceptualMultiplexor::FailureRecovery, KoduInterpreter::PerceptualMultiplexor::FailureRecovery::EndRecovery, KoduInterpreter::PerceptualMultiplexor::FailureRecovery::LocalizeAgent, KoduInterpreter::PerceptualMultiplexor::FailureRecovery::LocalizeAgent::CreateLocalizeTask, KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery, KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::GetTagLocation, KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::InitiateManipRecovery, KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::InitiateManipRecovery::GetObjectInfo, KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::PrepareForAnotherGrasp, KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::PrepareForAnotherGrasp::NeedToLookAround, KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::PrepareForAnotherGrasp::RepositionGripperObject, KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::PrepareForItemRecovery, KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::PrepareForItemRecovery::SetGrasperTarget, KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::VerifyObjectWasGrabbed, KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::VerifyObjectWasGrabbed::VerifyObjectInGripper, KoduInterpreter::PerceptualMultiplexor::FailureRecovery::PauseInterpretation, KoduInterpreter::PerceptualMultiplexor::FailureRecovery::StartRecovery, KoduInterpreter::PerceptualMultiplexor::MapBuilderTaskRunner, KoduInterpreter::PerceptualMultiplexor::MapBuilderTaskRunner::ExamineMapBuilderResults, KoduInterpreter::PerceptualMultiplexor::MultiplexorEnd, KoduInterpreter::PerceptualMultiplexor::MultiplexorStart, KoduInterpreter::PerceptualMultiplexor::PilotTaskRunner, KoduInterpreter::PerceptualMultiplexor::PilotTaskRunner::SetTaskFailure, KoduInterpreter::PerceptualMultiplexor::PilotTaskRunner::SetTaskSuccess, KoduInterpreter::PlayActionRunner, KoduInterpreter::PlayActionRunner::PlayEnd, KoduInterpreter::PlayActionRunner::PlayStart, KoduInterpreter::PlayActuator, KoduInterpreter::ReceiveActionRunner, KoduInterpreter::ReceiveActionRunner::ReceiveActionEnd, KoduInterpreter::ReceiveActionRunner::ReceiveActionStart, KoduInterpreter::SayActuator, KoduInterpreter::ScoreActuator, KoduInterpreter::WalkMonitor, LGNode, LogNode, LookAtMarkers, LookAtMarkers::DummyFinish, MapBuilderNode, MCNodeBase, OutputNode, ParkArm, PilotNode, PostMachineCompletion, PostMachineFailure, PostMachineSuccess, PostStateCompletion, RecordMotionNode, ResetArm, ResetGripper, SoundNode, SpeechNode, TrackNode, and WalkToTargetNode.
Detailed Description
Recursive data structure - both a state machine controller as well as a node within a state machine itself.
Override setup() to build your own Transition and StateNode network if you want this node to contain a state machine.
Override doStart() / doStop() as you would a normal BehaviorBase subclass to have this node add some functionality of its own.
You can override setup to create a sub-network, as well as overriding doStart and doStop, in the same class.
See also the tutorial page on State Machines.
There are two StateNode templates in project/templates/ :
- statenode.h is intended for leaf nodes, which directly implement the execution of a task.
- statemachine.h is intended for nodes which contain a network of transitions and subnodes, which together solve the task.
Definition at line 31 of file StateNode.h.
List of all members.
Public Types |
enum | SuccessOrFailure { failureSignal = 0,
successSignal = 1
} |
| Values used in a SignalTrans for postStateSuccess and postStateFailure.
More...
|
Public Member Functions |
| StateNode () |
| constructor, class name from typeid is used as instance name
|
| StateNode (const std::string &name) |
| constructor, pass a name to use
|
virtual | ~StateNode () |
| destructor, removes references to its outgoing transitions (be careful of incoming ones - they're still around!), and calls removeReference() on subnodes
|
virtual Transition * | addTransition (Transition *trans) |
| Adds the specified StateTransition to the transition table.
|
std::vector< Transition * > & | getTransitions () |
| Returns the std::vector of transitions so you can modify them yourself if need be.
|
const std::vector< Transition * > & | getTransitions () const |
| Returns the const std::vector of transitions so you can read through them if need be.
|
virtual StateNode * | addNode (StateNode *node) |
| Adds a StateNode to nodes so it can be automatically dereferenced later, returns what it's passed (for convenience), calls addReference() on node. Also sets the node's parent to this if it is null.
|
template<class T > |
T * | addNode (T *node) |
| Adds a StateNode to nodes so it can be automatically dereferenced later, returns what it's passed (for convenience), calls addReference() on node. Also sets the node's parent to this if it is null.
|
std::vector< StateNode * > & | getNodes () |
| Returns the std::vector of sub-nodes so you can modify them yourself if need be.
|
const std::vector< StateNode * > & | getNodes () const |
| Returns the const std::vector of sub-nodes so you can read through them if need be.
|
void | setRetain (bool f) |
| Sets the retain flag - if not retained, will removeReference() subnodes upon stop() and recreate them on start (by calling setup()) - may be too expensive to be worth saving memory...
|
virtual void | start () |
| Transitions should call this when entering the state, so it can enable its transitions.
|
virtual void | setup () |
| This is called by start() when it should setup the network of subnodes (if any).
|
virtual void | stop () |
| Transitions should call this when leaving the state, so it can disable its transitions.
|
virtual void | teardown () |
| This is called by stop() when you should destruct subnodes.
|
virtual StateNode * | getParent () const |
| returns pointer to parent as a generic StateNode
|
template<class T > |
T * | getAncestor () const |
| returns a correctly typed pointer to ancestor of the specified type; user by $reference
|
template<class T > |
T * | parentAs () const |
| returns correctly typed pointer to parent for access to its members
|
virtual StateNode * | getChild (const std::string &name) const |
| returns node with specified name that is a child of this node
|
virtual StateNode * | getSibling (const std::string &name) const |
| returns node with specified name that is a child of parent, or of parent's parent, etc.
|
virtual void | setSpeechText (const std::string &text) |
| Set text to speak on node start.
|
Static Public Member Functions |
template<typename T > |
static const T | extractSignal (const EventBase *ev) |
| Extract data from a signal sent to this state via Transition::fire(const EventBase&).
|
template<typename T > |
static const T * | tryExtractSignal (const EventBase *ev) |
| Try to extract data from a signal sent to this state via Transition::fire(const EventBase&).
|
Protected Member Functions |
virtual void | postStateStart () |
| will post an activation event through stateMachineEGID, used when doStart() is called
|
virtual void | postStateStop () |
| will post an deactivation event through stateMachineEGID, used when doStop() is called
|
virtual void | postStateCompletion (float magnitude=0) |
| will post a status event through stateMachineEGID to signal "completion" of the node
|
virtual void | postStateFailure () |
| posts a DataEvent<SuccessOrFailure>(failure) indicating failure of the node; meaning of failure is used-defined
|
virtual void | postStateSuccess () |
| posts a DataEvent<SuccessOrFailure>(success) indicating success of the node; meaning of success is used-defined
|
virtual void | postParentCompletion () |
| Causes the parent state machine to complete; use this to return from a nested state machine.
|
virtual void | postParentFailure () |
| Causes the parent state machine to fail; use this to return failure from a nested state machine.
|
virtual void | postParentSuccess () |
| Causes the parent state machine to succeed; use this to return success from a nested state machine.
|
template<typename T > |
void | postParentSignal (const T &value=T()) |
| Causes the parent state machine to post a DataEvent through stateSignalEGID. value is optional.
|
template<typename T > |
void | postStateSignal (const T &value=T()) |
| Posts a DataEvent through stateSignalEGID that can be picked up by a SignalTrans. value is optional.
|
Protected Attributes |
StateNode * | parent |
| pointer to the machine that contains this node
|
std::vector< Transition * > | transitions |
| a vector of outgoing transitions
|
bool | issetup |
| this is set to true if the network has been setup but not destroyed (i.e. don't need to call setupSubNodes again)
|
bool | retain |
| this is set to true if the network should be retained between activations. Otherwise it's dereferenced upon doStop(). (or at least removeReference() is called on subnodes)
|
unsigned int | startedTime |
| the timestamp of last call to start()
|
std::vector< StateNode * > | nodes |
| vector of StateNodes, just so they can be dereferenced again on doStop() (unless retained) or ~StateNode()
|
StateNode * | startnode |
| starting node (should be a member of nodes)
|
std::string | speechText |
| Text to speak on node start (for debugging).
|
Private Member Functions |
| StateNode (const StateNode &node) |
| don't call this
|
StateNode | operator= (const StateNode &node) |
| don't call this
|
virtual void | DoStartEvent (struct __USE_doStart_AND_CHECK_event_NOT_DoStartEvent__ &) |
| temporary to produce warnings to help people update
|
Friends |
class | Transition |
Member Enumeration Documentation
Values used in a SignalTrans for postStateSuccess and postStateFailure.
- Enumerator:
failureSignal |
|
successSignal |
|
Definition at line 126 of file StateNode.h.
Constructor & Destructor Documentation
constructor, class name from typeid is used as instance name
Definition at line 35 of file StateNode.h.
Referenced by DualCoding::Pilot::setup(), DualCoding::Pilot::Dispatch::setup(), DualCoding::Pilot::SetVelocityMachine::setup(), DualCoding::Pilot::WaypointWalkMachine::setup(), DualCoding::Pilot::LocalizationUtility::setup(), KoduInterpreter::ReceiveActionRunner::ReceiveActionTurnAndGet::setup(), KoduInterpreter::DropActionRunner::ExecuteDrop::setup(), KoduInterpreter::InitializeAgent::setup(), Grasper::setup(), Grasper::CloseTheGripper::setup(), and Grasper::OpenTheGripper::setup().
StateNode::StateNode |
( |
const std::string & |
name |
) |
|
constructor, pass a name to use
Definition at line 40 of file StateNode.h.
StateNode::~StateNode |
( |
|
) |
[virtual] |
destructor, removes references to its outgoing transitions (be careful of incoming ones - they're still around!), and calls removeReference() on subnodes
Definition at line 8 of file StateNode.cc.
StateNode::StateNode |
( |
const StateNode & |
node |
) |
[private] |
Member Function Documentation
template<class T >
T* StateNode::addNode |
( |
T * |
node |
) |
|
Adds a StateNode to nodes so it can be automatically dereferenced later, returns what it's passed (for convenience), calls addReference() on node. Also sets the node's parent to this if it is null.
Definition at line 60 of file StateNode.h.
Referenced by addNode().
Adds a StateNode to nodes so it can be automatically dereferenced later, returns what it's passed (for convenience), calls addReference() on node. Also sets the node's parent to this if it is null.
Definition at line 30 of file StateNode.cc.
Referenced by DualCoding::Pilot::setup(), DualCoding::Pilot::Dispatch::setup(), DualCoding::Pilot::SetOdometryMachine::setup(), DualCoding::Pilot::VisualSearchMachine::setup(), DualCoding::Pilot::PushObjectMachine::setup(), DualCoding::Pilot::GoToShapeMachine::setup(), DualCoding::Pilot::SetVelocityMachine::setup(), DualCoding::Pilot::WaypointWalkMachine::setup(), DualCoding::Pilot::WalkMachine::setup(), DualCoding::Pilot::LocalizationMachine::setup(), DualCoding::Pilot::LocalizationUtility::setup(), DualCoding::Pilot::ExecutePlan::setup(), ParkArm::setup(), ResetGripper::setup(), ResetArm::setup(), LookAtMarkers::setup(), KoduInterpreter::PlayActionRunner::setup(), KoduInterpreter::PageSwitchActionRunner::setup(), KoduInterpreter::MotionActionRunner::setup(), KoduInterpreter::MotionActionRunner::ExecuteMotionAction::setup(), KoduInterpreter::MotionActionRunner::ExecuteMotionAction::ExecuteSimpleMotion::setup(), KoduInterpreter::ReceiveActionRunner::setup(), KoduInterpreter::ReceiveActionRunner::ReceiveActionTurnAndGet::setup(), KoduInterpreter::GiveActionRunner::setup(), KoduInterpreter::GiveActionRunner::PositionBody::setup(), KoduInterpreter::GrabActionRunner::setup(), KoduInterpreter::GrabActionRunner::ExecuteGrabAction::setup(), KoduInterpreter::GrabActionRunner::ExecuteGrabAction::PrepareForAnotherGrasp::setup(), KoduInterpreter::GrabActionRunner::ExecuteGrabAction::VerifyObjectWasGrabbed::setup(), KoduInterpreter::GrabActionRunner::PrepareBody::setup(), KoduInterpreter::GrabActionRunner::GrabActionStart::setup(), KoduInterpreter::DropActionRunner::setup(), KoduInterpreter::DropActionRunner::ExecuteDrop::setup(), KoduInterpreter::DropActionRunner::ExecuteDrop::RepositionReleasedObject::setup(), KoduInterpreter::PerceptualMultiplexor::setup(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::setup(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::LocalizeAgent::setup(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::setup(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::PrepareForAnotherGrasp::setup(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::VerifyObjectWasGrabbed::setup(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::PrepareForItemRecovery::setup(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::InitiateManipRecovery::setup(), KoduInterpreter::PerceptualMultiplexor::PilotTaskRunner::setup(), KoduInterpreter::PerceptualMultiplexor::MapBuilderTaskRunner::setup(), KoduInterpreter::InitializeAgent::setup(), Grasper::setup(), Grasper::CloseTheGripper::setup(), Grasper::OpenTheGripper::setup(), Grasper::Rest::setup(), Grasper::DoArmDeliver::setup(), Grasper::Verify::setup(), and Grasper::DoArmApproach::setup().
Adds the specified StateTransition to the transition table.
Definition at line 23 of file StateNode.cc.
Referenced by DualCoding::Pilot::setup(), DualCoding::Pilot::Dispatch::setup(), DualCoding::Pilot::SetOdometryMachine::setup(), DualCoding::Pilot::VisualSearchMachine::setup(), DualCoding::Pilot::PushObjectMachine::setup(), DualCoding::Pilot::GoToShapeMachine::setup(), DualCoding::Pilot::SetVelocityMachine::setup(), DualCoding::Pilot::WaypointWalkMachine::setup(), DualCoding::Pilot::WalkMachine::setup(), DualCoding::Pilot::LocalizationMachine::setup(), DualCoding::Pilot::LocalizationUtility::setup(), DualCoding::Pilot::ExecutePlan::setup(), ParkArm::setup(), ResetGripper::setup(), ResetArm::setup(), LookAtMarkers::setup(), KoduInterpreter::setup(), KoduInterpreter::PlayActionRunner::setup(), KoduInterpreter::PageSwitchActionRunner::setup(), KoduInterpreter::MotionActionRunner::setup(), KoduInterpreter::MotionActionRunner::ExecuteMotionAction::setup(), KoduInterpreter::MotionActionRunner::ExecuteMotionAction::ExecuteSimpleMotion::setup(), KoduInterpreter::ReceiveActionRunner::setup(), KoduInterpreter::ReceiveActionRunner::ReceiveActionTurnAndGet::setup(), KoduInterpreter::GiveActionRunner::setup(), KoduInterpreter::GiveActionRunner::PositionBody::setup(), KoduInterpreter::GrabActionRunner::setup(), KoduInterpreter::GrabActionRunner::ExecuteGrabAction::setup(), KoduInterpreter::GrabActionRunner::ExecuteGrabAction::PrepareForAnotherGrasp::setup(), KoduInterpreter::GrabActionRunner::ExecuteGrabAction::VerifyObjectWasGrabbed::setup(), KoduInterpreter::GrabActionRunner::PrepareBody::setup(), KoduInterpreter::GrabActionRunner::GrabActionStart::setup(), KoduInterpreter::DropActionRunner::setup(), KoduInterpreter::DropActionRunner::ExecuteDrop::setup(), KoduInterpreter::DropActionRunner::ExecuteDrop::RepositionReleasedObject::setup(), KoduInterpreter::PerceptualMultiplexor::setup(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::setup(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::setup(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::PrepareForAnotherGrasp::setup(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::VerifyObjectWasGrabbed::setup(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::PrepareForItemRecovery::setup(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::InitiateManipRecovery::setup(), KoduInterpreter::PerceptualMultiplexor::PilotTaskRunner::setup(), KoduInterpreter::PerceptualMultiplexor::MapBuilderTaskRunner::setup(), KoduInterpreter::InitializeAgent::setup(), Grasper::setup(), Grasper::CloseTheGripper::setup(), Grasper::OpenTheGripper::setup(), Grasper::Rest::setup(), Grasper::DoArmDeliver::setup(), Grasper::Verify::setup(), and Grasper::DoArmApproach::setup().
virtual void StateNode::DoStartEvent |
( |
struct __USE_doStart_AND_CHECK_event_NOT_DoStartEvent__ & |
|
) |
[private, virtual] |
temporary to produce warnings to help people update
Definition at line 193 of file StateNode.h.
template<typename T >
static const T StateNode::extractSignal |
( |
const EventBase * |
ev |
) |
[static] |
template<class T >
T * StateNode::getAncestor |
( |
|
) |
const |
returns a correctly typed pointer to ancestor of the specified type; user by $reference
Definition at line 196 of file StateNode.h.
StateNode * StateNode::getChild |
( |
const std::string & |
name |
) |
const [virtual] |
returns node with specified name that is a child of this node
Definition at line 38 of file StateNode.cc.
const std::vector<StateNode*>& StateNode::getNodes |
( |
|
) |
const |
Returns the const std::vector of sub-nodes so you can read through them if need be.
Definition at line 66 of file StateNode.h.
std::vector<StateNode*>& StateNode::getNodes |
( |
|
) |
|
virtual StateNode* StateNode::getParent |
( |
|
) |
const [virtual] |
StateNode * StateNode::getSibling |
( |
const std::string & |
name |
) |
const [virtual] |
const std::vector<Transition*>& StateNode::getTransitions |
( |
|
) |
const |
Returns the const std::vector of transitions so you can read through them if need be.
Definition at line 55 of file StateNode.h.
std::vector<Transition*>& StateNode::getTransitions |
( |
|
) |
|
Returns the std::vector of transitions so you can modify them yourself if need be.
Definition at line 52 of file StateNode.h.
template<class T >
T* StateNode::parentAs |
( |
|
) |
const |
returns correctly typed pointer to parent for access to its members
Definition at line 94 of file StateNode.h.
virtual void StateNode::postParentCompletion |
( |
|
) |
[protected, virtual] |
Causes the parent state machine to complete; use this to return from a nested state machine.
Definition at line 150 of file StateNode.h.
Referenced by PostMachineCompletion::doStart(), KoduInterpreter::PlayActionRunner::PlayEnd::doStart(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::EndRecovery::doStart(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::LocalizeAgent::CreateLocalizeTask::doStart(), KoduInterpreter::PerceptualMultiplexor::MultiplexorEnd::doStart(), KoduInterpreter::PerceptualMultiplexor::PilotTaskRunner::SetTaskFailure::doStart(), KoduInterpreter::PerceptualMultiplexor::PilotTaskRunner::SetTaskSuccess::doStart(), KoduInterpreter::PerceptualMultiplexor::MapBuilderTaskRunner::ExamineMapBuilderResults::doStart(), KoduInterpreter::PerceptualMultiplexor::MultiplexorStart::doStart(), Grasper::Verify::CheckUserVerify::doStart(), Grasper::Verify::CheckGripperLoad::doStart(), Grasper::Verify::CheckCross::doStart(), Grasper::Verify::CheckDomino::doStart(), and Grasper::Verify::CheckAprilTag::doStart().
virtual void StateNode::postParentFailure |
( |
|
) |
[protected, virtual] |
template<typename T >
void StateNode::postParentSignal |
( |
const T & |
value = T() |
) |
[protected] |
Causes the parent state machine to post a DataEvent through stateSignalEGID. value is optional.
Definition at line 159 of file StateNode.h.
virtual void StateNode::postParentSuccess |
( |
|
) |
[protected, virtual] |
void StateNode::postStateCompletion |
( |
float |
magnitude = 0 |
) |
[protected, virtual] |
will post a status event through stateMachineEGID to signal "completion" of the node
"completion" is defined by your subclass - will mean different things to different nodes depending on the actions they are performing. So call this yourself if there is a natural ending point for your state.
- Parameters:
-
| magnitude | the value to use for EventBase::magnitude -- generally is 1 for status events, but since this is to signal completion, 0 (the default) may be more appropriate; if your node is doing something repetitive however, 1 (or the loop count) may be better |
Definition at line 134 of file StateNode.cc.
Referenced by WaypointEngineNode< W, mcName, mcDesc >::doEvent(), TrackNode::doEvent(), SpeechNode::doEvent(), SoundNode::doEvent(), PilotNode::doEvent(), DualCoding::Pilot::SetOdometryMachine::TurnHead::doEvent(), MotionSequenceNode< SIZE >::doEvent(), MCNodeBase::doEvent(), MapBuilderNode::doEvent(), LookAtMarkers::Search::doEvent(), LookAtMarkers::TrackMarker::doEvent(), KoduInterpreter::ReceiveActionRunner::ReceiveActionStart::doEvent(), KoduInterpreter::GiveActionRunner::GiveActionStart::doEvent(), GrasperNode::doEvent(), FFPlanNode::doEvent(), DynamicMotionSequenceNode::doEvent(), PostStateCompletion::doStart(), DualCoding::Pilot::VisualSearchMachine::Check::doStart(), DualCoding::Pilot::LocalizationUtility::ReturnToInitialHeading::doStart(), DualCoding::Pilot::LocalizationUtility::PrepareForNextGazePoint::doStart(), DualCoding::Pilot::ExecutePlan::NextTask::doStart(), LookAtMarkers::SelectMarker::doStart(), KoduInterpreter::ScoreActuator::doStart(), KoduInterpreter::CompleteSayActuator::doStart(), KoduInterpreter::PlayActuator::doStart(), KoduInterpreter::PlayActionRunner::PlayEnd::doStart(), KoduInterpreter::PageSwitchActionRunner::PageSwitchEnd::doStart(), KoduInterpreter::PageSwitchActionRunner::SwitchToNewPage::doStart(), KoduInterpreter::PageSwitchActionRunner::PageSwitchStart::doStart(), KoduInterpreter::MotionActionRunner::MotionEnd::doStart(), KoduInterpreter::MotionActionRunner::MotionStart::doStart(), KoduInterpreter::ReceiveActionRunner::ReceiveActionEnd::doStart(), KoduInterpreter::ReceiveActionRunner::ReceiveActionTurnAndGet::Grab::doStart(), KoduInterpreter::GiveActionRunner::GiveActionSend::doStart(), KoduInterpreter::GiveActionRunner::Drop::doStart(), KoduInterpreter::GrabActionRunner::GrabActionEnd::doStart(), KoduInterpreter::GrabActionRunner::ExecuteGrabAction::CreateGripMonTask::doStart(), KoduInterpreter::GrabActionRunner::GrabActionStart::GetTagId::doStart(), KoduInterpreter::DropActionRunner::DropActionEnd::doStart(), KoduInterpreter::DropActionRunner::DropActionStart::doStart(), KoduInterpreter::KoduConditionEvaluator::doStart(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::InitiateManipRecovery::GetObjectInfo::doStart(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::PauseInterpretation::doStart(), KoduInterpreter::PerceptualMultiplexor::MultiplexorEnd::doStart(), KoduInterpreter::InitializeAgent::OrganizeWorld::doStart(), KoduInterpreter::InitializeAgent::CreateWorld::doStart(), Grasper::IfRequestIs::doStart(), Grasper::PathPlanToRest::doStart(), Grasper::PathPlanConstrained::doStart(), Grasper::PlanArmDeliver::doStart(), Grasper::PlanBodyTransport::doStart(), Grasper::ArmPulse::doStart(), Grasper::PlanArmApproach::doStart(), Grasper::PlanBodyApproach::doStart(), DualCoding::Pilot::Dispatch::finish(), Grasper::SetJoint::moveJoint(), postParentCompletion(), and SpeechNode::postStart().
virtual void StateNode::postStateFailure |
( |
|
) |
[protected, virtual] |
posts a DataEvent<SuccessOrFailure>(failure) indicating failure of the node; meaning of failure is used-defined
Definition at line 144 of file StateNode.h.
Referenced by TrackNode::cancelThisRequest(), PilotNode::cancelThisRequest(), MapBuilderNode::cancelThisRequest(), GrasperNode::cancelThisRequest(), GrasperNode::doEvent(), DualCoding::Pilot::PushObjectMachine::CheckObjectPos::doStart(), DualCoding::Pilot::PushObjectMachine::ChoosePathObjToDest::doStart(), DualCoding::Pilot::PushObjectMachine::ChoosePathInitToObj::doStart(), DualCoding::Pilot::LocalizationUtility::PrepareForNextGazePoint::doStart(), DualCoding::Pilot::LocalizationUtility::CheckEnoughLandmarks::doStart(), KoduInterpreter::PageSwitchActionRunner::SwitchToNewPage::doStart(), KoduInterpreter::MotionActionRunner::ExecuteMotionAction::ExecuteSimpleMotion::CreateFinalApproachCommand::doStart(), KoduInterpreter::ReceiveActionRunner::ReceiveActionTurnAndGet::Grab::doStart(), KoduInterpreter::GrabActionRunner::ExecuteGrabAction::PrepareForAnotherGrasp::RepositionGripperObject::doStart(), KoduInterpreter::GrabActionRunner::ExecuteGrabAction::VerifyObjectWasGrabbed::VerifyObjectInGripper::doStart(), KoduInterpreter::GrabActionRunner::GrabActionStart::IsObjectNear::doStart(), KoduInterpreter::DropActionRunner::ExecuteDrop::RepositionReleasedObject::RepositionObject::doStart(), KoduInterpreter::DropActionRunner::ExecuteDrop::RecordAprilTagPos::doStart(), KoduInterpreter::DropActionRunner::DropActionStart::doStart(), KoduInterpreter::KoduConditionEvaluator::doStart(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::GetTagLocation::doStart(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::PrepareForAnotherGrasp::RepositionGripperObject::doStart(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::VerifyObjectWasGrabbed::VerifyObjectInGripper::doStart(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::PrepareForItemRecovery::SetGrasperTarget::doStart(), KoduInterpreter::PerceptualMultiplexor::MultiplexorEnd::doStart(), KoduInterpreter::InitializeAgent::ParseKode::doStart(), KoduInterpreter::InitializeAgent::CreateWorld::doStart(), Grasper::PlanBodyTransport::doStart(), Grasper::PlanBodyApproach::doStart(), MCNodeBase::motionFails(), postParentFailure(), and FFPlanNode::postStart().
template<typename T >
void StateNode::postStateSignal |
( |
const T & |
value = T() |
) |
[protected] |
void StateNode::postStateStart |
( |
|
) |
[protected, virtual] |
void StateNode::postStateStop |
( |
|
) |
[protected, virtual] |
will post an deactivation event through stateMachineEGID, used when doStop() is called
Definition at line 130 of file StateNode.cc.
Referenced by stop().
virtual void StateNode::postStateSuccess |
( |
|
) |
[protected, virtual] |
posts a DataEvent<SuccessOrFailure>(success) indicating success of the node; meaning of success is used-defined
Definition at line 147 of file StateNode.h.
Referenced by DualCoding::Pilot::PushObjectMachine::CheckObjectPos::doStart(), DualCoding::Pilot::PushObjectMachine::ChoosePathObjToDest::doStart(), DualCoding::Pilot::PushObjectMachine::ChoosePathInitToObj::doStart(), DualCoding::Pilot::PushObjectMachine::AddAcquirePt::doStart(), DualCoding::Pilot::PushObjectMachine::AddBackupPt::doStart(), DualCoding::Pilot::LocalizationUtility::CheckEnoughLandmarks::doStart(), DualCoding::Pilot::ExecutePlan::NextTask::doStart(), KoduInterpreter::MotionActionRunner::ExecuteMotionAction::ExecuteSimpleMotion::CreateFinalApproachCommand::doStart(), KoduInterpreter::GrabActionRunner::ExecuteGrabAction::PrepareForAnotherGrasp::RepositionGripperObject::doStart(), KoduInterpreter::GrabActionRunner::ExecuteGrabAction::VerifyObjectWasGrabbed::VerifyObjectInGripper::doStart(), KoduInterpreter::GrabActionRunner::GrabActionStart::IsObjectNear::doStart(), KoduInterpreter::DropActionRunner::ExecuteDrop::RepositionReleasedObject::RepositionObject::doStart(), KoduInterpreter::DropActionRunner::ExecuteDrop::RecordAprilTagPos::doStart(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::GetTagLocation::doStart(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::PrepareForAnotherGrasp::RepositionGripperObject::doStart(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::PrepareForItemRecovery::SetGrasperTarget::doStart(), KoduInterpreter::InitializeAgent::ParseKode::doStart(), Grasper::IfRequestIs::doStart(), and postParentSuccess().
void StateNode::setRetain |
( |
bool |
f |
) |
|
Sets the retain flag - if not retained, will removeReference() subnodes upon stop() and recreate them on start (by calling setup()) - may be too expensive to be worth saving memory...
Definition at line 69 of file StateNode.h.
virtual void StateNode::setSpeechText |
( |
const std::string & |
text |
) |
[virtual] |
Set text to speak on node start.
Definition at line 103 of file StateNode.h.
virtual void StateNode::setup |
( |
|
) |
[virtual] |
This is called by start() when it should setup the network of subnodes (if any).
Reimplemented in Grasper::DoArmApproach, Grasper::DoArmDeliver, Grasper::Rest, Grasper::OpenTheGripper, Grasper::CloseTheGripper, Grasper, ResetArm, ResetGripper, ParkArm, DualCoding::Pilot::ExecutePlan, DualCoding::Pilot::LocalizationUtility, DualCoding::Pilot::LocalizationMachine, DualCoding::Pilot::WalkMachine, DualCoding::Pilot::WaypointWalkMachine, DualCoding::Pilot::SetVelocityMachine, DualCoding::Pilot::GoToShapeMachine, DualCoding::Pilot::PushObjectMachine, DualCoding::Pilot::VisualSearchMachine, DualCoding::Pilot::SetOdometryMachine, DualCoding::Pilot::Dispatch, DualCoding::Pilot, KoduInterpreter::InitializeAgent, KoduInterpreter::PerceptualMultiplexor::MapBuilderTaskRunner, KoduInterpreter::PerceptualMultiplexor::PilotTaskRunner, KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::InitiateManipRecovery, KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::PrepareForItemRecovery, KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::VerifyObjectWasGrabbed, KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::PrepareForAnotherGrasp, KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery, KoduInterpreter::PerceptualMultiplexor::FailureRecovery::LocalizeAgent, KoduInterpreter::PerceptualMultiplexor::FailureRecovery, KoduInterpreter::PerceptualMultiplexor, KoduInterpreter::DropActionRunner::ExecuteDrop::RepositionReleasedObject, KoduInterpreter::DropActionRunner::ExecuteDrop, KoduInterpreter::DropActionRunner, KoduInterpreter::GrabActionRunner::GrabActionStart, KoduInterpreter::GrabActionRunner::PrepareBody, KoduInterpreter::GrabActionRunner::ExecuteGrabAction::VerifyObjectWasGrabbed, KoduInterpreter::GrabActionRunner::ExecuteGrabAction::PrepareForAnotherGrasp, KoduInterpreter::GrabActionRunner::ExecuteGrabAction, KoduInterpreter::GrabActionRunner, KoduInterpreter::GiveActionRunner, KoduInterpreter::ReceiveActionRunner, KoduInterpreter::MotionActionRunner::ExecuteMotionAction::ExecuteSimpleMotion, KoduInterpreter::MotionActionRunner::ExecuteMotionAction, KoduInterpreter::MotionActionRunner, KoduInterpreter::PageSwitchActionRunner, KoduInterpreter::PlayActionRunner, and LookAtMarkers.
Definition at line 75 of file StateNode.h.
Referenced by start().
void StateNode::start |
( |
|
) |
[virtual] |
Transitions should call this when entering the state, so it can enable its transitions.
This could be implemented slightly more simply as a pre/postStart() pair, but keeping our specialization in start() itself allows us to keep pre/postStart empty (thus more robust to subclass overrides forgetting to call their superclass version, but also avoids any potential subclass mis-handling of transition fire while in preStart)
Reimplemented from BehaviorBase.
Definition at line 62 of file StateNode.cc.
Referenced by Grasper::dispatch(), DualCoding::Pilot::Dispatch::doStart(), KoduInterpreter::PageSwitchActionRunner::PageSwitchEnd::doStart(), KoduInterpreter::ReceiveActionRunner::ReceiveActionTurnAndGet::Grab::doStart(), KoduInterpreter::GiveActionRunner::Drop::doStart(), KoduInterpreter::KoduActionRunner::doStart(), KoduInterpreter::KoduConditionEvaluator::doStart(), KoduInterpreter::PerceptualMultiplexor::MultiplexorEnd::doStart(), OutputNode::postStart(), and start().
void StateNode::stop |
( |
|
) |
[virtual] |
Transitions should call this when leaving the state, so it can disable its transitions.
Reimplemented from BehaviorBase.
Reimplemented in LedActivate, LogNode, MCNodeBase, RecordMotionNode, SoundNode, SpeechNode, WalkNode, WaypointEngineNode< W, mcName, mcDesc >, PilotNode, TrackNode, and KoduInterpreter::MotionActionRunner.
Definition at line 96 of file StateNode.cc.
Referenced by LookAtMarkers::DummyFinish::doStart(), KoduInterpreter::PageSwitchActionRunner::PageSwitchStart::doStart(), Grasper::NextRequest::doStart(), Grasper::doStop(), and OutputNode::postStart().
void StateNode::teardown |
( |
|
) |
[virtual] |
This is called by stop() when you should destruct subnodes.
Default implementation will take care of the subnodes and their transitions, you only need to worry about any *other* memory which may have been allocated. If none, you may not need implement this function at all.
Definition at line 117 of file StateNode.cc.
Referenced by stop(), and ~StateNode().
template<typename T >
static const T* StateNode::tryExtractSignal |
( |
const EventBase * |
ev |
) |
[static] |
Friends And Related Function Documentation
Member Data Documentation
starting node (should be a member of nodes)
Definition at line 185 of file StateNode.h.
Referenced by DualCoding::Pilot::setup(), DualCoding::Pilot::Dispatch::setup(), DualCoding::Pilot::SetOdometryMachine::setup(), DualCoding::Pilot::VisualSearchMachine::setup(), DualCoding::Pilot::PushObjectMachine::setup(), DualCoding::Pilot::GoToShapeMachine::setup(), DualCoding::Pilot::SetVelocityMachine::setup(), DualCoding::Pilot::WaypointWalkMachine::setup(), DualCoding::Pilot::WalkMachine::setup(), DualCoding::Pilot::LocalizationMachine::setup(), DualCoding::Pilot::LocalizationUtility::setup(), DualCoding::Pilot::ExecutePlan::setup(), ParkArm::setup(), ResetGripper::setup(), ResetArm::setup(), LookAtMarkers::setup(), KoduInterpreter::PlayActionRunner::setup(), KoduInterpreter::PageSwitchActionRunner::setup(), KoduInterpreter::MotionActionRunner::setup(), KoduInterpreter::MotionActionRunner::ExecuteMotionAction::setup(), KoduInterpreter::MotionActionRunner::ExecuteMotionAction::ExecuteSimpleMotion::setup(), KoduInterpreter::ReceiveActionRunner::setup(), KoduInterpreter::ReceiveActionRunner::ReceiveActionTurnAndGet::setup(), KoduInterpreter::GiveActionRunner::setup(), KoduInterpreter::GiveActionRunner::PositionBody::setup(), KoduInterpreter::GrabActionRunner::setup(), KoduInterpreter::GrabActionRunner::ExecuteGrabAction::setup(), KoduInterpreter::GrabActionRunner::ExecuteGrabAction::PrepareForAnotherGrasp::setup(), KoduInterpreter::GrabActionRunner::ExecuteGrabAction::VerifyObjectWasGrabbed::setup(), KoduInterpreter::GrabActionRunner::PrepareBody::setup(), KoduInterpreter::GrabActionRunner::GrabActionStart::setup(), KoduInterpreter::DropActionRunner::setup(), KoduInterpreter::DropActionRunner::ExecuteDrop::setup(), KoduInterpreter::DropActionRunner::ExecuteDrop::RepositionReleasedObject::setup(), KoduInterpreter::PerceptualMultiplexor::setup(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::setup(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::LocalizeAgent::setup(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::setup(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::PrepareForAnotherGrasp::setup(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::VerifyObjectWasGrabbed::setup(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::PrepareForItemRecovery::setup(), KoduInterpreter::PerceptualMultiplexor::FailureRecovery::ObjectManipRecovery::InitiateManipRecovery::setup(), KoduInterpreter::PerceptualMultiplexor::PilotTaskRunner::setup(), KoduInterpreter::PerceptualMultiplexor::MapBuilderTaskRunner::setup(), KoduInterpreter::InitializeAgent::setup(), Grasper::setup(), Grasper::CloseTheGripper::setup(), Grasper::OpenTheGripper::setup(), Grasper::Rest::setup(), Grasper::DoArmDeliver::setup(), Grasper::Verify::setup(), Grasper::DoArmApproach::setup(), start(), and teardown().
The documentation for this class was generated from the following files:
|