|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.robokind.api.motion.messaging.RemoteRobotHost
public class RemoteRobotHost
Hosts a Robot to be controlled by a RemoteRobotClient through some Messaging channel. Receives RobotRequest Messages and replies with RobotResponse Messages.
| Constructor Summary | |
|---|---|
|
RemoteRobotHost(Robot robot,
String sourceId,
String destinationId,
MessageSender<RobotResponse> sender,
MessageAsyncReceiver<RobotRequest> receiver,
RobotResponseFactory factory,
MessageAsyncReceiver<MotionFrameEvent> motionFrameReceiver,
Listener<MotionFrameEvent> moveHandler)
Creates a new RemoteRobotHost to host the given Robot. |
protected |
RemoteRobotHost(String sourceId,
String destinationId)
Creates an empty RemoteRobotHost. |
| Method Summary | |
|---|---|
String |
getDestinationId()
Returns a String identifying a client. |
protected Joint |
getRequestedJoint(RobotRequest req)
Retrieves the Joint specified in the RobotRequest. |
Robot.Id |
getRobotId()
Returns the hosted Robot's id. |
String |
getSourceId()
Returns a String identifying this host. |
protected void |
handleConnectionStatusRequest(RobotRequest req)
Creates and sends a RobotStatusResponse with the Robot's connection status |
protected void |
handleConnectRequest(RobotRequest req)
Calls connect() on the hosted Robot. |
protected void |
handleCurrentPositionRequest(RobotRequest req)
Sends a RobotPositionResponse with the Robot's current positions. |
protected void |
handleDefaultPositionRequest(RobotRequest req)
Sends a RobotPositionResponse with the Robot's default positions. |
protected void |
handleDefinitionRequest(RobotRequest req)
Creates and sends a RobotDefinitionResponse. |
protected void |
handleDisableRequest(RobotRequest req)
Calls setEnabled(false) on the hosted Robot. |
protected void |
handleDisableRequestForJoint(RobotRequest req)
Calls setEnabled(true) on the hosted Robot's Joint. |
protected void |
handleDisconnectRequest(RobotRequest req)
Calls disconnect() on the hosted Robot. |
protected void |
handleEnabledStatusRequest(RobotRequest req)
Creates and sends a RobotStatusResponse with the Robot's enabled status |
protected void |
handleEnabledStatusRequestForJoint(RobotRequest req)
Creates and sends a RobotStatusResponse with the Joint's connection status |
protected void |
handleEnableRequest(RobotRequest req)
Calls setEnabled(true) on the hosted Robot. |
protected void |
handleEnableRequestForJoint(RobotRequest req)
Calls setEnabled(true) on the hosted Robot's Joint. |
protected void |
handleGoalPositionRequest(RobotRequest req)
Sends a RobotPositionResponse with the Robot's goal positions. |
protected void |
setMotionFrameReceiver(MessageAsyncReceiver<MotionFrameEvent> receiver)
Sets the MessageReceiver to receive MotionFrames |
protected void |
setMoveHandle(Listener<MotionFrameEvent> moveHandler)
Sets the Listener to handle MotionFrames from clients. |
protected void |
setRequestReceiver(MessageAsyncReceiver<RobotRequest> receiver)
Sets the MessageReceiver to receive RobotRequests. |
protected void |
setResponseFactory(RobotResponseFactory factory)
Sets the factory to use for creating new RobotResponse Messages. |
protected void |
setResponseSender(MessageSender<RobotResponse> sender)
Sets the MessageSender to send RobotResponses. |
protected void |
setRobot(Robot robot)
Sets the Robot to host. |
void |
start()
Begins listening for RobotRequests and MotionFrames |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RemoteRobotHost(Robot robot,
String sourceId,
String destinationId,
MessageSender<RobotResponse> sender,
MessageAsyncReceiver<RobotRequest> receiver,
RobotResponseFactory factory,
MessageAsyncReceiver<MotionFrameEvent> motionFrameReceiver,
Listener<MotionFrameEvent> moveHandler)
robot - Robot to hostsourceId - arbitrary String identifying this hostdestinationId - arbitrary String identifying a clientsender - MessageSender to send RobotResponsesreceiver - MessageReceiver to receive RobotRequests from a clientfactory - factory for creating new RobotResponse MessagesmotionFrameReceiver - MessageReceiver to receive MotionFrameEventsmoveHandler - Listener to handle MotionFrameEvents from clients
protected RemoteRobotHost(String sourceId,
String destinationId)
sourceId - arbitrary String identifying this hostdestinationId - arbitrary String identifying a client| Method Detail |
|---|
protected void setRobot(Robot robot)
robot - Robot to hostprotected void setResponseSender(MessageSender<RobotResponse> sender)
sender - MEssageSender to useprotected void setRequestReceiver(MessageAsyncReceiver<RobotRequest> receiver)
receiver - MessageReceiver to useprotected void setResponseFactory(RobotResponseFactory factory)
factory - factory to use for creating new RobotResponse Messagesprotected void setMotionFrameReceiver(MessageAsyncReceiver<MotionFrameEvent> receiver)
receiver - MessageReceiver to useprotected void setMoveHandle(Listener<MotionFrameEvent> moveHandler)
moveHandler - Listener to handle MotionFrames from clientspublic Robot.Id getRobotId()
public String getSourceId()
public String getDestinationId()
public void start()
protected void handleDefinitionRequest(RobotRequest req)
req - RobotRequest the host is responding toprotected void handleConnectRequest(RobotRequest req)
connect() on the hosted Robot. The return value from
that call is returned in a RobotStatusResponse.
req - RobotRequest the host is responding toprotected void handleDisconnectRequest(RobotRequest req)
disconnect() on the hosted Robot. The return value
from that call is returned in a RobotStatusResponse.
req - RobotRequest the host is responding toprotected void handleConnectionStatusRequest(RobotRequest req)
req - RobotRequest the host is responding toprotected void handleEnableRequest(RobotRequest req)
setEnabled(true) on the hosted Robot. Sends a
successful RobotStatusResponse.
req - RobotRequest the host is responding toprotected void handleDisableRequest(RobotRequest req)
setEnabled(false) on the hosted Robot. Sends a
successful RobotStatusResponse.
req - RobotRequest the host is responding toprotected void handleEnabledStatusRequest(RobotRequest req)
req - RobotRequest the host is responding toprotected void handleEnableRequestForJoint(RobotRequest req)
setEnabled(true) on the hosted Robot's Joint. Sends a
successful RobotStatusResponse.
req - RobotRequest the host is responding toprotected void handleDisableRequestForJoint(RobotRequest req)
setEnabled(true) on the hosted Robot's Joint. Sends a
successful RobotStatusResponse.
req - RobotRequest the host is responding toprotected void handleEnabledStatusRequestForJoint(RobotRequest req)
req - RobotRequest the host is responding toprotected Joint getRequestedJoint(RobotRequest req)
req - RobotRequest specifying a Joint
protected void handleDefaultPositionRequest(RobotRequest req)
req - RobotRequest the host is responding toprotected void handleGoalPositionRequest(RobotRequest req)
req - RobotRequest the host is responding toprotected void handleCurrentPositionRequest(RobotRequest req)
req - RobotRequest the host is responding to
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||