You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
2.5 KiB

#include <pybind11/stl.h> // 用于绑定 std::string 等
#include "StitchStruct.h" // 包含 API_UnderStitch 的定义
#include "API_UnderStitch.h"
// =========================================================================
// 2. PYBIND11 绑定代码
// =========================================================================
#include <pybind11/pybind11.h>
namespace py = pybind11;
// 辅助函数:只负责绑定所有公用结构体
void bind_public_structures(py::module_ &m) {
// PointBLH
py::class_<PointBLH>(m, "PointBLH", "地理坐标系,单位:度")
.def(py::init<>())
.def_readwrite("B", &PointBLH::B, "纬度")
.def_readwrite("L", &PointBLH::L, "经度")
.def_readwrite("H", &PointBLH::H, "高程");
// EulerRPY
py::class_<EulerRPY>(m, "EulerRPY", "RPY 姿态角,单位:度")
.def(py::init<>())
.def_readwrite("fRoll", &EulerRPY::fRoll, "横滚角")
.def_readwrite("fPitch", &EulerRPY::fPitch, "俯仰角")
.def_readwrite("fYaw", &EulerRPY::fYaw, "方位角");
// ----------------------------------------------------
// B. 嵌套结构体
// ----------------------------------------------------
// AirCraftInfo
py::class_<AirCraftInfo>(m, "AirCraftInfo", "载体信息")
.def(py::init<>())
.def_readwrite("nPlaneID", &AirCraftInfo::nPlaneID, "载机ID")
.def_readwrite("stPos", &AirCraftInfo::stPos, "位置 (PointBLH)")
.def_readwrite("stAtt", &AirCraftInfo::stAtt, "姿态 (EulerRPY)");
// CamInfo
py::class_<CamInfo>(m, "CamInfo", "相机信息")
.def(py::init<>())
.def_readwrite("nFocus", &CamInfo::nFocus, "实时焦距值")
.def_readwrite("fPixelSize", &CamInfo::fPixelSize, "像素尺寸")
.def_readwrite("unVideoType", &CamInfo::unVideoType, "视频源类型")
.def_readwrite("dCamx", &CamInfo::dCamx, "像主点偏移x")
.def_readwrite("dCamy", &CamInfo::dCamy, "像主点偏移y")
.def_readwrite("fAglReso", &CamInfo::fAglReso, "角分辨率");
// ServoInfo
py::class_<ServoInfo>(m, "ServoInfo", "伺服状态")
.def(py::init<>())
.def_readwrite("fServoAz", &ServoInfo::fServoAz, "当前帧伺服方位角")
.def_readwrite("fServoPt", &ServoInfo::fServoPt, "当前帧伺服俯仰角")
.def_readwrite("fServoAzSpeed", &ServoInfo::fServoAzSpeed, "当前帧伺服方位角速度")
.def_readwrite("fServoPtSpeed", &ServoInfo::fServoPtSpeed, "当前帧伺服俯仰角速度");
}