如何在Microsoft Robotics Studio 2.0中创建新类型的实体?

发布于 2024-07-05 22:20:19 字数 96 浏览 10 评论 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

故事与诗 2024-07-12 22:20:19

嘿 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! :)

守望孤独 2024-07-12 22:20:19

我自己刚刚开始使用 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's Update() 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文