我刚刚得到了一个Sphero v2.0,并且一直在使用SDK在Eclipse中为Sphero创建android应用程序。
在官方应用程序中,有一个函数可以使地面https://play.google.com/store/apps/details?id=orbotix.sphero&hl=en的球体跳跃
我可以控制Sphero的移动,但找不到通过代码跳转的方法。有没有人知道怎么做?
发布于 2014-07-14 00:19:31
我已经能够用这个宏在iOS上做到这一点:
RKMacroObject *macro = [RKMacroObject new];
[macro addCommand:[RKMCRoll commandWithSpeed:0.15 heading:0 delay:0]];
[macro addCommand:[RKMCRawMotor commandWithLeftMode:1 leftSpeed:255 rightMode:1 rightSpeed:253 delay:255]];
[macro addCommand:[RKMCDelay commandWithDelay:1000]];
[macro playMacro];我猜它在Java中应该是这样的:)
MacroObject macro = new MacroObject();
macro.addCommand(new Roll(0.15, 0, 0));
macro.addCommand(new RawMotor(1, 255, 1, 253, 255);
macro.addCommand(new Delay(1000));
sphero.executeMacro(macro);然后,您可以调整滚动速度,延迟和左右电机的速度差。
https://stackoverflow.com/questions/24510358
复制相似问题