一、載體坐標系簡稱
載體坐標系是指基於機體坐標(或稱為平台坐標)確定的以機體中心為坐標原點的慣性坐標系,簡稱為PC系。
/**
* 載體坐標系簡稱PC系
* 以機體中心為坐標原點的慣性坐標系
* @param {array} pc 坐標原點的坐標值[x,y,z]
*/
function PC(pc) {
this.pc = pc;
// 其他方法和屬性
}
二、載體坐標繫到東北天坐標
載體坐標繫到東北天坐標的轉化需引入大地坐標系下的經緯度作為參數,對載體坐標系下的各個方向向量進行坐標變換得到東北天坐標系下的對應方向向量。
/**
* 載體坐標繫到東北天坐標
* @param {array} pc 坐標原點的坐標值[x,y,z]
* @param {number} latitude 緯度值
* @param {number} longitude 經度值
* @param {number} altitude 高度值
*/
function PC2NED(pc, latitude, longitude, altitude) {
const N = [-Math.sin(latitude)*Math.cos(longitude), -Math.sin(latitude)*Math.sin(longitude), Math.cos(latitude)];
const E = [-Math.sin(longitude), Math.cos(longitude), 0];
const D = [-Math.cos(latitude)*Math.cos(longitude), -Math.cos(latitude)*Math.sin(longitude), -Math.sin(latitude)];
// 將PC系下的各個方向向量進行坐標變換得到NED系下的對應方向向量
const n = [N[0]*pc[0] + N[1]*pc[1] + N[2]*pc[2], E[0]*pc[0] + E[1]*pc[1] + E[2]*pc[2], D[0]*pc[0] + D[1]*pc[1] + D[2]*pc[2]];
return n;
}
三、載體坐標系英語
載體坐標系的英文名稱是 Platform Coordinate System,簡稱PC coordinate system。
const PC_COORDINATE_SYSTEM = "Platform Coordinate System";
四、載體坐標系定義
載體坐標系是一種慣性坐標系,以飛行器自身的參考係為基礎,不隨外部環境的變化而發生改變。
const PC_DEFINITION = "Platform Coordinate System is an inertial coordinate system based on the reference frame of the aircraft itself, and it does not change with the change of the external environment.";
五、載體坐標系方向定義
載體坐標系的x軸正方向指向飛行方向,y軸正方向指向右側,z軸正方向指向下方。
const PC_DIRECTION_DEFINITION = "The positive direction of x-axis in the platform coordinate system points to the flight direction, the positive direction of y-axis points to the right side, and the positive direction of z-axis points to the downward direction.";
六、載體坐標系和導航坐標系
載體坐標系和導航坐標系之間需要進行坐標變換。在導航坐標系下,機頭指向正北,機側指向東,垂線於地面的方向指向上。而在載體坐標系下,這些方向的定義是不固定的,需要根據載體的運動狀態進行確定。
/**
* 坐標系變換:載體坐標繫到導航坐標系
* @param {array} pc 坐標原點的坐標值[x,y,z]
* @param {number} roll 橫滾角
* @param {number} pitch 俯仰角
* @param {number} yaw 航向角
*/
function PC2Nav(pc, roll, pitch, yaw) {
// 坐標變換公式
// 根據載體的運動狀態確定各個方向的定義
const N = [-Math.cos(pitch)*Math.sin(yaw), Math.cos(pitch)*Math.cos(yaw), -Math.sin(pitch)];
const E = [-Math.cos(roll)*Math.cos(yaw) + Math.sin(pitch)*Math.sin(roll)*Math.sin(yaw), Math.cos(roll)*Math.sin(yaw) + Math.sin(pitch)*Math.sin(roll)*Math.cos(yaw), Math.cos(pitch)*Math.sin(roll)];
const D = [Math.sin(roll)*Math.cos(yaw) + Math.sin(pitch)*Math.cos(roll)*Math.sin(yaw), -Math.sin(roll)*Math.sin(yaw) + Math.sin(pitch)*Math.cos(roll)*Math.cos(yaw), Math.cos(pitch)*Math.cos(roll)];
// 將PC系下的各個方向向量進行坐標變換得到導航坐標系下的對應方向向量
const n = [N[0]*pc[0] + N[1]*pc[1] + N[2]*pc[2], E[0]*pc[0] + E[1]*pc[1] + E[2]*pc[2], D[0]*pc[0] + D[1]*pc[1] + D[2]*pc[2]];
return n;
}
七、載體坐標系俯仰角計算
載體坐標系的俯仰角是指其y-z投影量的夾角,用於描述載體相對於水平面的傾斜程度。
/**
* 計算載體坐標系下的俯仰角
* @param {array} n10 垂線於地面的方向向量
*/
function calcPitch(n10) {
const { x, y, z } = { x: n10[0], y: n10[1], z: n10[2] };
let pitch = Math.atan2(-x, Math.sqrt(y*y + z*z));
return pitch;
}
八、載體坐標繫到地理坐標系轉換
載體坐標繫到地理坐標系的轉換需要引入大地坐標系下的經緯度作為參數,通過將載體坐標系下的各點坐標進行坐標變換得到地理坐標系下的對應點坐標。
/**
* 坐標系變換:載體坐標繫到地理坐標系
* @param {array} pc 坐標原點的坐標值[x,y,z]
* @param {number} latitude 緯度值
* @param {number} longitude 經度值
* @param {number} altitude 高度值
* @param {number} roll 橫滾角
* @param {number} pitch 俯仰角
* @param {number} yaw 航向角
*/
function PC2Geo(pc, latitude, longitude, altitude, roll, pitch, yaw) {
// 將載體坐標系下各點坐標進行坐標變換得到地理坐標系下的對應點坐標
const n = PC2Nav(pc, roll, pitch, yaw);
const n10 = [n[0], n[1], 0];
const pitch_n10 = calcPitch(n10);
const C_en = CalcC_en(latitude, longitude);
const en = MatrixMultiply(C_en, n);
const pitch_en = calcPitch(en);
const geodetic = CalcGeodetic(latitude, longitude, altitude, en);
return geodetic;
}
九、導航坐標系
導航坐標系是一種慣性坐標系,以地球為基礎,以某一導航引導信號的參考方向和涵蓋區域為基礎建立。
/** * 導航坐標系簡介 */ const NAV_COORDINATE_SYSTEM = "Navigation Coordinate System is an inertial coordinate system, which is established based on the direction and coverage area of a navigation guidance signal with the Earth as the basis.";
十、平台坐標系選取
平台坐標系的選取需要考慮飛行器的運動特點並確定坐標系的原點以及各方向的定義。
/**
* 平台坐標系選取和定義
* @param {array} pc 坐標原點的坐標值[x,y,z]
* @param {number} roll 橫滾角
* @param {number} pitch 俯仰角
* @param {number} yaw 航向角
*/
function selectPlatformCoordinateSystem(pc, roll, pitch, yaw) {
// 根據飛行器的運動特點確定坐標系的原點以及各方向的定義
const N = [1, 0, 0];
const E = [0, 1, 0];
const D = [0, 0, 1];
// 將PC系下的各個方向向量進行坐標變換得到導航坐標系下的對應方向向量
const n = [N[0]*pc[0] + N[1]*pc[1] + N[2]*pc[2], E[0]*pc[0] + E[1]*pc[1] + E[2]*pc[2], D[0]*pc[0] + D[1]*pc[1] + D[2]*pc[2]];
const nav = PC2Nav(pc, roll, pitch, yaw);
// 比較n和nav向量的夾角大小,選擇夾角小的作為平台坐標系的x軸正方向
const dotRes = DotProduct(n, nav);
if (dotRes > 0) {
return new PlatformCoordinateSystem(pc, N, E, D);
} else {
return new PlatformCoordinateSystem(pc, nav, CrossProduct(nav, N), CrossProduct(nav, CrossProduct(nav, N)));
}
}
十一、總結
通過對載體坐標系的詳細闡述,我們了解了其定義和英文名稱,以及和其他坐標系的轉換方法,以及俯仰角計算和平台坐標系的選取等方面內容,這些都在航天航空的領域有着廣泛的應用。
原創文章,作者:小藍,如若轉載,請註明出處:https://www.506064.com/zh-hk/n/238628.html
微信掃一掃
支付寶掃一掃