Sign Detection with Humanoid

Example Description
Learn how to set the bounding box threshold, and detect signals such as 'Go', 'TurnRight', 'TurnLeft', and 'Stop' to control humanoid movements.

Intorduction

A sign detector humanoid robot is a robot that can recognize and interpret certain signs or signals, such as hand gestures or verbal commands, given by a human. The robot uses sensors, cameras, and machine learning algorithms to detect and understand the sign, and then performs a corresponding action based on the signal detected.

These robots are often used in manufacturing, healthcare, and customer service industries to assist with tasks that require human-like interaction and decision making.

Code

sprite = Sprite('Tobi')
quarky = Quarky()


import time
humanoid = Humanoid(7, 2, 6, 3, 8, 1)
recocards = RecognitionCards()
recocards.video("on flipped")
recocards.enablebox()
recocards.setthreshold(0.6)

while True:
  recocards.analysecamera()
  sign = recocards.classname()
  sprite.say(sign + ' detected')
  if recocards.count() > 0:
    if 'Go' in sign:
      humanoid.move("forward", 1000, 1)
      
    if 'Turn Left' in sign:
      humanoid.move("backward", 1000, 1)
      
    if 'Turn Right' in sign:
      humanoid.move("left", 1000, 1)
      
    if 'U Turn' in sign:
      humanoid.move("backward", 1000, 1)
      
      
    

Logic

  1. Then, it sets up the robot’s camera to look for hand signs, and tells it how to recognize different signs.
  2. Next, the code starts a loop where the robot looks for hand signs. If it sees a sign, it says the name of the sign out loud.
  3. Finally, if the robot sees certain signs (like ‘Go’, ‘Turn Left’, ‘Turn Right’, or ‘U Turn’), it moves in a certain direction (forward, backward, left, or backward) based on the sign it sees.
  4. So, this code helps a robot understand hand signs and move in response to them!

Output

Table of Contents