如何在Microsoft Robotics Studio 2.0中创建新类型的实体?
我试图用 MRS 做的是自学一些基本的人工智能; 我想做的是制作一个火箭实体,带有矢量排气和分级等功能。 有人知道如何制作可以飞行的实体吗? 或者我只需要不断地向上施加力?
What I'm trying to do with MRS is to teach myself some basic AI; what I want to do is to make a rocket entity, with things such as vectored exhaust, and staging. Anyone have an idea on how to make an entity that can fly? Or do I just need to constantly apply a force upwards?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
嘿 TraumaPony,你的问题看起来很孤独:)
我看了一篇关于 MRS 2.0 的 MSDN 文章
Hey TraumaPony, your question looked lonely :)
I took a look at an MSDN article about MRS 2.0 here I believe you'll actually need to create a Rocket entity of some kind and then a Thruster entity that it can use. In the article they were able to reuse a DifferentialDrive entity to propel their bot forward. I hope that helps. I'm more or less shooting in the dark since no else has tried to help ya out yet. Cheers! :)
我自己刚刚开始使用 MRS - 但我认为您走在正确的轨道上,您需要创建一个可以施加推力的火箭发动机实体。 有关示例,请参阅模拟教程 2 - 使用模拟服务组合实体创建一个实体。
您可以使用
Simulation.Physics.PhysicsEntity.ApplyForce()
施加力。 我认为您应该在实体的Update()
方法中执行此操作。 但这取决于ApplyForce是否实际上施加了脉冲(仅适用于该帧的力)或者是否确实添加了持久力。 我假设是前者,因为我看不到取消申请的方法。 在这种情况下,Update() 可能是正确的地方。 如果它持续存在,您只需在推力水平发生变化时执行此操作。您还需要创建一个与实体合作的服务,以便您可以与火箭进行交互,例如发射或引导它。 同一篇文章中有一个服务创建的示例。
I'm just starting with MRS myself - but I think you are on the right track, you need to create a rocket engine entity that you can apply a thrust force to. See Simulation Tutorial 2 - Compose Entities with Simulation Services for an example of creating an entity.
You can apply force with
Simulation.Physics.PhysicsEntity.ApplyForce()
. I think you'd do that in your entity'sUpdate()
method. But it depends if ApplyForce is actually applying an Impulse (a force for that frame only) or if it's really adding a persistant Force. I'm assuming its the former, since I see no way of unapplying. In that case, Update() is probably the right place. If it is persistant, you only need to do it when thrust levels change.You'll also need to create a Service that partners with the Entity so that you can interact with your rocket, for instance to fire or vector it. There's an example of Service Creation in the same article.