50 lines
1.9 KiB
C++
50 lines
1.9 KiB
C++
#ifndef TRAJECTORYCALCULATOR_H
|
|
#define TRAJECTORYCALCULATOR_H
|
|
|
|
#include "GPRDataModel.h"
|
|
#include "SurveyGeometry.h"
|
|
#include <QVector3D>
|
|
#include <QStringList>
|
|
|
|
struct TrajectoryFilterOptions {
|
|
bool distanceFilterEnabled = true;
|
|
double maxSegmentDistanceM = 1.0;
|
|
bool speedFilterEnabled = false;
|
|
double maxSpeedMps = 60.0;
|
|
double traceIntervalSec = 0.05;
|
|
bool angleFilterEnabled = true;
|
|
double maxTurnAngleDeg = 60.0;
|
|
enum class InterpolationMode { Linear, Spline };
|
|
InterpolationMode interpolationMode = InterpolationMode::Linear;
|
|
bool preserveEndpoints = true;
|
|
bool preserveManualEdits = true;
|
|
};
|
|
|
|
struct TrajectoryFilterResult {
|
|
QVector<QVector3D> outputPositions;
|
|
QVector<bool> keepMask;
|
|
QVector<bool> distanceOutlierMask;
|
|
QVector<bool> speedOutlierMask;
|
|
QVector<bool> angleOutlierMask;
|
|
QStringList warnings;
|
|
};
|
|
|
|
class TrajectoryCalculator {
|
|
public:
|
|
// 计算第 traceIdx 个 RTK 点的行进方向角(弧度)
|
|
// 返回 theta_y = atan2(dY, dX),其中 X=北向, Y=东向
|
|
static double headingAt(int traceIdx, const QVector<QVector3D> &gpsPositions);
|
|
|
|
// 根据 RTK 轨迹和天线几何参数,计算所有通道的绝对坐标
|
|
// 结果写入 line.channelTrajectories 和 line.data.traces[].position
|
|
static bool computeTrajectories(SurveyLine &line, const SurveyGeometry &geom);
|
|
|
|
static QVector<QVector3D> resampleTrajectoryLinear(const QVector<QVector3D> &input, int targetCount);
|
|
static QVector<QVector3D> resampleTrajectorySpline(const QVector<QVector3D> &input, int targetCount);
|
|
static TrajectoryFilterResult filterAndInterpolateTrajectory(const QVector<QVector3D> &input,
|
|
const TrajectoryFilterOptions &options,
|
|
int targetCount);
|
|
};
|
|
|
|
#endif // TRAJECTORYCALCULATOR_H
|