You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Doc_BoxAlgorithm_ExternalProcessing.dox-part 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /**
  2. * \page BoxAlgorithm_ExternalProcessing External Processing
  3. __________________________________________________________________
  4. Detailed description
  5. __________________________________________________________________
  6. * |OVP_DocBegin_BoxAlgorithm_ExternalProcessing_Description|
  7. This box allows to externalize data processing into an external program. It sends EBML data in chunks
  8. according to a specified protocol, the external application must respond with an EBML response following
  9. this same protocol.
  10. A SDK for C++ and Python 3 (Python NeuroRT Box) are provided in order to simplify the development of
  11. external boxes.
  12. This box can work in two modes, either it launches the external program itself, or it will wait for client
  13. connections during the initialize step.
  14. * |OVP_DocEnd_BoxAlgorithm_ExternalProcessing_Description|
  15. __________________________________________________________________
  16. Settings description
  17. __________________________________________________________________
  18. * |OVP_DocBegin_BoxAlgorithm_ExternalProcessing_Settings|
  19. The External Processing box has several settings. The first eight parameters are reserved for the
  20. box. Any additional parameters will be passed to the external program.
  21. * |OVP_DocEnd_BoxAlgorithm_ExternalProcessing_Settings|
  22. * |OVP_DocBegin_BoxAlgorithm_ExternalProcessing_Setting1|
  23. If true, the box will attempt to start the external program automatically. If this setting is false, then the box will stop
  24. during the initialize step and wait for the external program to connect during the time speficied by the Connection Timeout setting.
  25. * |OVP_DocEnd_BoxAlgorithm_ExternalProcessing_Setting1|
  26. * |OVP_DocBegin_BoxAlgorithm_ExternalProcessing_Setting2|
  27. Path to the executable to run. This parameter is only used if the first parameter is activated.
  28. Example: OpenViBE SDK comes with two example programs, one can be found in ${Path_Bin}/sdk-examples-communication-client-filter
  29. Example: In the case you want to run a Python script on Windows, the program you are running is python, e.g: C:/Python35/python.exe
  30. * |OVP_DocEnd_BoxAlgorithm_ExternalProcessing_Setting2|
  31. * |OVP_DocBegin_BoxAlgorithm_ExternalProcessing_Setting3|
  32. Arguments passed to the third party program, if any are necessary. This parameter is only used if the first parameter is activated.
  33. This parameter will be given to the third party program as is, thus it is necessary to quote any arguments that contain spaces.
  34. Example: In the case you want to run a Python script on Windows, the parameter is the absolute path to the script that you want to run, e.g.: "C:/MyProject/myprogram.py" or "-m mylibrary.mymodule.mybox".
  35. * |OVP_DocEnd_BoxAlgorithm_ExternalProcessing_Setting3|
  36. * |OVP_DocBegin_BoxAlgorithm_ExternalProcessing_Setting4|
  37. The TCP port that the box is listening. It must be in the range 49152-65535 or it can be 0, in which case the port will be chosen
  38. automatically.
  39. The box acts as a Socket server and the external program as a client. If you have several External Processing boxes in the same scenario
  40. each has to work on a different port.
  41. An argument, with the value of the port, will be given to the third party program (after the Arguments parameter ) as: --port PORT
  42. This means that your external program must accept the --port parameter and use it to connect to this box.
  43. * |OVP_DocEnd_BoxAlgorithm_ExternalProcessing_Setting4|
  44. * |OVP_DocBegin_BoxAlgorithm_ExternalProcessing_Setting5|
  45. Whether or not to generate of a connection identifier for the connection. See the next setting for explanation.
  46. * |OVP_DocEnd_BoxAlgorithm_ExternalProcessing_Setting5|
  47. * |OVP_DocBegin_BoxAlgorithm_ExternalProcessing_Setting6|
  48. This argument will be passed to the external program as a command line parameter: `--connection-id CONNECTIONID` and will be communicated to your
  49. program through the protocol as well. You should check that the two are matching in order to avoid a clash if two boxes would be using the same
  50. port.
  51. We advise you to use an automatic identifier generation in production. Choose your custom connection identifier is however necessary when running
  52. the external program explicitly.
  53. * |OVP_DocEnd_BoxAlgorithm_ExternalProcessing_Setting6|
  54. * |OVP_DocBegin_BoxAlgorithm_ExternalProcessing_Setting7|
  55. A timeout, in seconds, for the incoming connection acceptance.
  56. * |OVP_DocEnd_BoxAlgorithm_ExternalProcessing_Setting7|
  57. * |OVP_DocBegin_BoxAlgorithm_ExternalProcessing_Setting8|
  58. This setting changes how often the box will process data. Each data processing requires that the box will
  59. wait until it has received a response from the external program. Too many of these synchronisations can
  60. induce a severe performance penalty.
  61. If the box is a generator, then it will wait for the external program on each step. If the scenario is
  62. played in real-time, then the box will poll the external program at 16Hz. If the scenario is in fast-forward
  63. the refresh frequency of this box is 1Hz.
  64. If this setting is set to false, the box will send all data it receives into the external program and wait
  65. until it processes it and sends it back.
  66. * |OVP_DocEnd_BoxAlgorithm_ExternalProcessing_Setting8|
  67. __________________________________________________________________
  68. Miscellaneous description
  69. __________________________________________________________________
  70. * |OVP_DocBegin_BoxAlgorithm_ExternalProcessing_Miscellaneous|
  71. This box requires synchronization with the external program in order to process data correctly and in order.
  72. As the synchronization is a relatively slow process with regards to the duration of one update cycle (62ms) it
  73. is better to try to limit the number of chunks that are send between the box and the client application.
  74. If you find that your scenario is too slow, try using time based epoching in front of it to make chunks of data
  75. larger.
  76. * |OVP_DocEnd_BoxAlgorithm_ExternalProcessing_Miscellaneous|
  77. */