Introduction
A sign detector Mars Rover 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')
# sprite = Sprite('Tobi')
quarky = Quarky()
import time
recocards = RecognitionCards()
rover = MarsRover(4, 1, 7, 2, 6)
recocards.video("on flipped")
recocards.enablebox()
recocards.setthreshold(0.6)
while True:
recocards.analysecamera()
sign = recocards.classname()
sprite.say(sign + ' detected')
if recocards.count() > 1:
if 'Go' in sign:
rover.home()
rover.setinangle(0)
quarky.runtimedrobot("F",100,3)
if 'Turn Left' in sign:
rover.home()
rover.setinangle(40)
quarky.runtimedrobot("L",100,3)
if 'Turn Right' in sign:
rover.home()
rover.setinangle(40)
quarky.runtimedrobot("R",100,3)
if 'U Turn' in sign:
rover.home()
rover.setinangle(0)
quarky.runtimedrobot("B",100,3)
Logic
- Firstly, the code sets up the stage camera to look for signs and detects and recognizes the signs showed on the camera.
- Next, the code starts a loop where the stage camera continuously checks for the signs.
- 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 respective signs.
- This can help the Mars Rover to manoeuvre through the terrain easily by just showing signs on the camera.
Output
Forward-Backward Motions:
Right-Left Motions: