Replay MCAP files into eCAL topics. Publishes original payloads and prints a decoded preview (JSON/text/hex).
- Install Go 1.23.0
wget https://go.dev/dl/go1.23.0.linux-amd64.tar.gz
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf go1.23.0.linux-amd64.tar.gz
# Make Go visible in your shell
echo 'export PATH=/usr/local/go/bin:$PATH' >> ~/.profile
source ~/.profile
go version # should show go1.23.0- Install eCAL C dev headers and build tools
sudo apt-get update
sudo apt-get install -y libecal-core-c-dev build-essential pkg-config- Build
cd /home/pi/WorkHour/MinusZero/Codebases/mcap-player
PATH=/usr/local/go/bin:$PATH go mod tidy
PATH=/usr/local/go/bin:$PATH go build -o mcap-player- Run
./mcap-player --file /path/to/file.mcap \
--topics "topicA,topicB" \
--rate 1.0 \
--loop=false- Omit
--topicsto publish all topics. - Set
--loop=trueto continuously replay.
- Verify in eCAL Monitor
- Start eCAL Monitor, check that your topics appear and bytes are being published.
- The binary uses the eCAL C API. Topic type is shared so it’s visible in Monitor.
- Decoding for console output:
- JSON if
MessageEncodingcontains "json" - Else UTF-8 text if valid; otherwise hex preview
- JSON if
- Go errors about
slices,io/fs, or deprecations: ensurego versionis >= 1.21 (1.23 recommended). - Linker/header errors for eCAL:
sudo apt-get install -y libecal-core-c-dev. - If your shell still uses old Go, prefix commands:
PATH=/usr/local/go/bin:$PATH. - Check eCAL libs:
ldconfig -p | grep -i ecal_core_c.