#pragma once

#include "../../../include/dv-processing/core/time.hpp"
#include "../../../include/dv-processing/data/pose_base.hpp"

#include <pybind11/pybind11.h>

namespace py = pybind11;

/**
 * @brief Bind Pose class to python
 * @param m pybind The module to bind to
 */
void bind_pose_base(py::module &m) {
	py::class_<dv::Pose>(m, "Pose")
		.def(py::init<int64_t, const dv::Vec3f &, const dv::Quaternion &, const std::string &, const std::string &>(),
			py::arg("timestamp"), py::arg("translation"), py::arg("rotation"), py::arg("referenceFrame"),
			py::arg("targetFrame"))
		.def_readwrite("timestamp", &dv::Pose::timestamp, "Unix microsecond timestamp of the pose")
		.def_readwrite("translation", &dv::Pose::translation, "Translational vector of the transformation")
		.def_readwrite("rotation", &dv::Pose::rotation, "Rotation quaternion of the transformation")
		.def_readwrite("referenceFrame", &dv::Pose::referenceFrame,
			"Name of the source reference frame that transformation transforms from")
		.def_readwrite("targetFrame", &dv::Pose::targetFrame,
			"Name of the target reference frame that transformation transforms into")
		.def(
			"time",
			[](const dv::Pose &self) {
				return dv::toTimePoint(self.timestamp);
			},
			"Timestamp of the captured data, compatible with python time library");
}
