Skip to content

Software

Data Tamer

From github.com/facontidavide/data_tamer (opens in a new tab)

  • Middleware
  • Library
  • MIT

DataTamer is a C++ library for recording numerical variables over time as periodic snapshots, to be visualized later as timeseries.

  • Conflicting license statements. The README names Apache-2.0, which the license files do not.

Facts

GitHub stars
290read on 28 Nov 2026
Last update
13 Nov 2026Newest commit on main
Maintenance
Activea commit in the last 90 days
Difficulty
Intermediate

Checked on GitHub on 28 Nov 2026.

Licenses

Code
MIT (opens in a new tab)

Read by Robotheca from LICENSE (opens in a new tab) (MIT) at commit c0f2218 (opens in a new tab), on 14 Nov 2026.

Commercial use
Yes

The README (README.md (opens in a new tab)) also names Apache-2.0, which the license files do not.

At a glance

What it is
  • Records hundreds or thousands of variables, with small CPU overhead even at high sample rates.
  • Channels take snapshots of chosen variables at a given time; different channels can record at different frequencies.
  • Snapshots are forwarded to one or more sinks, such as MCAP files or a ROS 2 publisher.
  • The serialization schema is created at run time, so no code generation is needed.
  • Snapshots neither block nor allocate, which suits real-time applications.
  • A flight recorder sink keeps the last seconds in RAM and writes an MCAP file only when asked.

Robotheca's summary of the project's documents, not the creator's words.

Robots on Robotheca
No robot on Robotheca uses it yet.
Licence
MIT. Commercial use: Yes. Where it was read
Install
In the creator's words: The project's README (opens in a new tab)
Maintenance
Active, last commit on 13 Nov 2026.

Use it

How to install it, in the creator's words: The project's README (opens in a new tab)

Robotheca doesn't review code. Read it before running it.

Files and versions

Facts read at commit c0f2218

Robotheca read the repository at two versions: the summary at 6449123 and the facts and the README at c0f2218 (read on 28 Nov 2026).

Robotheca never hosts the code: each link goes to the creator's own page.

The README

The creator's own README, copied as written: README.md by @facontidavide, at commit c0f2218, under MIT (opens in a new tab). The original on GitHub (opens in a new tab).

Read the README here

Data Tamer

(opens in a new tab) (opens in a new tab) (opens in a new tab) (opens in a new tab) (opens in a new tab) (opens in a new tab)

DataTamer is a library to log/trace numerical variables over time and takes periodic "snapshots" of their values, to later visualize them as timeseries.

It works great with PlotJuggler (opens in a new tab), the timeseries visualization tool (note: you will need PlotJuggler 4 or later). For ROS 2 topics and rosbag2 recordings, use Foxglove with the data_tamer extension (opens in a new tab) (desktop or web).

DataTamer is "fearless data logger" because you can record hundreds or thousands of variables: even 1 million points per second should have a fairly small CPU overhead.

Since all the values are aggregated in a single "snapshot", it is usually meant to record data in a periodic loop (a very frequent use case, in robotics applications).

Kudos to pal_statistics (opens in a new tab), for inspiring this project.

How it works

architecture

DataTamer can be used to monitor multiple variables in your applications.

Channels are used to take "snapshots" of a subset of variables at a given time. If you want to record at different frequencies, you can use different channels.

DataTamer will forward the collected data to 1 or multiple sinks; a sink may save the information immediately in a file (currently, we support MCAP (opens in a new tab)) or publish it using an inter-process communication, for instance, a ROS2 publisher.

You can easily create your own, specialized sinks.

Use PlotJuggler (opens in a new tab) to visualize your logs offline or in real-time.

Features
  • Serialization schema is created at run-time: no need to do code generation.
  • Suitable for real-time applications: very low latency (on the side of the callee); once logging started (startLogging() before the loop), tryTakeSnapshot() neither blocks nor allocates. With Clang 20 or later, the real-time API is [[clang::nonblocking]], so -Wfunction-effects and RealtimeSanitizer check your control loop.
  • Multi-sink architecture: recorded data can be forwarded to multiple "backends".
  • Very low serialization overhead, in the order of 1 bit per traced value.
  • The user can enable/disable traced variables at run-time.
  • Flight recorder: MCAPRingSink keeps the last seconds in RAM and writes an MCAP file only when you ask, for instance after a fault.

Examples

Basic example
#include "data_tamer_v2/channel.hpp"
#include "data_tamer_v2/sinks/mcap_sink.hpp"

#include <chrono>
#include <cmath>
#include <thread>

int main()
{
  // The channel borrows these variables: declare them first so they outlive it.
  double shoulder_position = 0, shoulder_velocity = 0, shoulder_effort = 0;
  double elbow_position = 0, elbow_velocity = 0, elbow_effort = 0;

  // A worker that owns the sink writing the file (mcap->sink() is the MCAPSink). The
  // channel takes snapshots and hands them to its sinks.
  auto mcap = DataTamer2::MCAPSink::create("T01_joint_states.mcap");
  auto channel = DataTamer2::LogChannel::create("controller");
  channel->addDataSink(mcap);

  channel->registerValue("shoulder/position", &shoulder_position);
  channel->registerValue("shoulder/velocity", &shoulder_velocity);
  channel->registerValue("shoulder/effort", &shoulder_effort);
  channel->registerValue("elbow/position", &elbow_position);
  channel->registerValue("elbow/velocity", &elbow_velocity);
  channel->registerValue("elbow/effort", &elbow_effort);

  for(int cycle = 0; cycle < 1500; ++cycle)
  {
    const double t = cycle * 0.001;
    shoulder_position = std::sin(4 * t);
    shoulder_velocity = 4 * std::cos(4 * t);
    shoulder_effort = 0.2 * std::sin(4 * t);
    elbow_position = std::sin(4 * t + 0.5);
    elbow_velocity = 4 * std::cos(4 * t + 0.5);
    elbow_effort = 0.2 * std::sin(4 * t + 0.5);
    channel->takeSnapshot();  // One sample of every registered value.
    std::this_thread::sleep_for(std::chrono::milliseconds(1));
  }
  mcap->stop();  // Deliver queued snapshots and close the file, including its footer.
}
How to register custom types

std::string and std::string_view values are recorded as text (the schema type string), and containers such as std::vector and std::array work out of the box, including containers of texts and of your own types. Describe a struct in its own namespace:

#include "data_tamer_v2/channel.hpp"

#include <string_view>
#include <vector>

namespace robot
{
struct JointState
{
  double position = 0;
  double velocity = 0;
  double effort = 0;
};

// Put this beside your own type so argument-dependent lookup finds it.
template <typename AddField>
std::string_view TypeDefinition(JointState& joint, AddField& add)
{
  add("position", &joint.position);
  add("velocity", &joint.velocity);
  add("effort", &joint.effort);
  return "JointState";
}
}  // namespace robot

Declare std::vector<robot::JointState> joints(2); before the channel, then call channel->registerValue("joints", &joints);. The recorded series include joints[0]/position, joints[0]/velocity and joints[0]/effort.

For a type whose namespace you cannot modify, specialize DataTamer2::TypeDefinitionTrait<T> with a static define(T&, AddField&) instead. T02_custom_types.cpp (opens in a new tab) shows both forms in one file, including a vendor class with accessors. Return a string literal for the type name: the definition also runs when taking snapshots.

More examples: follow the progressive tutorial (opens in a new tab), from a joint-controller MCAP recording to threads, a flight recorder and a custom sink. The same directory also contains the throughput and ROS 2 demos.

Documentation

Compilation

The library builds with CMake 3.22 and a C++20 compiler; programs that use it need C++17. Under any build, a consumer links it the same way:

find_package(data_tamer 2 REQUIRED)
target_link_libraries(my_app PRIVATE data_tamer::data_tamer)
Compiling with ROS 2

The ROS 2 package of 2.x is data_tamer_v2 (in the data_tamer_cpp/ folder): it installs side by side with data_tamer_cpp, the 1.x package: its headers are in include/data_tamer_v2 and its library is libdata_tamer_v2.so. Depend on it with <depend>data_tamer_v2</depend>; find_package(data_tamer_v2 REQUIRED) with the target data_tamer_v2::data_tamer works as well as data_tamer::data_tamer.

Put the repository in the src/ folder of a colcon workspace and run colcon build. The tests are built when BUILD_TESTING is ON (colcon's default); pass --cmake-args -DBUILD_TESTING=OFF to skip them.

Compiling with CMake

Needs zstd and lz4 (on Ubuntu, libzstd-dev liblz4-dev), and GTest (libgtest-dev) for the tests, which a top-level build includes unless -DDATA_TAMER_BUILD_TESTS=OFF. CMake downloads the MCAP C++ headers (release 2.1.3, pinned by hash) with FetchContent. Without network access, pass -DFETCHCONTENT_SOURCE_DIR_DATA_TAMER_MCAP=<dir>, an unpacked copy of the release archive (opens in a new tab), or use an installed MCAP with DATA_TAMER_USE_SYSTEM_MCAP. From the repository root:

cmake -S data_tamer_cpp -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
cmake --install build --prefix /usr/local
OptionDefault
BUILD_SHARED_LIBSOFFShared library (always ON under ROS 2).
DATA_TAMER_BUILD_TESTS, _EXAMPLES, _BENCHMARKStop levelUnder ROS 2, tests also need BUILD_TESTING.
DATA_TAMER_BUILD_ROStop levelThe ROS 2 package, when ament_cmake is found.
DATA_TAMER_INSTALLtop levelInstall rules.
DATA_TAMER_WERROROFFWarnings in the library are errors (the presets and CI turn it ON).
DATA_TAMER_USE_SYSTEM_MCAPOFFfind_package(mcap) instead of downloading MCAP.

"Top level" means ON when data_tamer is the project being built and OFF when it is added with add_subdirectory() or FetchContent: then it is a plain library target, data_tamer::data_tamer, without ROS 2, and installs nothing.

Compiling with Conan

The ROS 2 publisher is not built this way. Conan 2.4 or later. From data_tamer_cpp/, conan create . --build=missing packages the library (MCAP from the mcap package) and builds test_package (opens in a new tab) against it. To develop with dependencies from conan:

conan install . -s compiler.cppstd=gnu17 --build=missing -s build_type=Release
cmake -S . -B build/Release -DCMAKE_BUILD_TYPE=Release -DDATA_TAMER_USE_SYSTEM_MCAP=ON \
      -DCMAKE_TOOLCHAIN_FILE="build/Release/generators/conan_toolchain.cmake"
cmake --build build/Release --parallel
Third-party code
  • MCAP (opens in a new tab) C++ 2.1.3, by Foxglove, MIT licence: not in the repository. Downloaded at configure time outside ROS 2, and its headers and LICENSE are installed in include/data_tamer_v2_mcap/mcap.
  • data_tamer_cpp/cmake/Findzstd.cmake and Findlz4.cmake: adapted from find modules by Meta Platforms, Apache License 2.0 (notice in each file).

How to deserialize data recorded with DataTamer

The format is specified in docs/wire_format.md (opens in a new tab), and there are three decoders:

All three read the files of data_tamer 1.x and 2.x, but not those of releases before 0.7.0.

Robotheca lists software as a reference: nothing is hosted or run here, and every fact links to where it was read.