Search code examples
sphero-apisphero

Sphero API Calibration


PROBLEM: SetHeading API doesn't calibrate Sphero.

I am building a small little custom app with Sphero and would like to implement a configuration UI. However, I am not using the RobotLibrary but instead making Sphero API calls.

When implementing the Sphero calibration steps:

  1. I turn on the back led.
  2. I issue the SetHeading command with the heading data, but the device doesn't not adjust.

    Alternatively, I can send the Roll command with a velocity of zero and the heading data and the device does adjust in place. However, after calibration is over, when I attempt to "Roll" the device, the device with adjust back to original calibration and then move.

CONCLUSION: It seems that Roll command with a zero velocity is not the correct way to calibration the Sphero but SetHeading doesn't do anything. I have tried the SetHeading with SetStabilization on and off. Neither effects SetHeading and aids the calibration.

Any help would be appreciated.


Solution

  • Use the Roll command with zero velocity to 'aim' the robot. As you noted, lighting the back led is helpful. Once done aiming, call SetHeading with 0 degrees heading parameter.