|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrp1.rossum.RsProtocol
rp1.rossum.RsClient
public class RsClient
The main class for connecting a client-side application to the simulator. Note that even though this class implements Runnable (through RsRunnable), an application does not necessarily have to launch it as an independent thread. For example, an object of type RsClient might just be an element in another class which does, itself, extend Thread. The run method and Runnable interface is provided both as documentation and as a convenience. In general, the methods in this class are organized as follows:
In implementing an RP1 client, it is often useful to write a client class that extends RsClient. This is not, of course, the only approach to building an RP1 client, but is a good way of taking advantage of Java's object-oriented capabilities. The sequence for establishing an RP1 client is discussed extensively in the RP1 Users Guide.
This class will not prevent you from sending a request for an event when you have no event handler registered. When the requested, but non-handled, event comes in, it will be ignored.
| Field Summary | |
|---|---|
RsProperties |
rsProperties
|
| Constructor Summary | |
|---|---|
RsClient()
|
|
| Methods inherited from class rp1.rossum.RsProtocol |
|---|
getVerbosity, isInputSet, isLoggerSet, isOutputSet, log, logIt, setInputOutputStreams, setLogger, setProtocolShutdownHandler, setSocket, setVerbosity, verbose |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface rp1.rossum.RsRunnable |
|---|
setInputOutputStreams, setLogger |
| Methods inherited from interface rp1.rossum.RsLogInterface |
|---|
getVerbosity, log, logIt, setVerbosity, verbose |
| Field Detail |
|---|
public RsProperties rsProperties
| Constructor Detail |
|---|
public RsClient()
| Method Detail |
|---|
public void initiateLogger(RsProperties properties)
throws java.io.IOException
java.io.IOException
public void initiateConnection(RsProperties properties)
throws java.io.IOException
java.io.IOExceptionpublic RsProperties getProperties()
public void addMouseClickEventHandler(RsMouseClickEventHandler reference)
public void removeMouseClickEventHandler()
public void removeMouseClickEventHandler(RsMouseClickEventHandler reference)
public void addMotionStartedEventHandler(RsMotionStartedEventHandler reference)
public void removeMotionStartedEventHandler()
public void removeMotionStartedEventHandler(RsMotionStartedEventHandler reference)
public void addMotionHaltedEventHandler(RsMotionHaltedEventHandler reference)
public void removeMotionHaltedEventHandler()
public void removeMotionHaltedEventHandler(RsMotionStartedEventHandler reference)
public void addTargetSensorEventHandler(RsBodyTargetSensor sensor,
RsTargetSensorEventHandler reference)
public void removeTargetSensorEventHandler(RsBodyTargetSensor sensor)
public void removeTargetSensorEventHandler(RsBodyTargetSensor sensor,
RsTargetSensorEventHandler reference)
public void addContactSensorEventHandler(RsBodyContactSensor sensor,
RsContactSensorEventHandler reference)
public void removeContactSensorEventHandler(RsBodyContactSensor sensor)
public void removeContactSensorEventHandler(RsBodyContactSensor sensor,
RsContactSensorEventHandler reference)
public void addRangeSensorEventHandler(RsBodyRangeSensor sensor,
RsRangeSensorEventHandler reference)
public void removeRangeSensorEventHandler(RsBodyRangeSensor sensor)
public void removeRangeSensorEventHandler(RsBodyRangeSensor sensor,
RsRangeSensorEventHandler reference)
public void addPaintSensorEventHandler(RsBodyPaintSensor sensor,
RsPaintSensorEventHandler reference)
public void removePaintSensorEventHandler(RsBodyPaintSensor sensor)
public void removePaintSensorEventHandler(RsBodyPaintSensor sensor,
RsPaintSensorEventHandler reference)
public void addTimeoutEventHandler(RsTimeoutEventHandler reference)
public void removeTimeoutEventHandler()
public void removeTimeoutEventHandler(RsTimeoutEventHandler reference)
public void addPositionEventHandler(RsPositionEventHandler reference)
public void removePositionEventHandler()
public void removePositionEventHandler(RsPositionEventHandler reference)
public void addPlacementEventHandler(RsPlacementEventHandler reference)
public void removePlacementEventHandler()
public void removePlacementEventHandler(RsPlacementEventHandler reference)
public void addTargetSelectionEventHandler(RsTargetSelectionEventHandler reference)
public void removeTargetSelectionEventHandler()
public void removeTargetSelectionEventHandler(RsTargetSelectionEventHandler reference)
public void addPlanEventHandler(RsPlanEventHandler reference)
public void removePlanEventHandler()
public void removePlanEventHandler(RsPlanEventHandler reference)
public void addHeartbeatEventHandler(RsHeartbeatEventHandler reference)
public void removeHeartbeatEventHandler()
public void removeHeartbeatEventHandler(RsHeartbeatEventHandler reference)
public void addEncoderStatusEventHandler(RsEncoderStatusEventHandler reference)
public void removeEncoderStatusEventHandler()
public void removeEncoderStatusEventHandler(RsEncoderStatusEventHandler reference)
public int sendTimeoutRequest(double duration)
duration - delay time in seconds until the timeout event is returned.public void sendSensorStatusRequest(RsBodySensor sensor)
public void sendMotionRequest(RsMotionRequest r)
public void sendPositionRequest()
public void sendPlacementRequest(java.lang.String name)
public void sendHaltRequest()
public void sendTargetSelectionRequest(java.lang.String targetName,
boolean status)
public void sendExclusiveTargetSelectionRequest(java.lang.String targetName)
public void sendRandomTargetSelectionRequest(boolean status)
public void sendExclusiveRandomTargetSelectionRequest()
public void sendAllTargetsSelectionRequest(boolean status)
public void sendPlanRequest()
public void sendHeartbeatRequest(double period)
period - heartbeat interval, in seconds.public void sendHeartbeatCancellationRequest()
public void sendPainterActivationRequest(RsBodyPainter painter)
public void sendPainterDeactivationRequest(RsBodyPainter painter)
public void sendPainterErasureRequest(RsBodyPainter painter)
public void sendActuatorControlRequest(RsActuatorControlRequest r)
public int sendEncoderStatusRequest(RsEncoder encoder,
boolean clearOnRequest)
encoder - An RsEncoder object associated with an RsWheel object.clearOnRequest - indicates that the encoder accumulators are to be clear upon query completion.
public int sendEncoderStatusRequest(RsEncoder[] encoders,
boolean clearOnRequest)
encoders - An array of RsEncoder objects associated with RsWheel objects.clearOnRequest - indicates that the encoder accumulators are to be cleared upon query completion.public void sendBodySpecification(RsBody body)
public void initialize()
throws java.io.IOException
initialize in interface RsRunnablejava.io.IOException
public void initialize(RsProperties rsp)
throws java.io.IOException
java.io.IOExceptionpublic void run()
run in interface java.lang.Runnablepublic double getSimTime()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||