|
||||||||||
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,
org.robokind.api.messaging.MessageSender<RobotResponse> sender,
org.robokind.api.messaging.MessageAsyncReceiver<RobotRequest> receiver,
RobotResponseFactory factory,
org.robokind.api.messaging.MessageAsyncReceiver<MotionFrameEvent> motionFrameReceiver,
org.jflux.api.core.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. |
org.robokind.api.messaging.MessageSender<RobotResponse> |
getResponseSender()
|
Robot |
getRobot()
|
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. |
void |
setMotionFrameReceiver(org.robokind.api.messaging.MessageAsyncReceiver<MotionFrameEvent> receiver)
Sets the MessageReceiver to receive MotionFrames |
void |
setMoveHandler(org.jflux.api.core.Listener<MotionFrameEvent> moveHandler)
Sets the Listener to handle MotionFrames from clients. |
void |
setRequestReceiver(org.robokind.api.messaging.MessageAsyncReceiver<RobotRequest> receiver)
Sets the MessageReceiver to receive RobotRequests. |
void |
setResponseFactory(RobotResponseFactory factory)
Sets the factory to use for creating new RobotResponse Messages. |
void |
setResponseSender(org.robokind.api.messaging.MessageSender<RobotResponse> sender)
Sets the MessageSender to send RobotResponses. |
void |
setRobot(Robot robot)
Sets the Robot to host. |
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, org.robokind.api.messaging.MessageSender<RobotResponse> sender, org.robokind.api.messaging.MessageAsyncReceiver<RobotRequest> receiver, RobotResponseFactory factory, org.robokind.api.messaging.MessageAsyncReceiver<MotionFrameEvent> motionFrameReceiver, org.jflux.api.core.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 clientsprotected RemoteRobotHost(String sourceId, String destinationId)
sourceId
- arbitrary String identifying this hostdestinationId
- arbitrary String identifying a clientMethod Detail |
---|
public void setRobot(Robot robot)
robot
- Robot to hostpublic void setResponseSender(org.robokind.api.messaging.MessageSender<RobotResponse> sender)
sender
- MEssageSender to usepublic org.robokind.api.messaging.MessageSender<RobotResponse> getResponseSender()
public void setRequestReceiver(org.robokind.api.messaging.MessageAsyncReceiver<RobotRequest> receiver)
receiver
- MessageReceiver to usepublic void setResponseFactory(RobotResponseFactory factory)
factory
- factory to use for creating new RobotResponse Messagespublic void setMotionFrameReceiver(org.robokind.api.messaging.MessageAsyncReceiver<MotionFrameEvent> receiver)
receiver
- MessageReceiver to usepublic void setMoveHandler(org.jflux.api.core.Listener<MotionFrameEvent> moveHandler)
moveHandler
- Listener to handle MotionFrames from clientspublic Robot.Id getRobotId()
public String getSourceId()
public String getDestinationId()
public Robot getRobot()
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 |