坐标系概述
坐标系 | 原点 | X方向 | Y方向 | Z方向 |
---|---|---|---|---|
WCS (World Coordinate System) | 地心 | 赤道本初子午线方向 | 赤道东90°方向 | 北极方向 |
ECI (Earth-Centered Inertial) | 地心 | 春分点方向 | 与X、Z正交的方向 | 北极星方向(惯性北极) |
NED (North-East-Down) | 当前载体位置 | 北方向 | 东方向 | 地心(向下) |
ENU (East-North-Up) | 本地测站 | 东方向 | 北方向 | 天顶方向(向上) |
ECS (Entity Coordinate System) | 飞行器鼻尖位置 | 航向方向(前向) | 右侧方向 | 地心方向(向下) |
PCS (Platform Coordinate System) | 载体平台中心 | 前向 | 右向 | 下向 |
RSCS (Radar Sensor Coordinate System) | 雷达天线相位中心 | 雷达波束方向(前向) | 右侧方向 | 下向 |
LLA (Latitude, Longitude, Altitude) | 地球椭球面 | 纬度(北为正) | 经度(东为正) | 高度(海平面起算) |
为什么经纬度LLA不能简单做线性差值?
(1)经纬度LLA是球面坐标系,单位:°
(2)经度在不同纬度下的“物理距离”是 不一样的:赤道附近,经度1度 ≈ 111km。但靠近两极,经度1度 ≈ 0 km。
(3)纬度变化是按球面曲率来的,线性插值会导致路径“弯掉”。
为什么ECS可以线性插值?
(1)ECS是直角坐标系,实体坐标系,局部平面坐标系,单位是米。
(2)用 ECS 做插值,相当于在平面上“画直线”,再映射回地球表面
LLA->ECS
ut::coords::ECS RouteGenerator::Widget::llaToEcs(const ut::coords::LLA& lla, const ut::coords::LLA& centerlla, const ut::coords::LLA& dstlla)
{UtEntity entity;// 设定 ECS 原点entity.SetLocationLLA(centerlla.mLat, centerlla.mLon, centerlla.mAlt);UtEntity dstEntity;// 设定目标实体dstEntity,确定ECS的朝向dstEntity.SetLocationLLA(dstlla.mLat, dstlla.mLon, dstlla.mAlt);ut::coords::NED relNed = entity.GetRelativeLocationNED(&dstEntity);double azimuth = 0, pitch = 0;UtEntity::ComputeAzimuthAndElevation(relNed.GetData(), azimuth, pitch);entity.SetOrientationNED(azimuth, pitch, 0);UtEntity cvrEntity;cvrEntity.SetLocationLLA(lla.mLat, lla.mLon, lla.mAlt);ut::coords::ECS ecs = entity.GetRelativeLocationECS(&cvrEntity);return ecs;
}
ECS->LLA
ut::coords::LLA RouteGenerator::Widget::EcsTolla(const ut::coords::ECS& ecs, const ut::coords::LLA& centerlla, const ut::coords::LLA& dstlla)
{UtEntity entity;// 设定 ECS 原点entity.SetLocationLLA(centerlla.mLat, centerlla.mLon, centerlla.mAlt);UtEntity dstEntity;// 设定目标实体dstEntity,确定朝向dstEntity.SetLocationLLA(dstlla.mLat, dstlla.mLon, dstlla.mAlt);// 计算的是目标点dstEntity相对于原点entity的相对位置,结果用NED表示。ut::coords::NED relNed = entity.GetRelativeLocationNED(&dstEntity);double azimuth = 0, pitch = 0;UtEntity::ComputeAzimuthAndElevation(relNed.GetData(), azimuth, pitch);entity.SetOrientationNED(azimuth, pitch, 0);ut::coords::WCS cvrWcs = entity.ConvertECSToWCS(ecs);UtEntity cvrEntity;cvrEntity.SetLocationWCS(cvrWcs);ut::coords::LLA lla = cvrEntity.GetLocationLLA();return lla;
}