Parsing "tlm-data-logger"

Hey there!

I am willing to use the data logger CLI tool a.k.a. tlm-data-logger to provide feedback to ML models. Despite I know there are parsing tools available for logs recorded with the --datalog option at Sphinx, I know no script with the same functionality for tlm-data-logger.

Do you use or know any? Do you mind sharing it? If not, what would be the easiest way to parse its output in a nearly-real-time fashion? I’d run it like tlm-data-logger ... |

Thanks in advance!



You probably want to look at the telemetry library itself:

You need a workspace to build this library. You can use the ARSDK workspace if you already have it installed:
The ARSDK workspace does not contain the telemetry library but you can clone it inside the packages directory along with its dependencies (I believe libshdata is required).

Then, inside your workspace, you can build tlm-data-logger:

./ -p arsdk-native -A tlm-data-logger

And execute it while sphinx is running:

. out/arsdk-native/staging/
tlm-data-logger -r 0 inet:

Now, you can have a look at the source code in telemetry/tools/gndctrl_datalogger.cpp. Basically, GndCtrlApp::sample is called each time a new sample is received. The parameters sectionId and varId can help you identify the variables you are interested in.

If you plan on parsing your data in python, you may prefer to reproduce the code contained in this file directly in your application:

It works the same way as tlm-data-logger.

It’d be nice to see some comments in the code, it’s quite daunting to get into such a file when even the filename isn’t understandable.

Anyway, so far I’ve been trying to run tlm-data-logger using a pipe

tlm-data-logger inet: | rostopic pub sphinx/raw std_msgs/String

also like

tlm-data-logger inet: |

Neither way I got the data piped from the tlm tool. I think this may be because the first process piped doesn’t end, so the next one isn’t executed.

I am currently logging all the data generated in a file, then reading it from a Python script

tlm-data-logger inet: > telemetry_log.txt

However, this way is quite inefficient. With this knowledge, am I able to reproduce some of your code or toolings in a such a way that the telemetry datalogs can be directly inputted in a Python script (without using intermediate files) ?

Thanks in advance!

Also, this script has heavy dependencies on pomp Py module, which seems to be somewhat related to Parrot’s libpomp. I tried installing both and running the script, but I’m still getting pomp-related errors. Is there any documentation available?

Thank you

I want to use tlm-data-logger on another computer without installing Sphinix. How can I do?

tlm-data-logger is not distributed as a standalone. You’ll have to either install parrot-sphinx or build tlm-data-logger on that machine:

cd $HOME
mkdir -p code/parrot-groundsdk
cd code/parrot-groundsdk
repo init -u
repo sync
git clone packages/common/libshdata
git clone packages/common/telemetry
./ -p olympe -A tlm-data-logger final
. out/olympe-linux/staging/
tlm-data-logger inet:<sphinx_ip_address>:9060

The $HOME/code/parrot-groundsdk/out/olympe-linux/final/usr directory will contain the tlm-data-logger executable and its dependencies.

Thanks. I will try this.

Hello @ocrave ,
I tried to compile but I the following error:
[E] Task ‘alchemy’ failed (Command failed (returncode = 2))

The machine is Jetson TX2 (arm64).
I think the problem is the configuration:
TARGET_ARCH = aarch64
What can I do?

Have you tried this command?

TARGET_ARCH=arm64 ./ -p olympe -A tlm-data-logger final

Thanks ocrave,

No, but I will try.
I have also tried to use SDK (POSITIONCHANGED) to get the position. But the time between events is very long (about 1 second). How can I decrease this time? I would like 100 milliseconds of time between measurements.
Equivalent to the command “tlm-data-logger -s 100 inet: 9060”

Not work

nvidia@tegra-ubuntu:~/code/parrot-groundsdk$ TARGET_ARCH=arm64 ./ -p olympe -A tlm-data-logger final
[I] Starting task 'alchemy' with args: tlm-data-logger final
[I] In '/home/nvidia/code/parrot-groundsdk': ALCHEMY_TARGET_CONFIG_DIR="/home/nvidia/code/parrot-groundsdk/products/olympe/linux/config" ALCHEMY_TARGET_OUT="/home/nvidia/code/parrot-groundsdk/out/olympe-linux" ALCHEMY_TARGET_PRODUCT="olympe" ALCHEMY_TARGET_PRODUCT_VARIANT="linux" ALCHEMY_TARGET_SCAN_ADD_DIRS=" /home/nvidia/code/parrot-groundsdk/packages" ALCHEMY_TARGET_SCAN_PRUNE_DIRS=" /home/nvidia/code/parrot-groundsdk" ALCHEMY_USE_COLORS="1" ALCHEMY_WORKSPACE_DIR="/home/nvidia/code/parrot-groundsdk" PARROT_BUILD_PROP_GROUP="drones" PARROT_BUILD_PROP_PRODUCT="olympe" PARROT_BUILD_PROP_PROJECT="olympe" PARROT_BUILD_PROP_UID="olympe-linux-20190925-2020-0.0.0" PARROT_BUILD_PROP_VARIANT="linux" PARROT_BUILD_PROP_VERSION="0.0.0" /home/nvidia/code/parrot-groundsdk/build/alchemy/scripts/alchemake -j 1 tlm-data-logger final
+ ALCHEMY_WORKSPACE_DIR = /home/nvidia/code/parrot-groundsdk
+ TARGET_OS = linux
+ TARGET_LIBC = native
+ TARGET_ARCH = arm64
+ TARGET_OUT = /home/nvidia/code/parrot-groundsdk/out/olympe-linux
+ TARGET_CONFIG_DIR = /home/nvidia/code/parrot-groundsdk/products/olympe/linux/config
+ TARGET_CC_PATH = /usr/bin/cc
Scanning /home/nvidia/code/parrot-groundsdk/packages for makefiles...
Found 45 makefiles
Found 105 modules
Computing modules dependencies...
Checking modules dependencies...
/home/nvidia/code/parrot-groundsdk/build/alchemy/ *** /home/nvidia/code/parrot-groundsdk/packages/common/ffmpeg: module 'ffmpeg-libav' depends on unknown module 'zlib'.  Stop.
[E] Task 'alchemy' failed (Command failed (returncode=2))

Finally I was able to compile with the code:

‘/home/pj/parrot/out/arsdk-native/staging/’ ./ -p arsdk-native -A tlm-data-logger


1 Like