Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IDEA] Has anyone played with Collision Detection? #23

Open
saraford opened this issue Jul 23, 2016 · 3 comments
Open

[IDEA] Has anyone played with Collision Detection? #23

saraford opened this issue Jul 23, 2016 · 3 comments

Comments

@saraford
Copy link
Contributor

Hey all,

I've noticed the collision detection is hit or miss. I've followed this Issue to tweak the sensitivity, but it is unreliable. I can pick up BB-8 and a collision is detected. But BB-8 can run into a wall and lose its head and no collision detected. Seems that the collision has to be at a certain spot on the ball.

Curious if anyone else has tried to play with collision detection.

Here's my code:

module.exports = function (bb8) {

  console.log("Waiting for a collision");

  bb8.detectCollisions();
  bb8.color("green");

  bb8.configureCollisions({
    meth: 0x01,
    xt: 0x20,
    yt: 0x20,
    xs: 0x20,
    ys: 0x20,
    dead: 0x50
  });

  bb8.on("collision", function(data) {
     console.log("collision detected");
     console.log("  data:", data);

     bb8.color("red");

     setTimeout(function() { bb8.color("green"); }, 1000);
  });

  bb8.roll(200, 0);
}
@Sud-Puth
Copy link
Contributor

Hi Sara,

I tried to play with the collision detection when I was working on the
drive mode and I too echo your thoughts that the detection is unreliable.
It can be added as a fun feature but I guess cannot be taken for granted.

On Jul 22, 2016 9:56 PM, "Sara Ford" notifications@github.com wrote:

Hey all,

I've noticed the collision detection is hit or miss. I've followed this
Issue to tweak the sensitivity
sphero-inc/sphero.js#48, but it is unreliable. I
can pick up BB-8 and a collision is detected. But BB-8 can run into a wall
and lose its head and no collision detected. Seems that the collision has
to be at a certain spot on the ball.

Curious if anyone else has tried to play with collision detection.

Here's my code:

module.exports = function (bb8) {

console.log("Waiting for a collision");

bb8.detectCollisions();
bb8.color("green");

bb8.configureCollisions({
meth: 0x01,
xt: 0x20,
yt: 0x20,
xs: 0x20,
ys: 0x20,
dead: 0x50
});

bb8.on("collision", function(data) {
console.log("collision detected");
console.log(" data:", data);

 bb8.color("red");

 setTimeout(function() { bb8.color("green"); }, 1000);

});

bb8.roll(200, 0);
}


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#23, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAJcu9mkNirIzN3rqUAXhft3lclQYaQkks5qYXSsgaJpZM4JTQT1
.

@saraford
Copy link
Contributor Author

@Sud-Puth Thanks for the response! I tried adjusting the configureCollisions sensitivity to what I'm guessing is the lowest levels and still can't detect a collision. I'll ask on the Sphero repo if no one here has figured it out. Thanks!

@clodio
Copy link

clodio commented Dec 16, 2017

I just play with sphero edu app and i have the same problem coollision detection not working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants