Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

takeSnapShot not working #43

Open
chinjo1296 opened this issue Dec 31, 2024 · 0 comments
Open

takeSnapShot not working #43

chinjo1296 opened this issue Dec 31, 2024 · 0 comments

Comments

@chinjo1296
Copy link

chinjo1296 commented Dec 31, 2024

Hello,

I am trying to implement the basic example using structures and not the custom data type one. My code has the following structure:

struct Robot {
    std::shared_ptr<DataTamer::MCAPSink> mcap_sink;
    std::shared_ptr<DataTamer::LogChannel> channel;
    DataTamer::RegistrationID id1;
    int count{0};
}

The above code is in a Robot.h file. The implementation file looks like this

Robot::Robot()
{
    mcap_sink = std::make_shared<DataTamer::MCAPSink>(robotId + "_diagnostics_log.mcap");
    channel = DataTamer::LogChannel::create("diagnostics_channel");
    channel->addDataSink(mcap_sink);
    id1 = channel->registerValue("count", &this->count);
}

I have a mqtt callback function where I have added the takeSnapShot() function

void Robot::updateData(nlohmann::json data)
{
    channel->takeSnapshot();
    count++;
}

Please let me know what I am doing wrong because when I copy the example code in my constructor it works but doesn't work like this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant