#include "std_msgs/Header.h"
#include <robot/robot.h>
#include <cstring>
#include <cstdlib>

extern "C" Header header_create(const char *frame_id) {
    Header header{};
    header.frame_id = strdup(frame_id);
    header.sec = robot::Time::now().sec;
    header.nsec = robot::Time::now().nsec;
    return header;
}

extern "C" Header header_set_data(uint32_t seq, uint32_t sec, uint32_t nsec, char *frame_id) {
    Header header{};
    header.seq = seq;
    header.sec = sec;
    header.nsec = nsec;
    header.frame_id = strdup(frame_id);
    return header;
}
