#pragma once
#include <cstdint>
#include <memory>
#include "rust/cxx.h"
#if __has_include(<tf2/buffer_core.hpp>)
#include <tf2/buffer_core.hpp>
#elif __has_include(<tf2/tf2/buffer_core.hpp>)
#include <tf2/tf2/buffer_core.hpp>
#else
#error "Could not find a TF2 BufferCore .hpp header"
#endif
struct Tf2Time;
struct Tf2Header;
struct Tf2TransformStamped;
struct Tf2PointStamped;
struct Tf2PoseStamped;
struct Tf2PointField;
struct Tf2PointCloud2;
enum class Tf2Errc : int32_t;
struct Tf2Status;
struct Tf2CanTransformResult;
class BufferCoreWrapper {
public:
explicit BufferCoreWrapper(uint64_t cache_time_ns);
void clear() const;
Tf2Status set_transform(
const Tf2TransformStamped& tf,
rust::Str authority,
bool is_static,
bool& out_ok) const;
Tf2Status can_transform(
rust::Str target_frame,
rust::Str source_frame,
const Tf2Time& time,
Tf2CanTransformResult& out) const;
Tf2Status lookup_transform(
rust::Str target_frame,
rust::Str source_frame,
const Tf2Time& time,
Tf2TransformStamped& out_tf) const;
private:
mutable tf2::BufferCore buffer_;
};
std::shared_ptr<BufferCoreWrapper> new_buffer_core(uint64_t cache_time_ns);
Tf2Status do_transform_point_stamped(
const Tf2PointStamped& input,
const Tf2TransformStamped& tf,
Tf2PointStamped& out);
Tf2Status do_transform_pose_stamped(
const Tf2PoseStamped& input,
const Tf2TransformStamped& tf,
Tf2PoseStamped& out);
Tf2Status do_transform_pointcloud2(
const Tf2PointCloud2& input,
const Tf2TransformStamped& tf,
Tf2PointCloud2& out);