Object Detection Mock ===================== .. warning:: This component is deprecated and is no longer maintained. The documentation may not reflect a working configuration. This small program can be used to fake object detection. It provides the possibility to search for arbitrary objects via rpc calls and task specifications. It returns a random location from a list which can be provided at component startup. The location remains the same in subsequent queries. Related resources ----------------- Component repository: - Browse component repository: `object-detection `_. - ``git clone https://projects.cit-ec.uni-bielefeld.de/git/lsp-csra.object-detection.git/`` System startup: - The coordination can be found in ``lsp-csra-supplementary.sh`` on the ``default`` tab. - The component script is called ``component_objectdetection`` Related projects: - Browse repository `system-startup `_. Startup ------- The program can be invoked with the following parameters: -avail Available rooms for searching. May be any of (colon-separated): - ``Kitchen, Living, Bath, Wardrobe, NotAvail`` - default: all -help Print this help. -method Name for the search method - default: ``find`` -server RSB scope to create the remote server at - no default, apartment config: ``/home/objects/find/`` -task RSB scope to listen to for task specifications - no default, apartment config: ``/home/objects/find/`` Interfaces ---------- You can search for objects in two different ways. a) Send an object of type rst.communicationpatterns.TaskState_ containing the object to search for in the payload with an initiated state and the handler set to initiator. The task state's payload will be updated with the according location and the task is marked as completed by the handler. b) Invoke the find method with the object's name as an argument. In the apartment context, the component is configured with the following scopes: .. _rst.communicationpatterns.TaskState: http://docs.cor-lab.de//rst-manual/trunk/html/generated/stable/package-rst-communicationpatterns.html#rst.communicationpatterns.TaskState ============================= ==================================== Scope (Listener and Informer) Type ============================= ==================================== ``/home/objects/find/`` rst.communicationpatterns.TaskState_ ============================= ==================================== ============================== ============= =========== Scope (Local Server) + Method Argument Type Return Type ============================== ============= =========== ``/home/objects/find/find()`` String String ============================== ============= =========== Examples -------- In order to successfully implement one of these Java examples, you need JDK 7+ and `rsb `_ / `rst `_ 0.12+. .. code-block:: java // Import the following: import com.google.protobuf.ByteString; import rsb.*; import rst.communicationpatterns.TaskStateType.TaskState; Remote server method call ^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: java :emphasize-lines: 4 RemoteServer remote = Factory.getInstance().createRemoteServer("/home/objects/find"); remote.activate(); String object = "My Object"; String location = remote.call("find", object); System.out.println("found '" + object + "' in: " + location); remote.deactivate();