Classes | |
enum | Action |
class | ConnectNodeThread |
interface | FailureHandler |
Public Member Functions | |
void | getAppInfo (final MasterId masterId, final int hash) |
void | getAppsForRole (final MasterId masterId, final String role) |
GraphName | getDefaultNodeName () |
void | init (String interactionsNamespace) |
InteractionsManager (FailureHandler failureCallback) | |
void | onError (Node node, Throwable throwable) |
void | onShutdown (Node node) |
void | onShutdownComplete (Node node) |
void | onStart (final ConnectedNode connectedNode) |
void | requestAppUse (final MasterId masterId, final String role, final rocon_interaction_msgs.Interaction app) |
void | setRemoconName (String remocon_name) |
void | setupAppInfoService (ServiceResponseListener< GetInteractionResponse > serviceResponseListener) |
void | setupGetInteractionsService (ServiceResponseListener< GetInteractionsResponse > serviceResponseListener) |
void | setupRequestService (ServiceResponseListener< RequestInteractionResponse > serviceResponseListener) |
void | shutdown () |
Protected Member Functions | |
void | finalize () throws Throwable |
Private Member Functions | |
void | getAppInfo () |
void | getAppsForRole () |
void | requestAppUse () |
Private Attributes | |
Action | action = Action.NONE |
rocon_interaction_msgs.Interaction | app |
int | app_hash |
ServiceResponseListener < GetInteractionResponse > | appInfoServiceResponseListener |
ConnectedNode | connectedNode |
ConnectNodeThread | connectThread |
FailureHandler | failureCallback |
ServiceResponseListener < GetInteractionsResponse > | getAppsServiceResponseListener |
String | interactionsNamespace |
NodeMainExecutorService | nodeMainExecutorService |
String | remocon_name |
ServiceResponseListener < RequestInteractionResponse > | requestServiceResponseListener |
String | role |
This class has been derived from the original turtlebot robot app manager but now tuned for interactions.
The original is quite messy, and this is not much better, so maybe needs extra refactoring. Also RobotAppsManager claims that it can be executed once, but I modified this to execute arbitrary times. It looks to work, but mechanism is a bit brittle. Apps manager implements the services and topics required to interact with the concert roles manager. Typically to use this class its a three step process:
1) instantiate and provide a general failure handler 2) provide a callback via one of the setupXXXservice methods 3) call the service you want; there's a public method per service 4) wait for service response.
Essentially you are creating a node when creating an instance, and rosjava isolates each service/topic to each 'node'.
Definition at line 74 of file InteractionsManager.java.
com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.InteractionsManager | ( | FailureHandler | failureCallback | ) | [inline] |
Definition at line 101 of file InteractionsManager.java.
void com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.finalize | ( | ) | throws Throwable [inline, protected] |
Definition at line 135 of file InteractionsManager.java.
void com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.getAppInfo | ( | final MasterId | masterId, |
final int | hash | ||
) | [inline] |
This is called from the headless launcher where the only thing it knows is the master id (for connection purposes and the hash stored in an nfc tag (or other). We need to save this hash for later service calls.
masterId | |
hash |
Definition at line 203 of file InteractionsManager.java.
void com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.getAppInfo | ( | ) | [inline, private] |
Definition at line 267 of file InteractionsManager.java.
void com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.getAppsForRole | ( | final MasterId | masterId, |
final String | role | ||
) | [inline] |
Definition at line 147 of file InteractionsManager.java.
void com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.getAppsForRole | ( | ) | [inline, private] |
Definition at line 226 of file InteractionsManager.java.
GraphName com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.getDefaultNodeName | ( | ) | [inline] |
Definition at line 338 of file InteractionsManager.java.
void com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.init | ( | String | interactionsNamespace | ) | [inline] |
This is done outside of the constructor to save it from having to be continually reinstantiated in the rocon remocons. That does mean it requires some black magic, i.e. construction -> init & setupXYZ -> execute
interactionsNamespace |
Definition at line 113 of file InteractionsManager.java.
void com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.onError | ( | Node | node, |
Throwable | throwable | ||
) | [inline] |
Definition at line 394 of file InteractionsManager.java.
void com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.onShutdown | ( | Node | node | ) | [inline] |
Definition at line 379 of file InteractionsManager.java.
void com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.onShutdownComplete | ( | Node | node | ) | [inline] |
Definition at line 389 of file InteractionsManager.java.
void com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.onStart | ( | final ConnectedNode | connectedNode | ) | [inline] |
Node started by NodeMainExecutor.execute(). Execute the requested action.
connectedNode |
Definition at line 348 of file InteractionsManager.java.
void com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.requestAppUse | ( | final MasterId | masterId, |
final String | role, | ||
final rocon_interaction_msgs.Interaction | app | ||
) | [inline] |
Definition at line 170 of file InteractionsManager.java.
void com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.requestAppUse | ( | ) | [inline, private] |
Definition at line 247 of file InteractionsManager.java.
void com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.setRemoconName | ( | String | remocon_name | ) | [inline] |
Definition at line 117 of file InteractionsManager.java.
void com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.setupAppInfoService | ( | ServiceResponseListener< GetInteractionResponse > | serviceResponseListener | ) | [inline] |
Definition at line 130 of file InteractionsManager.java.
void com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.setupGetInteractionsService | ( | ServiceResponseListener< GetInteractionsResponse > | serviceResponseListener | ) | [inline] |
Definition at line 126 of file InteractionsManager.java.
void com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.setupRequestService | ( | ServiceResponseListener< RequestInteractionResponse > | serviceResponseListener | ) | [inline] |
Definition at line 122 of file InteractionsManager.java.
void com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.shutdown | ( | ) | [inline] |
Definition at line 140 of file InteractionsManager.java.
Action com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.action = Action.NONE [private] |
Definition at line 88 of file InteractionsManager.java.
rocon_interaction_msgs.Interaction com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.app [private] |
Definition at line 89 of file InteractionsManager.java.
Definition at line 90 of file InteractionsManager.java.
ServiceResponseListener<GetInteractionResponse> com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.appInfoServiceResponseListener [private] |
Definition at line 98 of file InteractionsManager.java.
ConnectedNode com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.connectedNode [private] |
Definition at line 93 of file InteractionsManager.java.
ConnectNodeThread com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.connectThread [private] |
Definition at line 92 of file InteractionsManager.java.
FailureHandler com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.failureCallback [private] |
Definition at line 95 of file InteractionsManager.java.
ServiceResponseListener<GetInteractionsResponse> com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.getAppsServiceResponseListener [private] |
Definition at line 97 of file InteractionsManager.java.
String com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.interactionsNamespace [private] |
Definition at line 87 of file InteractionsManager.java.
NodeMainExecutorService com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.nodeMainExecutorService [private] |
Definition at line 94 of file InteractionsManager.java.
String com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.remocon_name [private] |
Definition at line 91 of file InteractionsManager.java.
ServiceResponseListener<RequestInteractionResponse> com.github.rosjava.android_remocons.common_tools.rocon.InteractionsManager.requestServiceResponseListener [private] |
Definition at line 96 of file InteractionsManager.java.
Definition at line 84 of file InteractionsManager.java.