CeeBot:让机器人倾斜
使用CeeBot,我还没有找到获取机器人倾斜角度的方法。
例如,如果机器人要向敌人射击,它就必须改变加农炮的角度来瞄准敌人。
但如果机器人不是在平地上,而是在陡峭的地面上,则炮筒的角度就必须考虑陡峭的角度。
可以知道这个角度吗?
Using CeeBot, I haven't found a way to get the tilt angle of a robot.
For example, if the robot have to shoot at an enemy, it has to change the angle of the canon to aim at the enemy.
But if the robot is not on a flat ground, but on a steep, the angle of the canon will have to take into account the angle of the steep.
Is it possible to know this angle ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在寻找机器人的“俯仰”值。
例如,这个相对简单的代码段找到最近的 TargetBot,然后使用俯仰值加上一些基本三角函数将正确的值输入到 Target() 中。
显然,它没有考虑特定机器人武器的最小/最大高度您正在使用的,或者它的最小-最大范围。
You're looking for the "pitch" value of your robot.
For example, this relatively simple code segment finds the nearest TargetBot and then uses the pitch value plus some basic trigonometry to feed the correct value into aim()
Obviously, it doesn't take into account the min/max elevations for the particular bot weapon you're using, or the min-max range of it.