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.mfbz.cn/a/218216.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

独立版求职招聘平台小程序开发

小程序招聘系统开发 我们开发了一款高效、便捷的互联网招聘平台。在这里&#xff0c;可以轻松实现企业入驻、职位发布、在线求职、精准匹配职位和人才&#xff0c;以及参与招聘会等功能。目标是为求职者和企业搭建一个连接彼此的桥梁&#xff0c;帮助您更快地找到满意的工作&…

基于Go语言实现简易Web应用

目录 前言Go语言特点写在使用Go语言实现Web应用前面创建Web服务器声明一个结构体操作加入中间件的使用使用静态文件服务器最后 前言 在编程语言中&#xff0c;近几年问世的几个新语言都是非常不错的&#xff0c;比如Go、Python、 Rust等等。其中&#xff0c;Go语言(Golang)作…

线程池、及Springboot线程池实践

摘要 本文介绍了线程池基本概念、线程及线程池状态、java中线程池提交task后执行流程、Executors线程池工具类、最后介绍在springboot框架下使用线程池和定时线程池&#xff0c;以及task取消 线程池基本 背景 线程池 线程池是一种多线程处理形式&#xff0c;处理过程中将任务…

探索人工智能领域——每日20个名词详解【day8】

目录 前言 正文 总结 &#x1f308;嗨&#xff01;我是Filotimo__&#x1f308;。很高兴与大家相识&#xff0c;希望我的博客能对你有所帮助。 &#x1f4a1;本文由Filotimo__✍️原创&#xff0c;首发于CSDN&#x1f4da;。 &#x1f4e3;如需转载&#xff0c;请事先与我联系以…

使用UART和USART在STM32上进行双向通信

在本文中&#xff0c;我们将深入了解如何在STM32上使用UART&#xff08;通用异步收发传输器&#xff09;和USART&#xff08;通用同步异步收发传输器&#xff09;实现双向通信。UART和USART是常见的串口通信协议&#xff0c;通常用于与其他设备进行数据传输。我们将重点介绍如何…

01_W5500简介

目录 W5500简介&#xff1a; 芯片特点: 全硬件TCPIP协议栈: 引脚分布&#xff1a; W5500简介&#xff1a; W5500是一款高性价比的以太网芯片&#xff0c;其全球独一无二的全硬件TCPIP协议栈专利技术&#xff0c;解决了嵌入式以太网的接入问题&#xff0c;简单易用&#xff…

redis 安装在liunx安装和常用文件配置

文章目录 安装配置文件设置测试启动服务连接服务 安装 1.官网下载压缩包: https://redis.io/download/ 2.将压缩包上传到Linux环境中 解压: tar -xvf redis-xxxxx 3.liunx 需要c的环境 yum -y install gcc-c4.进入redis文件夹 make && make install5.推荐不是必须…

CPP-SCNUOJ-Problem P24. [算法课贪心] 跳跃游戏

Problem P24. [算法课贪心] 跳跃游戏 给定一个非负整数数组 nums &#xff0c;你最初位于数组的 第一个下标 。 数组中的每个元素代表你在该位置可以跳跃的最大长度 判断你是否能够到达最后一个下标。 输入 输入一行数组nums 输出 输出true/fasle 样例 标准输入 2 3 1 …

spring cloud 整合Feign经行远程调用

文章目录 Feign远程调用Feign替代RestTemplate1&#xff09;引入依赖2&#xff09;添加注解3&#xff09;编写Feign的客户端4&#xff09;测试5&#xff09;总结 自定义配置配置文件方式Java代码方式 Feign使用优化 Feign远程调用 先来看我们以前利用RestTemplate发起远程调用…

GORM 多对多many2many 自定义连接表

文章目录 多对多 many2many表结构搭建多对多添加多对多查询多对多的删除、更新 自定义连接表生成表结构操作案例添加文章并添加标签&#xff0c;并自动关联添加文章&#xff0c;关联已有标签给已有文章关联标签替换已有文章的标签查询文章列表&#xff0c;显示标签 自定义连接…

陀螺仪LSM6DSV16X与AI集成(2)----姿态解算

陀螺仪LSM6DSV16X与AI集成.2--姿态解算 概述视频教学样品申请完整代码下载欧拉角万向节死锁四元数法姿态解算双环PI控制器偏航角陀螺仪解析代码上位机通讯加速度演示陀螺仪工作方式主程序演示 概述 LSM6DSV16X包含三轴陀螺仪与三轴加速度计。 姿态有多种数学表示方式&#xff…

TCL - 库编译过程和官方手册

文章目录 TCL - 库编译过程和官方手册概述笔记编译步骤TCL官方手册END TCL - 库编译过程和官方手册 概述 想看看sqlite3的官方demo工程, 没看到. 想编译一下sqlite3源码, 看看编译后有没有example 工程. 看了sqlite3的官方说明, 他们工程使用tcl来编译的. 一听tcl, 咋这么耳熟…

Ribbon 负载均衡

1、负载均衡整体流程 2、负载均衡流程逐级跟踪运行 (1) LoadBlanced 注解可以使LoadBalancerInterceptor拦截到&#xff1b; (2)LoadBalancerInterceptor 实现了ClientHttpRequestInterceptor接口&#xff1b; (3)ClientHttpRequestInterceptor接口释义如下&#xff1b; (4)int…

k8s引用环境变量

一 定义环境变量 ① 如何在k8s中定义环境变量 env、configmap、secret补充&#xff1a; k8s 创建Service自带的环境变量 ② 从pod属性中获取 kubectl explain deploy.spec.template.spec.containers.env.valueFrom关注&#xff1a; configMapKeyRef、fieldRef 和 resour…

zxjy003- Spring Cloud后端工程搭建

一、创建父工程 1、创建 sprigboot 工程 guli-parent groupId &#xff1a; com.atguigu artifactId &#xff1a; guli-parent

RK3568平台开发系列讲解(Linux系统篇)device_node 转换成 platform_device

🚀返回专栏总目录 文章目录 一、DTB转换规则二、转换源码分析沉淀、分享、成长,让自己和他人都能有所收获!😄 📢本篇将介绍通过设备树 device_node 转换成 platform_device 一、DTB转换规则 device 部分是用 platform_device 结构体来描述硬件资源的, 所以内核最终会将…

【设计模式-3.1】结构型——外观模式

说明&#xff1a;本文介绍设计模式中结构型设计模式中的&#xff0c;外观模式&#xff1b; 亲手下厨还是点外卖&#xff1f; 外观模式属于结构型的设计模式&#xff0c;关注类或对象的组合&#xff0c;所呈现出来的结构。以吃饭为例&#xff0c;在介绍外观模式之前&#xff0…

蓝桥杯网络安全组竞赛

竞赛规则及说明 选拔赛时长&#xff1a;4h 决赛时长&#xff1a;4h 竞赛形式&#xff1a;线上比赛&#xff1a; 个人赛&#xff1a;一人一机&#xff0c;全程机考 大赛制定竞赛系统&#xff0c;在时间内提交答案到比赛系统&#xff0c;超时无法提交 机器环境&#xff1a; 电脑…

matplotlib多子图

matplotlib画图中一个轴占据多个子图 - 知乎 import matplotlib.pyplot as plt fig plt.figure() gs fig.add_gridspec(2,4) ax1 fig.add_subplot(gs[0, 0:2]) ax2 fig.add_subplot(gs[0, 2:]) axa fig.add_subplot(gs[1, 1]) axb fig.add_subplot(gs[1, 2]) axc fig.add…

编写Java应用程序,输出满足1+2+3+……+n<8888的最大正整数n。

源代码&#xff1a; public class Main { public static void main(String[] args) { int i 1; int sum 0; for(i 1;;i){ sum i; if (sum >8888) break; } System.out.println(i-1); } } 实验运行截图&#xff1a;
最新文章