1: Wall and Canyon robot


Robot 1 : Simple test robot to solve Wall (floor or hand) and Canyon (table edge) in Word Blocks and Python.  Code is asynchronous event driven.  Python code and discussion will be in the next Blog post.

Please post if you tried how it went. Post your challenge question answers, especially if working alone and want a response.

Idea History: This was developed for a 30-minute workshop in summer 2024 with a more compact robot build and only Word Blocks. Campers had to pick what sensor to use to avoid hitting wall and avoiding running off table.  Speed of robot and stopping in time without "damage" is a life lesson for avoiding danger.  Camp theme was Courageous (and have a good character).  Idea fit well in 30 minutes. Also used in 2024 at NÖKISS Robots4Me station as a simple robot to program and test on a table.

Robot Build

Current robot is a low and wide build. This means it has a wider turn, which determine how close to the obstacle the robot can be when it turns.

Wall build: Looking forward

Canyon Build: Distance sensor looking down
Close-up of Distance Sensor connection to robot

Wall and Canyon Challenges

Overview: Robot stops when danger and reacts by changing direction.

  • Uses touch and distance sensor. 
  • Must decide how to react to the danger to the robot 
    1. hitting a wall or 
    2. falling off table into "canyon". 
  • Slight rebuild by changing distance sensor location for second part. 

Wall

The robot will:

  1.  stop
    • when hits something like a wall, hand or obstacle (Touch sensor)
      • hard to hit wall if going fast
    • before hits when "too close" to wall (Distance Sensor)
      • what is "too close"
    • when and how could the color sensor be used?
    • if you built a barrier like going over a pencil, what sensor test could you use?
  2. react
    • turns and goes in a "safe" direction
      • what is a "safe" direction? 
        • turn at angle?
        • turn around?
      • What did you chose and why?
  3. indicate
    • 3 states: "safe", problem, reacting
      • (Word Blocks) Use Power Button
      • (Python) use 3x3 Color Matrix

Canyon  Robot on a table

Requires Slight rebuild: Change the position of the distance sensor so pointing down. Will need to move touch sensor higher. [Hints: Move touch sensor to top of motor. Turn distance sensor mount downward. How far away from the robot can or should the distance sensor be?]

The Robot will:

  1. stop
    • at edge of table when distance becomes larger
    • when and how could the color sensor be used?
    • if you built a barrier like going over a pencil, what sensor test could you use?
  2. react
    • turns and goes in a "safe" direction
    • does a safe direction differ from wall?
  3. indicate
    • 3 states: "safe", problem, reacting
      • (Word Blocks) Use Power Button
      • (Python) use 3x3 Color Matrix
    • Can code from wall indicator be reused without change?

Life application Questions

What do we want to avoid to keep a good character? 

  • Psalm 37:27a  Turn away from?  evil
  • Does someone try to get a close as possible to a danger? How fast are they racing toward a major danger? Romans 3:15-17  ...hurry ... destroy...   

What can be used like sensors to warn us and help us avoid bad decisions and protect us from doing wrong? 

Code samples:

Word Block Code

Code is asynchronous event-driven using broadcast/receive rather than a linear statements in a loop. Robot is doing a random walk. 

Evaluation:  Worked well avoiding obstacles except for furniture legs. 
For table legs, it would keep going in a circle around the furniture leg. Why? Nothing was close enough to shorten the distance sensed and no obstacles to cause the touch sensor to be pressed. For other obstacles approached at an angle, the robot would turn until close enough to sense within 15 cm OR touch sensor pressed.
Possible correction: Don't have the touch and distance sensor aligned, but each off to a different side.

Python code 

See next post Wall and Canyon Python code solution









































































































































































































































Comments

Popular posts from this blog

Overview and progress:

Lego (Color) Sorters