RGS

WRO Submission (Deadline 28 Aug, 23:59H)

Future Innovator (Plant Trimming)

Sending data. The computer performing the identification of the unhealthy leaf will need to send the position of the leaf (…1, 2, or 3) to the ESP32. Read up on how to send data over serial from this tutorial. This needs to be incorporated into your machine vision program, so that when it identifies the position of the unhealthy leaf, it can send it via the serial connection to the ESP32.

When communicating with the ESP32, use a baudrate of 115200.

Receiving data. The ESP32 will need to receive the sent data. When it is connected to the computer, it can read the data using the standard Python “input()” function. Here’s an example…

while True:
    msg = input('')
    if msg == '1':
        print('Good Morning!')
    elif msg == '2':
        print('Good Afternoon')
    elif msg == '3':
        print('Good Evening')
    else:
        print('Good Bye')

You can test it by going to the “Monitor” tab in IoTy, typing in a message, and clicking the “Send” button (…or press enter).

Navigation Demo

  • Demonstration of how to navigate from point to point using GPS position
    • Load GearsBot using this link (…this will automatically load an appropriate world and robot)
    • Download this Python file and load it into GearsBot using “File => Load Python from your computer”
    • Don’t try to directly copy and paste the code. Read it, understand it, and write your own.
  • Demonstration of localization (…determine robot’s position) using distance sensors
    • Load GearsBot using this link (…this will automatically load an appropriate world and a robot with ackerman drive and 4 laser sensors)
    • Download each of the following Python files and load it into GearsBot using “File => Load Python from your computer”
    • The last demo is similar to the “navigate from point to point” demo at the top of this section, but with changes (…mainly to switch from navigation convention to math convention for angles).
    • A big part of the challenge is in determining which measurement should be used to determine position and which should be discarded. We used a very simple approach here, but there are room for improvements. These are (probably) optional, but you can read up on them to learn more.
      • Calculating error; the larger the angle of incidence, the higher the error.
        • At 90 degrees, a 1 degree error will result in a distance error of less than 0.1%.
        • At 10 degrees, a 1 degree error will result in a distance error of close to 10%
        • You may want to discard readings where the error is expected to be high.
      • Using filters to combine the estimated position (…which are very accurate over short duration, but will drift over long durations) and measured position (…which are accurate over long duration on average, but may give wildly inaccurate values over short duration). A simple filter would be the “complementary filter”.

Machine Vision

Math

PID Controls

Pybricks

Robocup Rescue Line

These slides are old, so the sample code are based on the old EV3 software. You won’t be able to use them directly, but the concepts and approach remains the same.

GearsBot

The line following challenges are particularly relevant to Robocup Rescue Line. Find it under “Worlds -> Select World -> Line Following Challenges”.

Arduino is no longer my recommendation for new designs. The ESP32 with IoTy (see below) is easier to use and much more capable. The non-Arduino documents below remains useful for new designs.

3D Design with Onshape

3D modeling is useful when building custom parts for OnStage. For laser cutting, it would suffice to go through Lesson 1 and Lesson A.

  • Creating an Account
  • Lesson 1 : Sketch and Extrude (ODT / PDF)
  • Lesson 2 : Revolve, Fillet, Chamfer (ODT / PDF)
  • Lesson 3 : Sweep, Loft (ODT / PDF)
  • Lesson 4 : Repeating with Patterns (ODT / PDF)
  • Lesson A : Prepare for Laser Cutting (ODT / PDF)

IoTy

IoTy is a platform for programming the ESP32 using blocks or Python. This is useful for OnStage, Robocup Rescue Line (…if you’re building non-Lego robots), and for general electronics projects (eg. for WRO open category).

Others