sphero.js icon indicating copy to clipboard operation
sphero.js copied to clipboard

Calibrating the sphero using set heading

Open jacensherman opened this issue 10 years ago • 8 comments
trafficstars

Hi, I'm one of the MSPs working on the Sphero pilot program. I've been doing a lot of research trying to figure out how to calibrate the Sphero without physically picking it up.

I found that on other platforms the way of doing this is to start calibration and then set heading (I believe). How might I do this with node.

I already have a custom element slider that generates a number between 0 and 360 that the user can use to calibrate the Sphero.

Thanks so much!

jacensherman avatar Jun 30 '15 04:06 jacensherman

@jacensherman this code will rotate the sphero in place and set the new heading.

var heading = 90;
orb.roll(1, heading, 2, function() {
  setTimeout(function() {
    orb.setHeading(0, function() {
      orb.roll(0,0,1);
    });
  }, 300);
});

zankich avatar Jun 30 '15 06:06 zankich

Worth adding to the README?

deadprogram avatar Jun 30 '15 14:06 deadprogram

Thanks so much! I've got it pretty much working! The only thing that's a little confusing is that it would seem the calibration functions would allow for remote rotation. But, this way does also make sense.

jacensherman avatar Jun 30 '15 20:06 jacensherman

How do you set the rotation rate? This is in other SDK's but is not mentioned in this one?

DarrenGuinness avatar Oct 29 '15 17:10 DarrenGuinness

@dronious https://github.com/orbotix/sphero.js/blob/800142d15d0a3276f3df529e8306dd295e579a16/lib/devices/sphero.js#L64

olcar avatar Jan 16 '16 21:01 olcar

@jacensherman @deadprogram do you think there's anything worth mentioning in the README?

If not, I think we can easily close that issue.

olcar avatar Jan 16 '16 21:01 olcar

@zankich What is the purpose of the third parameter in your roll command? I see that it represents state, but I can't seem to find any documentation that indicates what its for. I'm also having trouble with the rotation rate, and I'm wondering if that third parameter has something to do with it?

NAllred91 avatar Feb 07 '18 15:02 NAllred91

@NAllred91 The third parameter can be used to command Sphero to stop rolling (true = stop; false = don't stop)

JudithLim avatar Jun 25 '18 08:06 JudithLim