1

我想知道是否有办法手动校准球体?这是一个很棒的设备,但是一旦你开始四处走动,你就会迷失在哪里。我想做一些技巧,你的 gps 可以给 sphero 一个关于你在哪里的线索,然后重新校准或其他方式,例如让你在房子的房间里走来走去,很容易让 sphero 知道你在哪里你是。还有一种方法可以让尾灯一直亮着,这样用户就可以随时知道哪条路是前进的?

--- 编辑 --- 以下是我在查看 javadocs 时尝试过的一些事情:

import orbotix.robot.base.Robot;
import orbotix.robot.base.RobotProvider;

RobotProvider provider = RobotProvider.getDefaultProvider();
Robot sphero = provider.getRobots().iterator().next();
sphero.startCalibration();
sphero.rotateToHeading(angle);
sphero.stopCalibration();

从文档看来,这应该可以工作,但似乎没有任何 sphero 命令可用。

--- 编辑 2013 年 12 月 30 日 ---

好的,我刚刚想出了如何打开尾灯。这是我正在使用的:

import orbotix.robot.base.BackLEDOutputCommand;
BackLEDOutputCommand.sendCommand(mRobot, 1.0f);

浮点值是尾灯的强度。希望对某人有所帮助。

4

1 回答 1

1

You should be able to turn the tail light on and it will stay on.

To "calibrate" sphero we normally use the "set heading" command, although I don't think that is what you want in this case.

It sounds like you want to mimic our "auto-heading adjust" feature in some of our apps. We do this by hooking into the gyro on the phone and and keep an offset of the yaw from when the user calibrated using our standard calibration control. When sending roll commands from the joystick we look at this yaw offset and adjust the heading appropriately before sending the roll command.

于 2013-11-18T18:21:00.397 回答