STK Components 二次开发-飞行器

1.创建飞机

参数帮助文档

var poitList = GetTracksData();
var waypointPropagator = new WaypointPropagator(m_earth, poitList);
var locationPoint = waypointPropagator.CreatePoint();m_aircraft = new Platform
{Name = "MH730",LocationPoint = locationPoint,OrientationAxes = new AxesVehicleVelocityLocalHorizontal(m_earth.FixedFrame, locationPoint),
};// Set the identifier for the aircraft in the CZML document. 
m_aircraft.Extensions.Add(new IdentifierExtension("MH730"));// Hermite interpolation works better for aircraft-like vehicles.
m_aircraft.Extensions.Add(new CesiumPositionExtension
{InterpolationAlgorithm = CesiumInterpolationAlgorithm.Hermite
});// Configure a glTF model for the aircraft.
m_aircraft.Extensions.Add(new ModelGraphicsExtension(new ModelGraphics
{// Link to a binary glTF file.Model = new CesiumResource(GetModelUri("aircraft.glb"), CesiumResourceBehavior.LinkTo),// Flip the model visually to point Z in the correct direction.NodeTransformations = new Dictionary<string, NodeTransformationGraphics>{{"Aircraft", new NodeTransformationGraphics{Rotation = new UnitQuaternion(new ElementaryRotation(AxisIndicator.Third, Math.PI))}}},RunAnimations = false,
}));// Show the path of the aircraft.
m_aircraft.Extensions.Add(new PathGraphicsExtension(new PathGraphics
{Width = 2.0,LeadTime = Duration.FromHours(1.0).TotalSeconds,TrailTime = Duration.FromHours(1.0).TotalSeconds,Material = new PolylineOutlineMaterialGraphics{Color = Color.White,OutlineColor = Color.Black,OutlineWidth = 1.0,},
}));// Configure label for the aircraft.
m_aircraft.Extensions.Add(new LabelGraphicsExtension(new LabelGraphics
{Text = m_aircraft.Name,// Change label color over time.FillColor = new TimeIntervalCollection<Color>{// Green by default...TimeInterval.Infinite.AddData(Color.Red),// Red between first and second waypoints.//new TimeInterval<Color>(waypoint1.Date, waypoint2.Date, Color.Red),},// Only show label when camera is far enough from the aircraft,// to avoid visually clashing with the model.DistanceDisplayCondition = new Bounds(1000.0, double.MaxValue),
}));// Define a description for the aircraft which will be shown when selected in Cesium.
m_aircraft.Extensions.Add(new DescriptionExtension(new Description("Aircraft with two offset sensors")));

GetTracksData()函数是对自定义数据处理。其实就是经纬度。

2.飞机上也可以在添加传感器

// Create 30 degree simple conic sensor definition
var sensorCone = new ComplexConic();
sensorCone.SetHalfAngles(0.0, Trig.DegreesToRadians(15));
sensorCone.SetClockAngles(Trig.DegreesToRadians(20), Trig.DegreesToRadians(50));
sensorCone.Radius = double.PositiveInfinity;// Create a sensor pointing "forward".
// Position sensor underneath the wing.
var sensorOneLocationPoint = new PointFixedOffset(m_aircraft.ReferenceFrame, new Cartesian(-3.0, 8.0, 0.0));
var sensorAxesOne = new AxesAlignedConstrained(m_aircraft.OrientationAxes.GetVectorElement(CartesianElement.Z), AxisIndicator.Third,m_aircraft.OrientationAxes.GetVectorElement(CartesianElement.X), AxisIndicator.First);
// This rotation points the z-axis of the volume back along the x-axis of the ellipsoid.
var rotationOne = new UnitQuaternion(new ElementaryRotation(AxisIndicator.Second, Constants.HalfPi / 4));m_aircraftSensorOne = new Platform
{LocationPoint = sensorOneLocationPoint,OrientationAxes = new AxesFixedOffset(sensorAxesOne, rotationOne),
};// Set the identifier for the sensor in the CZML document. 
m_aircraftSensorOne.Extensions.Add(new IdentifierExtension("AircraftSensorOne"));m_aircraftSensorOne.Extensions.Add(new CesiumPositionExtension
{InterpolationAlgorithm = CesiumInterpolationAlgorithm.Hermite
});// Define the sensor geometry.
m_aircraftSensorOne.Extensions.Add(new FieldOfViewExtension(sensorCone));// Configure graphical display of the sensor.
m_aircraftSensorOne.Extensions.Add(new FieldOfViewGraphicsExtension(new SensorFieldOfViewGraphics
{// Configure the outline of the projection onto the earth.EllipsoidSurfaceMaterial = new SolidColorMaterialGraphics(Color.White),IntersectionWidth = 2.0,LateralSurfaceMaterial = new GridMaterialGraphics{Color = Color.FromArgb(171, Color.Blue),},
}));// Create sensor pointing to the "side".
// Position sensor underneath the wing.
var sensorTwoLocationPoint = new PointFixedOffset(m_aircraft.ReferenceFrame, new Cartesian(-3.0, -8.0, 0.0));
var sensorAxesTwo = new AxesAlignedConstrained(m_aircraft.OrientationAxes.GetVectorElement(CartesianElement.Z), AxisIndicator.Third,m_aircraft.OrientationAxes.GetVectorElement(CartesianElement.Y), AxisIndicator.Second);// This rotation points the z-axis of the volume back along the x-axis of the ellipsoid.
var rotationTwo = new UnitQuaternion(new ElementaryRotation(AxisIndicator.First, Constants.HalfPi / 2));m_aircraftSensorTwo = new Platform
{LocationPoint = sensorTwoLocationPoint,OrientationAxes = new AxesFixedOffset(sensorAxesTwo, rotationTwo),
};// Set the identifier for the sensor in the CZML document. 
m_aircraftSensorTwo.Extensions.Add(new IdentifierExtension("AircraftSensorTwo"));m_aircraftSensorTwo.Extensions.Add(new CesiumPositionExtension
{InterpolationAlgorithm = CesiumInterpolationAlgorithm.Hermite
});// Define the sensor geometry.
m_aircraftSensorTwo.Extensions.Add(new FieldOfViewExtension(sensorCone));// Configure graphical display of the sensor.
m_aircraftSensorTwo.Extensions.Add(new FieldOfViewGraphicsExtension(new SensorFieldOfViewGraphics
{// Configure the outline of the projection onto the earth.EllipsoidSurfaceMaterial = new SolidColorMaterialGraphics(Color.White),IntersectionWidth = 2.0,LateralSurfaceMaterial = new GridMaterialGraphics{Color = Color.FromArgb(171, Color.Red),},
}));

效果:

传感器

同理汽车也可以根据定义的轨迹运行

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/197948.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

首次部署Linux系统的经历

我是一名电子信息工程专业的学生&#xff0c;有次在图书馆上自习的时候无意间看到其他同学的电脑屏幕&#xff0c;黑色的屏幕上显示着一行一行的代码&#xff0c;勾起了我无限的好奇&#xff0c;经过询问得知他是用的Linux操作系统&#xff0c;是和Windows完全不同的系统&#…

JDBC操作

本博客主要是介绍JDBC操作&#xff0c;即通过编译器操纵数据库中的数据。接下来以插入操作简单介绍该操作。 首先在创建的项目中&#xff0c;添加下列jar包&#xff08;点击可加载下载页面&#xff09;。 mysql-connector-java-5.1.49.jar 然后编写JDBC代码 public class JDB…

vue3 中使用 sse 最佳实践,封装工具

工具 // 接受参数 export interface SSEChatParams {url: string,// sse 连接onmessage: (event: MessageEvent) > void,// 处理消息的函数onopen: () > void,// 建立连接触发的事件finallyHandler: () > void,// 相当于 try_finally 中的 finally 部分&#xff0c;不…

机器学习(2)回归

0.前提 上一期&#xff0c;我们简单的介绍了一些有关机器学习的内容。学习机器学习的最终目的是为了服务我未来的毕设选择之一——智能小车&#xff0c;所以其实大家完全可以根据自己的需求来学习这门课&#xff0c;我做完另一辆小车后打算花点时间去进行一次徒步行&#xff0…

C++现代模板元编程

序 个人发现很多国外的大佬的演讲或者文章都很不错&#xff0c;但是鲜有人来进行分享&#xff0c;届后本人会时不时拿一些看起来很好的东西来给大家分享&#xff0c;主要也是搬运&#xff0c;不过也省去了大家去读英文的麻烦&#xff0c;同时文章中也会参杂着一些自己的见解。…

游戏mod制作--引擎与解包

摘要 游戏mod的制作过程第一步就是需要将原始的游戏工程文件进行解包&#xff0c;得到相应的资源文件&#xff08;贴图&#xff0c;音频&#xff0c;事件&#xff0c;模型甚至源代码等&#xff09;&#xff0c;这个时候下一步就是需要将解包出来的文件进行分类索引&#xff0c…

服务器内存使用率高的原因及解决方法_Maizyun

服务器内存使用率高的原因及解决方法 在服务器运行过程中&#xff0c;内存使用率过高可能会引发一系列问题&#xff0c;如性能下降、应用程序崩溃等。本文将深入探讨服务器内存使用率高的原因&#xff0c;并提出相应的解决方法。 一、内存使用率高的原因 应用程序缺陷&#…

20:kotlin 类和对象 --泛型(Generics)

类可以有类型参数 class Box<T>(t: T) {var value t }要创建类实例&#xff0c;需提供类型参数 val box: Box<Int> Box<Int>(1)如果类型可以被推断出来&#xff0c;可以省略 val box Box(1)通配符 在JAVA泛型中有通配符?、? extends E、? super E&…

25. K 个一组翻转链表

给你链表的头节点 head &#xff0c;每 k 个节点一组进行翻转&#xff0c;请你返回修改后的链表。 k 是一个正整数&#xff0c;它的值小于或等于链表的长度。如果节点总数不是 k 的整数倍&#xff0c;那么请将最后剩余的节点保持原有顺序。 你不能只是单纯的改变节点内部的值…

自媒体原创改写工具,自媒体首发改写软件

自媒体平台已成为许多创作者表达观点、分享知识和积累影响力的关键渠道。创作是需要技巧和经验的。本文将分享一些自媒体文章改写技巧&#xff0c;并推荐一系列优秀的自媒体文章改写工具&#xff0c;帮助您提升创作效率&#xff0c;创作出更优秀的文章。 自媒体文章改写技巧 …

Backend - Django makemigrations

目录 一、迁移命令 &#xff08;一&#xff09;前提 &#xff08;二&#xff09;生成迁移文件 &#xff08;三&#xff09;执行迁移 二、迁移问题 1. Error&#xff1a;No changes detected 2. Error&#xff1a;You are trying to add a non-nullable field XXX to XXX…

[读论文]BK-SDM: A Lightweight, Fast, and Cheap Version of Stable Diffusion

github: GitHub - Nota-NetsPresso/BK-SDM: A Compressed Stable Diffusion for Efficient Text-to-Image Generation [ICCV23 Demo] [ICML23 Workshop] ICML 2023 Workshop on ES-FoMo 简化方式 蒸馏方式&#xff08;训练Task蒸馏outKD-FeatKD&#xff09; 训练数据集 评测指标…

在intelliJ spring boot gradle插件3.2.0中未找到匹配的变量

我正在尝试使用spring启动Gradle插件的版本3.2.0。这是我的build.gradle文件&#xff1a; plugins {id javaid org.springframework.boot version 3.2.0id io.spring.dependency-management version 1.1.4 }group com.yaxin version 0.0.1-SNAPSHOTjava {sourceCompatibilit…

GPIO的使用--时钟使能含义--代码封装

目录 一、时钟使能的含义 1.为什么要时钟使能&#xff1f; 2.什么是时钟使能&#xff1f; 3.GPIO的使能信号&#xff1f; 二、代码封装 1.封装前完整代码 2.封装结构 封装后代码 led.c led.h key.c key.h main.c 一、时钟使能的含义 1.为什么要时钟使能&#xff1f…

Python开发运维:Python 3.8 常用标准库

目录 一、理论 1.Python3.8 标准库 2.常用标准库 二、问题 1.Python 正则表达式如何实现 一、理论 1.Python3.8 标准库 &#xff08;1&#xff09;官网 Python 标准库 — Python 3.8.17 文档 &#xff08;2&#xff09;其他版本下拉列表查询 2.常用标准库 &#xff0…

MySQL笔记-第01章_数据库概述

视频链接&#xff1a;【MySQL数据库入门到大牛&#xff0c;mysql安装到优化&#xff0c;百科全书级&#xff0c;全网天花板】 文章目录 第01章_数据库概述1. 为什么要使用数据库2. 数据库与数据库管理系统2.1 数据库的相关概念2.2 数据库与数据库管理系统的关系2.3 常见的数据库…

JVM参数配置推荐

JVM配置建议 参数 备注/参数释义 规范 JVM GC方法 ParallelGC&#xff1a;1.8默认&#xff0c;高吞吐量&#xff0c;响应时间不敏感 CMS&#xff1a;响应优先&#xff0c;堆内存8G以下优先选择 G1&#xff1a;响应优先&#xff0c;堆内存8G及以上选择 C端应用&#xff1a;…

微积分中值定理的双存在值证明问题@寻找辅助函数证明中值问题

文章目录 abstract微积分中值定理的双存在值证明题举例综合使用积分中值定理和微分中值定理例 双中值问题构造辅助函数法综合小结 abstract 微积分中值定理的双存在值证明问题寻找辅助函数证明中值问题 微积分中值定理的双存在值证明题举例 综合使用积分中值定理和微分中值定…

Linux--网络编程-ftp(TCP)网络通信-文件交互

项目要求&#xff1a;实现以下内容 远程控制&#xff1a; 1、查看服务器当前路径文件 ls 3、进入、退出服务器文件夹 cd 4、上传文件到服务器 put xxx 本地控制&#xff1a; 1、查看本地&#xff08;客户端&#xff09;文件 lls 2、进入客户端文件夹 lcd 3、获取服务器的文件…

音频录制软件哪个好?帮助你找到最合适的一款

音频录制软件是日常工作、学习和创作中不可或缺的一部分。选择一个适合自己需求的录音软件对于确保音频质量和提高工作效率至关重要。可是您知道音频录制软件哪个好吗&#xff1f;本文将深入探讨两种常见的音频录制软件&#xff0c;通过详细的步骤指南&#xff0c;帮助您了解它…