Text middleware¶
This is the simplest way to export information from MORSE. The data gathered by components configured to use this “middleware” will be stored in simple text files. Currently this middleware is only used to output information, so it is only available for sensors.
File names used in MORSE have the following format:
[robot_name]_[component_name].txt
. Each file will have a header stating the
name of the robot and the sensor, as well as the position of the sensor with
respect to the center of the robot. The position is given with the format:
(distance, globalVector(3), localVector(3))
Where globalVector
is a list of 3 elements with the X, Y and Z coordinates
of the sensor with respect to the global origin, and localVector
gives the
coordinates with respect to the position of the robot.
After the header there is a blank line, and then the data captured by the sensor is printed using this format:
==> Data at X,Y,Z: [3.001482 -5.997612 0.036998] yaw,pitch,roll: [0.002257 0.004322 -0.005083] | time 3.08
dx = -0.000040
dy = 0.000089
dz = 0.000492
dyaw = -0.000292
dpitch = -0.000182
droll = 0.002484
- The first line starts with the string ‘==>’, and shows the position and orientation of the robot at the moment the data is captured. It also indicates the time, measured in seconds, since the simulation was started.
- The following lines show the contents of the sensor’s
local_data
dictionary, each line containing one (key, value) pair. In the example, the data is from the Odometry sensor.
Files¶
- Python:
$MORSE_ROOT/src/morse/modifiers/text_datastream.py
Configuration specifics¶
When configuring a component to export its data through the “text” middleware,
you can pass the option file
to specify the name of the file written by the
component.
foo.add_stream('text', file = '/tmp/my_comp.log')