| Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
Controller Class Reference#include <Controller.h>
Inheritance diagram for Controller: ![]() Detailed DescriptionHandles the menu/command system... when it detects the EmergencyStopMC is activated, it'll kick into high priority.
Keeps track of a command stack. A Control can designate another sub-control, which will receive events until it finishes The GUI uses the same commands as the user (makes it much easier to have only one parser). The commands are:
In return, to send the menus to the GUI, the following messages are sent: (newlines are required where shown)
bool types are expected to be numerical values, 0 for false, non-zero for true.
The upstream is the responsibility of the individual Controls, but the protocol is listed here to keep it together. When a control's state changes, it's that control's responsiblity to refresh the UI (LEDs, console, and GUI as appropriate). Thus, future extensions to the upstream protocol are between the control which will use it and the GUI. Future extensions to the downstream protocol would involve changing Controller and the GUI. The Controller may connect to serr in the future to pop-up an alert anytime output to serr occurs. Note that all state is maintained on the robot - even if the GUI is connected, you can still use the buttons to interact with the controller, and the GUI will update to reflect the changes. In HCI (Human Computer Interaction) parlance, this is the MVC, Model-View-Controller architecture, almost by necessity. (HCI happens to be my double major when I was an undergrad ;) Also, the Controller is responsible for sending out TextMsgEvents from user input it receives - either a !msg command from the console or GUI, or any text at all which is received on the console if there is already a GUI connected. These TextMsgEvents are always status events, and the duration field is always 0.
Definition at line 102 of file Controller.h.
Constructor & Destructor Documentation
shouldn't be called...
Member Function Documentation
called when the estop switches on causes the top control to activate, registers for button events Definition at line 527 of file Controller.cc. Referenced by processEvent().
returns true when the current time and last time are in different periods
Definition at line 193 of file Controller.h. Referenced by trapEvent().
returns true if a valid control is available on the stack if the stack is empty, will push root if it's non-null Definition at line 547 of file Controller.cc. Referenced by activate(), push(), refresh(), takeLine(), and trapEvent().
calls close() on a Java object loaded with loadGUI() (on the desktop)
Definition at line 204 of file Controller.cc. Referenced by SegCamBehavior::closeServer(), RegionCamBehavior::closeServer(), RawCamBehavior::closeServer(), WorldStateSerializerBehavior::DoStop(), WalkControllerBehavior::DoStop(), ViewWMVarsBehavior::DoStop(), UPennWalkControllerBehavior::DoStop(), HeadPointControllerBehavior::DoStop(), and Aibo3DControllerBehavior::DoStop().
called by wireless when someone has entered new data on the tekkotsu console (NOT cin)
Definition at line 243 of file Controller.cc.
called when the estop switches off causes the top control to deactivate, stops listening for buttons Definition at line 537 of file Controller.cc. Referenced by processEvent().
register for events and resets the cmdstack
Reimplemented from BehaviorBase. Definition at line 32 of file Controller.cc.
stop listening for events and resets the cmdstack
Reimplemented from BehaviorBase. Definition at line 53 of file Controller.cc.
Gives a short description of what this class of behaviors does... you should override this (but don't have to). If you do override this, also consider overriding getDescription() to return it Reimplemented from BehaviorBase. Definition at line 138 of file Controller.h. Referenced by getDescription().
Gives a short description of what this particular instantiation does (in case a more specific description is needed on an individual basis). By default simply returns getName(), because any calls from a BehaviorBase function to getClassDescription() are going to call BehaviorBase::getClassDescription(), not ~YourSubClass~getClassDescription(), because static functions can't be virtual in C++ (doh!) This means that getDescription called on a pointer to a BehaviorBase of unknown subtype would always return an empty string, which is pretty useless. So instead we return the name in this situation. If you want getDescription to return getClassDescription, you'll have to override it in your subclass to do so. Reimplemented from BehaviorBase. Definition at line 139 of file Controller.h.
called by wireless when there's new data from the GUI
Definition at line 212 of file Controller.cc. Referenced by DoStart().
assigns appropriate values to the static event bases
Definition at line 285 of file Controller.cc. Referenced by Controller().
attempts to open a Java object on the desktop
Definition at line 142 of file Controller.h. Referenced by WorldStateSerializerBehavior::DoStart(), WalkControllerBehavior::DoStart(), ViewWMVarsBehavior::DoStart(), UPennWalkControllerBehavior::DoStart(), HeadPointControllerBehavior::DoStart(), Aibo3DControllerBehavior::DoStart(), WalkCalibration::err(), SegCamBehavior::setupServer(), RegionCamBehavior::setupServer(), and RawCamBehavior::setupServer().
shouldn't be called...
just for e-stop activation/deactivation
Reimplemented from BehaviorBase. Definition at line 125 of file Controller.cc.
puts a new control on top
Definition at line 151 of file Controller.cc. Referenced by chkCmdStack(), and setNext().
refreshes the display, for times like sub-control dying, the previous control needs to reset it's display
Definition at line 145 of file Controller.cc. Referenced by pop(), reset(), setRoot(), and takeLine().
will take the command stack back down to the root
Definition at line 135 of file Controller.cc. Referenced by DoStart(), DoStop(), setRoot(), and takeLine().
called with slots (options), a name to lookup; will select the named control
Definition at line 317 of file Controller.cc. Referenced by takeLine().
sets a config value - some values may require additional processing (done here) to have the new values take effect
Definition at line 498 of file Controller.cc. Referenced by takeLine().
Sets the emergency stop MC to monitor for pausing.
maintains top Control
Definition at line 519 of file Controller.cc. Referenced by push(), select(), takeLine(), and trapEvent().
called with each line that's entered on the tekkotsu console or from the GUI
Definition at line 339 of file Controller.cc. Referenced by console_callback(), and gui_comm_callback().
passes an event to the top control
Implements EventTrapper. Definition at line 73 of file Controller.cc.
Member Data Documentation
if doReadStdIn() was already called, but the buttons are both still down
Definition at line 208 of file Controller.h. Referenced by trapEvent().
event masks used by processEvent()
Definition at line 120 of file Controller.h. Referenced by init(), and trapEvent().
the stack of the current control hierarchy
Definition at line 190 of file Controller.h. Referenced by activate(), chkCmdStack(), deactivate(), pop(), push(), refresh(), reset(), setNext(), takeLine(), top(), and trapEvent().
the time of the current event (do*() can check this instead of calling get_time() )
Definition at line 203 of file Controller.h. Referenced by trapEvent().
invalid_MC_ID if not active, otherwise id of high priority LEDs
Definition at line 180 of file Controller.h. Referenced by activate(), chkCmdStack(), deactivate(), DoStart(), DoStop(), and push().
the EmergencyStopMC MC_ID that this Controller is monitoring
Definition at line 183 of file Controller.h.
the socket to listen on for the gui
Definition at line 211 of file Controller.h. Referenced by activate(), chkCmdStack(), closeGUI(), console_callback(), DoStart(), DoStop(), loadGUI(), pop(), push(), and takeLine().
true if the Controller is currently active (in the activate()/deactivate() sense, not DoStart()/DoStop() sense - use isActive() for that...)
Definition at line 209 of file Controller.h. Referenced by activate(), deactivate(), DoStart(), processEvent(), and takeLine().
the duration of the last next event (nextItem)
Definition at line 205 of file Controller.h. Referenced by trapEvent().
the magnitude of the last next event (nextItem)
Definition at line 204 of file Controller.h. Referenced by trapEvent().
event masks used by processEvent()
Definition at line 115 of file Controller.h. Referenced by init(), and trapEvent().
event masks used by processEvent()
Definition at line 117 of file Controller.h. Referenced by init(), and trapEvent().
the duration of the last prev event (prevItem)
Definition at line 207 of file Controller.h. Referenced by trapEvent().
the magnitude of the last prev event (prevItem)
Definition at line 206 of file Controller.h. Referenced by trapEvent().
event masks used by processEvent()
Definition at line 116 of file Controller.h. Referenced by init(), and trapEvent().
event masks used by processEvent()
Definition at line 118 of file Controller.h. Referenced by init(), and trapEvent().
the base control, if cmdstack underflows, it will be reset to this
Definition at line 186 of file Controller.h. Referenced by chkCmdStack(), setRoot(), takeLine(), and ~Controller().
event masks used by processEvent()
Definition at line 119 of file Controller.h. Referenced by init(), and trapEvent().
currently can't pull connection socket off of server socket, so only one Controller
Definition at line 212 of file Controller.h. Referenced by closeGUI(), console_callback(), DoStart(), DoStop(), gui_comm_callback(), loadGUI(), pop(), push(), takeLine(), and ~Controller().
The documentation for this class was generated from the following files: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Tekkotsu v3.0 |
Generated Wed Oct 4 00:04:58 2006 by Doxygen 1.4.7 |