public class CreateBounce extends iRobotCreate
iRobotCreate
to add the behaviour of "bouncing"
about the environment by backing up slightly, turning, and driving away
whenever a corporeal object or a cliff is encountered.iRobotCreate.CommandQMonitor
TransientAgent.NewAgentLispCommand
AbstractProcess.Subthread
Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
private long |
checkForStallAngle |
private long |
checkForStallDistance |
private long |
checkForStallFlag
used by
checkForStall() to prevent checking too often |
angleAcc, breathing, buttonAdvance, buttonColor, buttonIntensity, buttonPlay, C_ModeOperatingDefault, commandQMonitor, distanceAcc, inStream, inStreamName, lastBreath, outStream, outStreamName, readFailures, robotReady, robotSim, rxtxPort, SENSOR_READ_INTERVAL, SENSOR_READ_WAITTIME, sensorCache, sensorCacheLastUpdate, serialInterface, shouldStop, sim, successfullReads, velocity, windows
agentConstructorComplete, properties
cacheKB, CDInvitedTo, CDinvitee, conversationData, defaultOntologyClassName, DEFER_ACTION, DROP_ACTION, kBase, ListOfArgs, ontologyEngineCreateMethod, ontologyEngineLoadMethod, policies, policiesAlwaysApply, policiesLastResort, primaryUI, proxy, UIs, usingProxy
huntForPort, initParams, ontology, ontologyShared, options, securityFilter, trace, TRACE_MONITOR, TRACE_OFF, TRACE_ON, TRACE_TO_FILE, TRACE_UNDEFINED, uniqueThreadName, waitingForAgentToStart
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
CreateBounce(ParamsMap params,
AgentUI ui)
Typical Agent constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkForStall()
Check to see if we've moved every 10 seconds.
|
protected void |
checkSensors()
Extends the checking done by the super to turn 90 or 180 degrees in
the appropriate direction if our cliff, bump, or overcurrent sensors are
activated.
|
void |
go(short velocity) |
protected void |
turnAndGo(double theAngle,
short velocity)
Backup a little, turn in place, and go
|
breathing, concat, concat, dock, doDemo, doRobotStuff, drive, drive, drive, drive, executeP, executeRaw, executeRaw, executeRawBypass, executeRawBypassAndFlush, finishRun, formatBytes, formatUnsigned, formatUnsigned, getExtraSensor, getExtraSensorCount, getExtraSensorName, getInterpretedBytes, getMode, getSensorBumps, getSensorCliff, getSensorWheelOvercurrent, initializeThread, loadScript2RobotAndPlayIt, main, makeDefaultInternalFrame, makeShort, moveBy, pendingFinishRun, perform_setMode, readSensor, readSensorList, resetAngleAcc, resetDistanceAcc, resetRobot, rotate, rotateAngle, rotateAngle, setMode, shortsToBytes, startupActions, stopMotors, updateKB, updateSensorPacketList, updateSensorPackets, writeRobotStream
destroyDataObject, finalize, getAgentOptions, getBooleanProperty, getCASAFilename, getCreateDate, getDataObject, getDataObjectInputStream, getDataObjectOutputStream, getDoubleProperty, getFloatProperty, getIntegerProperty, getLongProperty, getOptions, getStringProperty, hasProperty, initializeAfterRegistered, isPersistent, makeDefaultGUI, makeOptions, putDataObject, putDataObject, readPersistent, ready, realizeAgentBehaviourFromOptions, removeProperty, setBooleanProperty, setDoubleProperty, setFloatProperty, setIntegerProperty, setLongProperty, setOptions, setPersistent, setStringProperty, updateOptions, writePersistent
abclEval, abclEval, abclEval, accept_deleteCD, accept_exit, accept_forward_message, accept_LAC_closing, accept_new_MenuItem, accept_update, acceptDefault, addConversation, addJoinedCooperationDomain, addMembers, addSubscribeEvents, assembleDefault, assert_, assert_, authorizedByProxy, authorizeMessage, chooseSC, concludeDefault, consider_execute, consider_invite_to_cd, consider_new_MenuItem, consider_ping, consider_query_if, consider_query_ref, considerDefault, createCasaLispOperators, dispatchMsgHandlerMethod, doAddObserver, doAdvertise, doCDGetHistory_sync, doCDGetMembers, doCDPutData, doCDSubscribeMembership, doFindInstances_sync, doGetCooperationDomains, doGetOnology, doInviteToCD, doJoinCD, doPing_sync, doPing, doRegisterAgentInstance, doRegisterAgentInstance, doResolveURL, doSearchYP, doUnadvertise, doUnregisterAgentInstance, doUnregisterAgentType, doWithdrawCD, evaluateDefault, evesdrop, executeCommand, findFileResourcePath, findFileResourcePath, getAgentForThread, getAlwaysApplyPolicies, getBanner, getCachedKnowledgeBase, getChosenCommitment, getCommitmentProcessor, getConversation, getConversations, getConversationsReport, getDefaultBanner, getDefFileSystemLocations, getEventForThread, getField, getInstancesFound, getJoinedCooperationDomain, getJoinedCooperationDomains, getKnowledgeBase, getLACURL, getLastResortPolicies, getMembers, getMsgForThread, getObjectsForThread, getOntology, getOntologyEngine, getOntologyFileSuffix, getPolicies, getPrimaryUI, getProxy, getSCStore, getSerializedOntology, getStrategy, getStrategyGUI, getSubscribeEvents, getSubscribeEvents, getTermsFromContent, getUI, getUIForThread, getUIs, getUnfulfilledSocialCommitments, getUnfulfilledSocialCommitments, handleErrorReplies, handleEvent, handleLACClosing, hasActiveCommitments, hasConversation, hasStrategyGUI, initializePolicies, initJADE, initUI, isEventQueueReady, isRegistered, isRegisteredWithLAC, isStoppable, isTrusted, isTrusted, isUsingProxy, kb_get_value, makeDefaultInterface, makeDefaultTextInterface, monitorDefault, notifySendingMessage, optionsToString, parseJADENode, pendingFinishRun_unregisterAgentInstance, pendingFinishRun_withdrawFromAllCDs, perform_execute, perform_FIPAStyle, perform_get_name, perform_get_ontology, perform_invite_to_cd, perform_method_call, perform_query_if, perform_query_if, perform_query_ref, perform_query_ref, performDefault, processCommitment, processCommitments, processObserverNotification, putExtendedOntology, putPolicy, putPolicyAlwaysApply, putPolicyLastResort, putReplacementOntology, putUI, query_ref, query_toString, query, queryIf, queryRef_toIntegerList, queryRef_toString, queryRef_toStringList, queryRef_toTermList, queryRef, queryRef, queryRefAIDs, queryRefURLs, querywithFilter, recursiveParent, recursivePermutations, release_execute, release_FIPAStyle, release_get_agents_registered, release_get_agents_running, release_get_members, release_get_ontology, release_join_cd, release_ping, release_query_if, release_query_ref, release_resolve_url, release_unregister_agentType, release_unregister_instance, release_withdraw_cd, releaseDefault, removeConversation, removeCooperationDomains, removeJoinedCooperationDomain, removeSubscribeEvents, requestInstances, resolveConnectException, retrieveReturnedData, saveReturnedData, searchOntology, searchOntology1, setBanner, setCommitmentProcessor, setField, setInstancesFound, setOntology, shouldDoExecuteRequest, template_handleNewOntologyInfo, update, updateConversationProtocolType, verifyCD, verifyDefault, verifyMessage
addObserver, addObserver, addObserver, addObserver, addTraceTags, addTransformation, bump, clearAllTraceTags, closePort, compareTo, countObservers, defer, defer, deleteObserver, deleteObserver, deleteObservers, dequeueEvent, equals, eventBufferLoopBody, eventBufferLoopPeriodic, eventQueuePeek, existed, exit, fixupMessage, getAgent, getAgentName, getEventQueue, getInitParams, getNewMessage, getNewMessage, getPort, getSocketServer, getTrace, getTraceTags, getTransformationFor, getUniqueRequestID, getURL, getUseAckProtocol, getUsePriority, hasChanged, hasOpenPort, in, initializeConstructor, initializeURL, isA, isA, isA, isA, isAAct, isAAct, isAgentThread, isAPerformative, isAPerformative, isExiting, isInitialized, isLoggingTag, isObserveMessages, isPaused, isThisMyAddress, isTracing, loadClass, makeSubthread, makeSubthread, makeTraceParam, notifyObservers, notifyObservers, notifyObserversWithNoArg, notifyObserversWithTop, out, println, println, println, println, println, queueEvent, queueEventIf, removeTraceTags, resetRuntimeOptionsFromCommandLine, resetSecurityPackage, resetTraceOptions, revTransform, revTransform, run, sendMessage, sendMessage, sendMessageAndWait, sendQueryAndWait, sendRequestAndWait, sendRequestAndWait, setAllTraceTags, setObserveMessages, setPause, setTraceTags, setTracing, setURL, setUseAckProtocol, setUsePriority, startSocketServer, startTraceMonitor, step, transform, transform, unhandledMessage
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
getClass, hashCode, notify, notifyAll, wait, wait, wait
doAdvertise, doCDGetHistory_sync, doCDGetMembers, doCDPutData, doFindInstances_sync, doGetCooperationDomains, doGetOnology, doInviteToCD, doJoinCD, doPing_sync, doPing, doRegisterAgentInstance, doRegisterAgentInstance, doSearchYP, doUnadvertise, doUnregisterAgentInstance, doUnregisterAgentType, doWithdrawCD, executeCommand, getInstancesFound, getJoinedCooperationDomains, getLACURL, getMembers, getOntology, getSerializedOntology, getStrategyGUI, hasStrategyGUI, isAAct, isInitialized, isRegistered, makeDefaultInterface, putExtendedOntology, putReplacementOntology, putUI, release_get_ontology, removeCooperationDomains, requestInstances
addObserver, addObserver, closePort, deleteObserver, deleteObserver, exit, getAgentName, getName, getNewMessage, getPort, getStrategy, getTrace, getUniqueRequestID, getURL, getUseAckProtocol, hasOpenPort, isA, isAPerformative, isExiting, isLoggingTag, isStoppable, isTracing, println, println, println, sendMessage, setTracing, setUseAckProtocol, startTraceMonitor
addObserver, addObserver, countObservers, deleteObservers, hasChanged, notifyObservers, notifyObservers, notifyObserversWithNoArg, notifyObserversWithTop
abclEval, abclEval, abclEval, addTransformation, bump, chooseSC, defer, dequeueEvent, dispatchMsgHandlerMethod, evesdrop, getKnowledgeBase, getName, getSCStore, getSubscribeEvents, getTransformationFor, getUniqueRequestID, getURL, getUseAckProtocol, isA, isA, isA, isA, isAPerformative, isAPerformative, isLoggingTag, notifyObservers, println, println, println, queueEvent, queueEventIf, revTransform, revTransform, sendMessage, transform, transform
private long checkForStallFlag
checkForStall()
to prevent checking too oftenprivate long checkForStallDistance
private long checkForStallAngle
public CreateBounce(ParamsMap params, AgentUI ui) throws Exception, FileNotFoundException, InstantiationException
Qualifiers
has I and O
(Input and Output filenames) qualifiers, which will be interpreted as (the)
filename(s) for communication to either a real robot or a simulation of one.
If I and O are two different (not necessarily already existing)
filenames this class will use the simulator RobotSimulator
instead of the real thing. If I and O are the same, it should be serial device file description
connected to a real robot.IPSocketException
- if we can't get an IPSocketFileNotFoundException
- if we can't open the files specified by the I and O command line argumentsInstantiationException
Exception
protected void checkSensors()
checkSensors
in class iRobotCreate
iRobotCreate.checkSensors()
,
turnAndGo(double, short)
,
checkForStall()
protected void checkForStall()
iRobotCreate.readSensor(byte, byte[])
protected void turnAndGo(double theAngle, short velocity)
theAngle
- The angle (in radians) to turnvelocity
- The velocity to go away atpublic void go(short velocity)