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

How to make cozmo automatically detect cube and move forward #198

Closed
thunderslack91 opened this issue Jun 22, 2018 · 1 comment
Closed

Comments

@thunderslack91
Copy link

All the code managed to work except the last line of the code. My code is unable to make the cozmo go towards the cube.

 if (intentName=="findcube")
                   {
                      // pythonCode += tabs + "\trobot.play_anim_trigger(cozmo.anim.Triggers.MajorWin)\n";
                       pythonCode += tabs + "\tcube1 = robot.world.get_light_cube(LightCube1Id)\n";
                       pythonCode += tabs + "\tcube2 = robot.world.get_light_cube(LightCube2Id)\n";
                       pythonCode += tabs + "\tcube3 = robot.world.get_light_cube(LightCube3Id)\n\n";
                       pythonCode += tabs + "\tcube1.set_lights(cozmo.lights.green_light)\n";
                       pythonCode += tabs + "\ttime.sleep(3)\n";
                       pythonCode += tabs + "\tcube2.set_lights(cozmo.lights.green_light)\n";
                       pythonCode += tabs + "\tcube3.set_lights(cozmo.lights.green_light)\n";
                       pythonCode += tabs + "\ttime.sleep(3)\n";
                       pythonCode += tabs + "\trobot.start_behavior(cozmo.behavior.BehaviorTypes.LookAroundInPlace)\n";
                       pythonCode += tabs + "\trobot.world.wait_for_observed_light_cube(timeout = 30)\n";
                       pythonCode += tabs + "\trobot.start_behavior(cozmo.behavior.BehaviorTypes.LookAroundInPlace).Stop()\n";
                       pythonCode += tabs + "\trobot.go_to_object(cube, distance_mm(70.0)).wait_for_completed()\n";
                   }
@msintov
Copy link
Contributor

msintov commented Jun 22, 2018

Hi @thunderslack91! Our forums (https://forums.anki.com) are a better place to ask these sorts of questions to get community feedback as well as access to Anki developers. github issues should be instead specific bugs with or possible improvements to the Anki Cozmo SDK Python code itself.

@msintov msintov closed this as completed Jun 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants