GStreamer - ZED Sensors CSV Sink

The ZED Sensors Data CSV Sink, zeddatacsvsink GStreamer element, is a sink that allows to log ZED Mini and ZED2 sensors data to a CSV file.

The source code of this plugin is a complete example about how to process the ZED metadata in a GStreamer element to retrieve sensors data.

Properties

Property
Meaning
Flags Type Range Default
location Location of the CSV file to write readable, writable String - ""
append Append to an already existing CSV file readable, writable Boolean true, false false

CSV Format

Following the list of information saved in the CSV file

  • TIMESTAMP: data timestamp in [ns].
  • STREAM_TYPE: type of stream acquired by zedsrc (see ZedInfo data structure).
  • CAM_MODEL: camera model used to acquire data (see ZedInfo data structure).
  • GRAB_W: width of camera frames.
  • GRAB_H heights of camera frames.
  • POSE_VAL: 1 if camera pose is valid.
  • POS_TRK_STATE: status of the positional tracking algorithm (see ZedPose data structure).
  • POS_X_[m]: X coordinate of the camera position in [m].
  • POS_Y_[m]: Y coordinate of the camera position in [m].
  • POS_Z_[m]: Z coordinate of the camera position in [m].
  • OR_X_[rad]: orientation of the camera arount the X axis in [rad].
  • OR_Y_[rad]: orientation of the camera arount the Y axis in [rad].
  • OR_Z_[rad]: orientation of the camera arount the Z axis in [rad].
  • IMU_VAL: 1 if IMU data are valid.
  • ACC_X_[m/s²]: acceleration value along the X axis in [m/s²].
  • ACC_Y_[m/s²]: acceleration value along the Y axis in [m/s²].
  • ACC_Z_[m/s²]: acceleration value along the Z axis in [m/s²].
  • GYRO_X_[rad/s]: angular velocity around the X axis in [rad/s].
  • GYRO_Y_[rad/s]: angular velocity around the Y axis in [rad/s].
  • GYRO_Z_[rad/s]: angular velocity around the Z axis in [rad/s].
  • MAG_VAL: 1 if magnetometer data are valid.
  • MAG_X_[uT]: magnetic field value along the X axis in [µT].
  • MAG_Y_[uT]: magnetic field value along the Y axis in [µT].
  • MAG_Z_[uT]: magnetic field value along the Z axis in [µT].
  • ENV_VAL: 1 if environment data are valid.
  • TEMP_[°C]: internal camera temperature in [°C]
  • PRESS_[hPa]: atmospheric pressure in [hPa]
  • TEMP_VAL: 1 if camera CMOS temperatures are valid.
  • TEMP_L_[°C]: temperature of the left CMOS sensor in [°C].
  • TEMP_R_[°C]: temperature of the right CMOS sensor in [°C].

Example pipelines

Sensors data logging to CSV file

Following a pipeline to acquire a stream at default resolution with RGB and Depth data and save the sensors data to a CSV file for logging

gst-launch-1.0 zedsrc stream-type=4 ! \
 zeddemux stream-data=true name=demux \
 demux.src_left ! queue ! autovideoconvert ! fpsdisplaysink \
 demux.src_aux ! queue ! autovideoconvert ! fpsdisplaysink \
 demux.src_data ! queue ! zeddatacsvsink location="${HOME}/test_csv.csv" append=FALSE

Note: a zeddemux element is required, with stream-data=true, to create a branch of the pipeline where only sensors data flow.