TEXT 11
Text.txt Guest on 6th April 2021 09:31:42 AM
  1. Text middleware
  2. ===============
  3.  
  4. This is the simplest method to export information from MORSE. The data gathered
  5. by components configured to use this "middleware" will be stored in simple text
  6. files. Currently this middleware is only used to output information, so it is
  7. only available for sensors.
  8.  
  9. File names used in MORSE have the following format:
  10. ``[robot_name]_[component_name].txt``. Each file will have a header stating the
  11. name of the robot and the sensor, as well as the position of the sensor with
  12. respect to the center of the robot. The position is given with the format::
  13.  
  14.   (distance, globalVector(3), localVector(3))
  15.  
  16. Where ``globalVector`` is a list of 3 elements with the X, Y and Z coordinates
  17. of the sensor with respect to the global origin. ``localVector`` gives the
  18. coordinates with respect to the position of the robot.
  19.  
  20. After the header there is a blank line, and then the data captured by the sensor
  21. is printed with this format::
  22.  
  23.     ==> Data at X,Y,Z: [3.001482 -5.997612 0.036998] yaw,pitch,roll: [0.002257 0.004322 -0.005083] | time 3.08
  24.         dx = -0.000040
  25.         dy = 0.000089
  26.         dz = 0.000492
  27.         dyaw = -0.000292
  28.         dpitch = -0.000182
  29.         droll = 0.002484
  30.  
  31. - The first line starts with the string '==>', and shows the position and orientation of the robot at the moment of capturing the data. It also indicates the time, measured in seconds, since the simulation was started.
  32.  
  33. - The following lines show the contents of the ``local_data`` dictionary of the sensor, each line containing one (key, value) pair. In the example, the data from the :doc:`Odometry sensor <../sensors/odometry>`.
  34.  
  35. Files
  36. -----
  37.  
  38. - Python: ``$MORSE_ROOT/src/morse/modifiers/text_datastream.py``
  39.  
  40. .. _text_ds_configuration:
  41.  
  42. Configuration specificities
  43. ---------------------------
  44.  
  45. When configuring a component to export its data through the "text" middleware,
  46. you can pass the option ``file`` to define the name of the file written by the
  47. component.
  48.  
  49.  
  50. .. code-block :: python
  51.  
  52.     foo.add_stream('text', file = '/tmp/my_comp.log')

Paste-bin is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.