铯地球:在ECI坐标系中显示卫星 [英] Cesium Earth: Show satellites in ECI coordinate system

查看:149
本文介绍了铯地球:在ECI坐标系中显示卫星的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用铯地球开发用于卫星跟踪的应用程序.

I'm using Cesium Earth to develop an application for satellite tracking.

现在,卫星坐标位于地球固定系统中,并且可以正常工作.

Now, the satellite coordinates are in Earth Fixed system and it works OK.

但是,我还需要在ECI坐标系中显示它们,因此必须使地球旋转.

However, I need to show them also in ECI coordinate frame and for that I have to make the Earth rotate.

该怎么做?

推荐答案

我将首先提到Cesium经常使用名称ICRF作为ECI的同义词或替代,因此,如果您要搜索文档,将拥有寻找ICRF的运气更好.

I'll start by mentioning that Cesium often uses the name ICRF as a synonym or replacement for ECI, so if you're searching the documentation you'll have better luck looking for ICRF.

CZML沙堡演示显示了一些绕地球轨道运行的卫星,其路径如图惯性系.这是在CZML文件中完成做两件事:

The CZML Sandcastle Demo shows some satellites orbiting the Earth with paths shown in the Inertial frame. This is done in the CZML file by doing two things:

  • position 部分
  • 中设置值"referenceFrame":"INERTIAL"
  • 所有实际 position 值本身必须以惯性而非固定帧表示.
  • Set the value "referenceFrame":"INERTIAL" in the position section
  • All of the actual position values must themselves be expressed in Inertial, not Fixed frame.

您可以确定该路径为Inertial,因为它是椭圆形.如果以固定在地球上的方式显示它,则它看起来就像一个螺旋形,疯狂地绕着地球循环.随着时间的流逝,椭圆形当然应该与恒星保持在惯性系中,而不是固定在地球上任何一个陆地之上.

You can tell the path is in Inertial because it is an ellipse. If it were being shown in Earth-fixed, it would look like a spiral, looping crazily around the Earth. As time passes the orbit ellipse should of course remain in the Inertial frame with the stars, not remaining fixed above any one landmass on the Earth.

但是,我还需要在ECI坐标系中显示它们,因此必须使地球旋转.

However, I need to show them also in ECI coordinate frame and for that I have to make the Earth rotate.

这是两个单独的问题.在铯中,地球的固定框架已经相对于ICRF框架(内部)旋转.但是默认情况下,相机会保持在地球固定(ECF)模式下.因此,用户可以看到地球看起来静止不动,而恒星和卫星轨道似乎围绕地球自转.这实际上是查看系统的一种有效方法,就好像照相机只是被卡在附着在地球上的一根很高的杆上一样,横扫不同的轨道.

Those are two separate problems. In Cesium, the Earth's fixed frame is already rotating (internally) with respect to the ICRF frame. But the camera stays in Earth-fixed (ECF) by default. So the user sees the Earth appear stationary, and the stars and satellite orbits appear to rotate around the Earth. This is actually a valid way to view the system, as if the camera were just stuck on a very tall pole that was attached to the Earth, sweeping through different orbits.

要使地球随着时间在屏幕上可视地旋转,您必须更新相机的位置,以使其保持在ICRF框架中,而不是默认的固定框架.

To make the Earth visually rotate on-screen as time passes, you have to update the Camera's position to keep it stationary in the ICRF frame, as opposed to the default fixed frame.

相机沙堡演示有一个生动的例子.点击下拉菜单,然后从列表中选择在ICRF中查看.此代码从左侧实时编辑窗口中的第119行开始:

The Camera Sandcastle Demo has a live example of this. Click the dropdown and select View in ICRF from the list. The code for this begins around line 119 in the live-edit window on the left side:

function icrf(scene, time) {
    if (scene.mode !== Cesium.SceneMode.SCENE3D) {
        return;
    }

    var icrfToFixed = Cesium.Transforms.computeIcrfToFixedMatrix(time);
    if (Cesium.defined(icrfToFixed)) {
        var camera = viewer.camera;
        var offset = Cesium.Cartesian3.clone(camera.position);
        var transform = Cesium.Matrix4.fromRotationTranslation(icrfToFixed);
        camera.lookAtTransform(transform, offset);
    }
}

viewer.scene.postUpdate.addEventListener(icrf);

此代码只是随着时间的流逝更新相机的位置,以使相机看起来静止在ICRF框架中,其中有恒星和卫星轨道,并且地球本身显示为自转.

This code just updates the camera's position as time passes, such that the camera appears to be stationary in the ICRF frame with the stars and the satellite orbits, and the Earth itself is shown to rotate.

这篇关于铯地球:在ECI坐标系中显示卫星的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆