first commit

This commit is contained in:
2025-10-30 11:30:16 +07:00
commit 827b8623bc
84 changed files with 5662 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
#ifndef STD_MSGS_HEADER_H
#define STD_MSGS_HEADER_H
#include <string>
#include <chrono>
#include <cstdint>
namespace std_msgs {
struct Header
{
uint32_t seq = 0; // số thứ tự message
double stamp = 0.0; // thời gian theo giây (Unix time)
std::string frame_id;
Header() = default;
// Hàm tạo nhanh header với timestamp hiện tại
static Header now(const std::string& frame = "")
{
using namespace std::chrono;
double time_now = duration_cast<duration<double>>(system_clock::now().time_since_epoch()).count();
Header h;
h.seq = 0;
h.stamp = time_now;
h.frame_id = frame;
return h;
}
};
} // namespace std_msgs
#endif