Hello World, I have a problem with this code for @cozmo
In the last section of the code _if a == 'No' or 'no
'
or _if a == 'yes' or 'Yes'
For some reason, it just tells @cozmo to do both of the commands.
Anyway here is the whole script.
def cozmo_program(robot: cozmo.robot.Robot):
robot.set_all_backpack_lights(cozmo.lights.blue_light)
robot.say_text("Hi my name is cozmo, What is your name?").wait_for_completed()
myName = input()
robot.say_text("Well HI," + myName).wait_for_completed()
# Drive forwards for 150 millimeters at 50 millimeters-per-second.
robot.drive_straight(distance_mm(150), speed_mmps(50)).wait_for_completed()
robot.drive_straight(distance_mm(-150), speed_mmps(100)).wait_for_completed()
robot.turn_in_place(degrees(-360)).wait_for_completed()
robot.say_text("Well do you like my moves " + myName).wait_for_completed()
a = input()
#Does if a == 'No' or 'no' and then if a == 'Yes' or 'yes' no matter what you type
if a == 'No' or 'no':
robot.say_text("Sorry for asking...").wait_for_completed()
robot.turn_in_place(degrees(240)).wait_for_completed()
if a == 'yes' or "Yes":
robot.say_text("Thank you very much" + myName).wait_for_completed()
robot.drive_straight(distance_mm(-150), speed_mmps(100)).wait_for_completed()
Does this have anything to do with jsqrcode ? This seems to be python handling some kind of robot, whereas this library, which is now deprecated, handles the decoding of qrcodes.
Hello World, I have a problem with this code for @cozmo In the last section of the code _if a == 'No' or 'no ' or _if a == 'yes' or 'Yes'
For some reason, it just tells @cozmo to do both of the commands.
Anyway here is the whole script.
def cozmo_program(robot: cozmo.robot.Robot): robot.set_all_backpack_lights(cozmo.lights.blue_light) robot.say_text("Hi my name is cozmo, What is your name?").wait_for_completed()
cozmo.run_program(cozmo_program)