ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

What speaks against doing a normal string write?

#include <fstream>
#include <string>
#include <iostream>

void chatterCallback(const std_msgs::String::ConstPtr& msg)
{
    std::ofstream out("output.txt");
    out << msg->data.c_str();
    out.close();
}