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),
	},
}));

效果:

传感器

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

  • 7
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 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、付费专栏及课程。

余额充值