STK Components 二次开发-创建卫星

1.卫星数据

可以用stk 里面自带的 参数帮助文档。

也可以自己下载

CelesTrak: Current GP Element Sets

这里你所需要的最新卫星数据全有。

其实创建需要的就是卫星的二根数。

给定二根数也可以。

读取数据库中的卫星数据

这个接口优先下载最新的。

var tleList = TwoLineElementSetHelper.GetTles(m_satelliteIdentifier, JulianDate.Now);

也可直接指定

var issTle =
    new TwoLineElementSet(@"1 25544U 98067A   10172.34241898  .00007451  00000-0  60420-4 0  3627
                            2 25544  51.6459 209.3399 0009135 352.3227 186.5240 15.71934500664129");

2.创建卫星对象


// Propagate the TLE and use that as the satellite's location point.
var issPoint = new Sgp4Propagator(issTle).CreatePoint();
var m_satellite= new Platform
{
    Name = "ISS",
    LocationPoint = issPoint,
    OrientationAxes = new AxesVehicleVelocityLocalHorizontal(earth.FixedFrame, issPoint),
};

3.设置卫星名称

var labelExtension = new LabelGraphicsExtension(new LabelGraphics
{
    Text = new ConstantCesiumProperty<string>(m_satellite.Name),
    FillColor = new ConstantCesiumProperty<Color>(Color.White),
});
m_satellite.Extensions.Add(labelExtension);

4.设置卫星模型

 // Configure a glTF model for the satellite.
m_satellite.Extensions.Add(new ModelGraphicsExtension(new ModelGraphics
 {
    // Link to a binary glTF file.
    Model = new CesiumResource(GetModelUri("satellite.glb"),CesiumResourceBehavior.LinkTo),
    // By default, Cesium plays all animations in the model simultaneously, which is not desirable.
    RunAnimations = false,
 }));

设置卫星轨迹线颜色

// Configure graphical display of the orbital path of the satellite
m_satellite.Extensions.Add(new PathGraphicsExtension(new PathGraphics
{
    // Configure the visual appearance of the line.
    Material = new PolylineOutlineMaterialGraphics
    {
        Color = new ConstantCesiumProperty<Color>(Color.White),
        OutlineWidth = new ConstantCesiumProperty<double>(1.0),
        OutlineColor = new ConstantCesiumProperty<Color>(Color.Black),
    },
    Width = 2,
    // Lead and Trail time indicate how much of the path to render.
    LeadTime = Duration.FromMinutes(44).TotalSeconds,
    TrailTime = Duration.FromMinutes(44).TotalSeconds,
}));

完成后的样子

完整代码

        private void CreateSatellite()
        {
            // Get the current TLE for the given satellite identifier.
            var tleList = TwoLineElementSetHelper.GetTles(m_satelliteIdentifier, JulianDate.Now);

            // Use the epoch of the first TLE, since the TLE may have been loaded from offline data.
            m_epoch = tleList[0].Epoch;

            // Propagate the TLE and use that as the satellite's location point.
            var locationPoint = new Sgp4Propagator(tleList).CreatePoint();
            m_satellite = new Platform
            {
                Name = "Satellite " + m_satelliteIdentifier,
                LocationPoint = locationPoint,
                // Orient the satellite using Vehicle Velocity Local Horizontal (VVLH) axes.
                OrientationAxes = new AxesVehicleVelocityLocalHorizontal(m_earth.FixedFrame, locationPoint),
            };

            // Set the identifier for the satellite in the CZML document.
            m_satellite.Extensions.Add(new IdentifierExtension(m_satelliteIdentifier));

            // Configure a glTF model for the satellite.
            m_satellite.Extensions.Add(new ModelGraphicsExtension(new ModelGraphics
            {
                // Link to a binary glTF file.
                Model = new CesiumResource(GetModelUri("satellite.glb"), CesiumResourceBehavior.LinkTo),
                // By default, Cesium plays all animations in the model simultaneously, which is not desirable.
                RunAnimations = false,
            }));

            // Configure a label for the satellite.
            m_satellite.Extensions.Add(new LabelGraphicsExtension(new LabelGraphics
            {
                // Use the name of the satellite as the text of the label.
                Text = m_satellite.Name,
                // Change the color of the label after 12 hours. This demonstrates specifying that 
                // a value varies over time using intervals.
                FillColor = new TimeIntervalCollection<Color>
                {
                    // Green for the first half day...
                    new TimeInterval<Color>(JulianDate.MinValue, m_epoch.AddDays(0.5), Color.Green, true, false),
                    // Red thereafter.
                    new TimeInterval<Color>(m_epoch.AddDays(0.5), JulianDate.MaxValue, Color.Red, false, true),
                },
                // Only show label when camera is far enough from the satellite,
                // to avoid visually clashing with the model.
                DistanceDisplayCondition = new Bounds(1000.0, double.MaxValue),
            }));

            // Configure graphical display of the orbital path of the satellite.
            m_satellite.Extensions.Add(new PathGraphicsExtension(new PathGraphics
            {
                // Configure the visual appearance of the line.
                Material = new PolylineOutlineMaterialGraphics
                {
                    Color = Color.White,
                    OutlineWidth = 1.0,
                    OutlineColor = Color.Black,
                },
                Width = 2.0,
                // Lead and Trail time indicate how much of the path to render.
                LeadTime = Duration.FromMinutes(44.0).TotalSeconds,
                TrailTime = Duration.FromMinutes(44.0).TotalSeconds,
            }));
        }

生成czml

        public void WriteDocument(TextWriter writer)
        {
            // Configure the interval over which to generate data.
            // In this case, compute 1 day of data.
            var dataInterval = new TimeInterval(m_epoch, m_epoch.AddDays(1));

            // Create and configure the CZML document.
            var czmlDocument = new CzmlDocument
            {
                Name = "CesiumDemo",
                Description = "Demonstrates CZML generation using STK Components",
                RequestedInterval = dataInterval,
                // For this demonstration, include whitespace in the CZML
                // to enable easy inspection of the contents. In a real application,
                // this would usually be false to reduce file size.
                PrettyFormatting = true,
                // Configure the clock on the client to reflect the time for which the data is computed.
                Clock = new Clock
                {
                    Interval = dataInterval,
                    CurrentTime = dataInterval.Start,
                    Multiplier = 15.0,
                },
            };

            // Add all of our objects with graphical extensions.
            czmlDocument.ObjectsToWrite.Add(m_satellite);


            // Write the CZML.
            czmlDocument.WriteDocument(writer);
        }

  • 7
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: STK Commu是一种常用的通信软件开发工具包(SDK),它具有丰富的功能和灵活的二次开发能力,可以用于各种通信领域的应用。在STK Commu的二次开发过程中,我们可以根据具体的需求进行定制开发,以实现特定的通信功能。 首先,我们可以利用STK Commu的API接口来实现与其他通信设备的连接和数据交互。例如,我们可以通过SDK提供的接口实现与传感器、终端设备或其他软件的通信,从而获得实时数据或进行远程控制。 其次,STK Commu还具备网络通信功能,可以支持TCP/IP、UDP等常见的通信协议。我们可以利用这些协议进行网络通信的二次开发,实现数据的传输和通信的稳定性。 此外,STK Commu还提供了丰富的数据处理和管理功能。我们可以使用SDK提供的数据处理接口,对接收到的数据进行解析、处理和存储。同时,STK Commu还支持多种数据格式,如JSON、XML等,使得数据的交互更加灵活多样。 在STK Commu的二次开发中,我们还可以根据需求进行界面定制和用户交互设计。通过SDK提供的界面开发工具,我们可以自定义通信软件的界面风格和布局,使其更加符合用户的需求和习惯。 总之,STK Commu作为一款通信软件开发工具包,具备强大的功能和灵活的二次开发能力,可以满足各种通信应用的需求。通过STK Commu的二次开发,我们可以实现与其他通信设备的连接和数据交互、网络通信功能、数据处理和管理以及界面定制等功能,从而开发出更加强大和定制化的通信软件。 ### 回答2: STK COMMU是一款功能强大的通信工具,具备二次开发的潜力。二次开发是指在原有软件基础上进行定制和扩展,以满足用户的特定需求。 对于STK COMMU的二次开发来说,首先需要了解其提供的功能和接口。通过查阅官方文档或联系软件开发商,可以获取相关资源和技术支持。 在二次开发过程中,我们可以通过编写插件或使用软件开发工具包(SDK)来实现定制化的功能。例如,插件可以增加新的通信协议、改进用户界面、增加数据分析功能等。 此外,我们还可以利用STK COMMU提供的API(应用程序接口)进行开发。API是一组预定义的函数和协议,可以帮助我们与软件进行交互。通过API,我们可以实现与其他软件的集成、数据传输、自动化控制等功能。 对于开发人员来说,具备一定的编程知识和技能是必要的。常见的编程语言如Python、Java、C++等都可以与STK COMMU进行集成。通过编写代码,我们可以进行高度的定制和扩展,以满足特定的需求和业务流程。 总之,STK COMMU的二次开发为用户提供了很多定制化的可能性。通过插件、SDK、API等手段,我们可以为用户量身定制通信工具,扩展其功能和性能,满足其特定的需求。这不仅提高了软件的灵活性和适用性,也促进了更广泛的应用和创新。 ### 回答3: stk commu二次开发是指在原有的stk commu软件基础上进行修改和扩展的开发工作。stk commu是一款用于通信协议仿真和分析的软件,通过对通信协议的建模和仿真,可以帮助用户测试和优化通信系统的性能。 在进行stk commu二次开发时,我们可以根据用户的需求来进行功能定制和改进,以满足特定的应用场景。可能的二次开发方向包括但不限于: 1. 新增通信协议支持:根据需要,可以扩展stk commu的协议库,使其支持更多的通信协议,如蓝牙、WiFi、LTE等。 2. 用户界面定制:可以根据用户的习惯和需求,进行界面的定制和优化,使其更符合用户的使用习惯和工作流程。 3. 数据分析功能增强:可以增加一些数据分析功能,如数据可视化、统计分析等,方便用户获取对通信系统性能的更全面和准确的认识。 4. 集成其他工具和平台:可以将stk commu与其他常用的工具和平台进行集成,如MATLAB、Python等,以便更方便地进行数据分析和算法验证等工作。 5. 性能优化和bug修复:可以对stk commu进行性能优化和bug修复,以提升软件的稳定性和可靠性。 在进行stk commu二次开发时,需要了解stk commu的内部架构和功能模块,并根据用户需求进行相应的开发工作。同时,要充分考虑软件的可扩展性和兼容性,确保二次开发的成果能够与原有的stk commu软件相互兼容和无缝集成。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值